Re: External table performance

From: Dominic Brooks <dombrooks_at_hotmail.com>
Date: Sat, 13 Jan 2018 08:42:52 +0000
Message-ID: <HE1P190MB025043E11B96B6B952147F9FA1140_at_HE1P190MB0250.EURP190.PROD.OUTLOOK.COM>



Trace it or provide a simple reproducible test case.

Sent from my iPhone

On 12 Jan 2018, at 23:59, Sanjay Mishra <dmarc-noreply_at_freelists.org<mailto:dmarc-noreply_at_freelists.org>> wrote:

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_at_yahoo.com<mailto:smishra_97_at_yahoo.com>> 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) column
Is your select a single table query on the external table?
===> It is single table Select

Select Columns
from T able
where State_cd=:cid
and 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_at_rsiz.com<mailto:mwf_at_rsiz.com>> wrote:

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_at_freelists.org<mailto:oracle-l-bounce_at_freelists.org> [mailto:oracle-l-bounce_at_freelists.org] 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_at_oracle.com<mailto:raza.siddiqui_at_oracle.com>> 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_at_freelists.org<mailto:oracle-l-bounce_at_freelists.org> <oracle-l-bounce_at_freelists.org><mailto:oracle-l-bounce_at_freelists.org> on behalf of Sanjay Mishra <dmarc-noreply_at_freelists.org><mailto:dmarc-noreply_at_freelists.org> 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

--

--
http://www.freelists.org/webpage/oracle-l
Received on Sat Jan 13 2018 - 09:42:52 CET

Original text of this message