Mark
forgot to update that query is currently taking around 3-5s for 5-10K data out
of 30-50K total data in table. Requirement is to go in ms to achieve the
business goal
Sanjay
On Friday, January 12, 2018, 5:56:45 PM EST, Sanjay Mishra
<smishra_97@xxxxxxxxx> wrote:
Marks
Thanks for your update. Here are the derails
How many columns per record and what is the average length of a row?===> Only 7
columns with two Date column and 5 Varchar2(5) columnIs your select a single
table query on the external table?===> It is single table Select Select
Columnsfrom T able where State_cd=:cidand DateCol between <date1> and
<date2>and County_id in (<list of 3 Countie>)and status_cd in (<list of
4Status>);
Are there predicates on the external table, or are you filtering on something
in the external table?
===> Provided above is sample Query and only one query been used for external
table
Perhaps you could supply your select statement to give us a clue what you are
trying to do.
==> Yes as shown above
When you write that the storage is local, do you mean that the external table
file is on your PC or do you mean that the external table file is local to the
database server?
==> File is local to Database Server
IF the file is on your PC, you might well be testing your network bandwidth and
latency to the database server as opposed to anything else. The time to
transfer the file to the database server using an OS level tool would give you
a decent approximation of the minimum time to complete.
==> File is not on PC
IF the file is on your PC, the “records” are long, and you only need a few
short columns from the “local” file, you might consider retrieving it via a
pipe from sed so only the required data is transmitted across the WAN.
Thanks for your input and suggestions.
Sanjay
On Friday, January 12, 2018, 4:19:44 PM EST, Mark W. Farnham <mwf@xxxxxxxx>
wrote:
#yiv0228426399 -- filtered {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2
4;}#yiv0228426399 filtered {font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 2
4;}#yiv0228426399 filtered {panose-1:0 0 0 0 0 0 0 0 0 0;}#yiv0228426399
p.yiv0228426399MsoNormal, #yiv0228426399 li.yiv0228426399MsoNormal,
#yiv0228426399 div.yiv0228426399MsoNormal
{margin:0in;margin-bottom:.0001pt;font-size:12.0pt;}#yiv0228426399 a:link,
#yiv0228426399 span.yiv0228426399MsoHyperlink
{color:blue;text-decoration:underline;}#yiv0228426399 a:visited, #yiv0228426399
span.yiv0228426399MsoHyperlinkFollowed
{color:purple;text-decoration:underline;}#yiv0228426399 p
{margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv0228426399
p.yiv0228426399MsoAcetate, #yiv0228426399 li.yiv0228426399MsoAcetate,
#yiv0228426399 div.yiv0228426399MsoAcetate
{margin:0in;margin-bottom:.0001pt;font-size:8.0pt;}#yiv0228426399
span.yiv0228426399BalloonTextChar {}#yiv0228426399
span.yiv0228426399EmailStyle20 {color:#1F497D;}#yiv0228426399
.yiv0228426399MsoChpDefault {font-size:10.0pt;}#yiv0228426399 filtered
{margin:1.0in 1.0in 1.0in 1.0in;}#yiv0228426399 div.yiv0228426399WordSection1
{}#yiv0228426399
You wrote 50K records.
How many columns per record and what is the average length of a row?
Is your select a single table query on the external table?
Are there predicates on the external table, or are you filtering on something
in the external table?
Perhaps you could supply your select statement to give us a clue what you are
trying to do.
When you write that the storage is local, do you mean that the external table
file is on your PC or do you mean that the external table file is local to the
database server?
IF the file is on your PC, you might well be testing your network bandwidth and
latency to the database server as opposed to anything else. The time to
transfer the file to the database server using an OS level tool would give you
a decent approximation of the minimum time to complete.
IF the file is on your PC, the “records” are long, and you only need a few
short columns from the “local” file, you might consider retrieving it via a
pipe from sed so only the required data is transmitted across the WAN.
So far we can really only speculate what you are actually trying to accomplish.
mwf
From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On ;
Behalf Of Sanjay Mishra (Redacted sender "smishra_97" for DMARC)
Sent: Friday, January 12, 2018 3:32 PM
To: Oracle-L Freelists; raza siddiqui
Subject: Re: External table performance
Raza
You are right that data is not an issue and so is External table but Select
with few where clause and it cannot be index.
Sanjay
On Friday, January 12, 2018, 2:42:22 PM EST, raza siddiqui
<raza.siddiqui@xxxxxxxxxx> wrote:
Sanjay
Firstly, a 50k datafile is not big by any standards...
Secondly, when External Tables get to be fairly sizeable, one option could be
to load the data into a temp table in the Database, use it then truncate once
done.
Lastly, could the main select be the issue and not the External table or its
data ?
On 1/12/2018 11:28 AM, Powell, Mark wrote:
Sanjay, you did not identify your Oracle version and edition nor post the
actual code you have an issue with but consider the following.
I do not have access to a server where I can test right now but I believe that
you can select from an external table using parallel query if you are on EE.
Mark Powell
Database Administration
(313) 592-5148
From: oracle-l-bounce@xxxxxxxxxxxxx <oracle-l-bounce@xxxxxxxxxxxxx> on behalf
of Sanjay Mishra <dmarc-noreply@xxxxxxxxxxxxx>
Sent: Friday, January 12, 2018 2:23:40 PM
To: Oracle-L Freelists
Subject: External table performance
Can someone share the Tuning activites that can be done for Selecting data from
External table in 12c (12.1)? I am working on project that is getting every
6hourly data as flat file from external source and then has to be selected from
ORacle table for some processing. Data is only 50K records but Select is taking
time. It is Local Storage where File is located. I don;t think we can have
indexes yet and so checking experience from the experts.
Tx
Sanjay
--