Home » RDBMS Server » Performance Tuning » Insert into table slows down query (Oracle 8i)
Insert into table slows down query [message #476426] Thu, 23 September 2010 04:40 Go to next message
dev_777
Messages: 32
Registered: June 2010
Member
When i run a script that does a select from a single table (table has 33521868 records)the query is executed in about .094 seconds. I use the exact same query to insert into a temporary table and the query takes 10 minutes and more.

What should I be doing to speed up this process. Also tried using hints and it does not speed up the insert.

Thanks
Re: Insert into table slows down query [message #476427 is a reply to message #476426] Thu, 23 September 2010 04:41 Go to previous messageGo to next message
Roachcoach
Messages: 1576
Registered: May 2010
Location: UK
Senior Member
0.94 seconds to return ALL the rows from the query, or just the first n?
Re: Insert into table slows down query [message #476734 is a reply to message #476427] Fri, 24 September 2010 18:07 Go to previous messageGo to next message
rleishman
Messages: 3728
Registered: October 2005
Location: Melbourne, Australia
Senior Member
Didn't any alarm bells go off when Oracle "returned" 34M rows in less than one-tenth of a second?

Roachcoach has it right; you have only SELECTed the FIRST PAGE of rows, not all of them. When you run the INSERT, it does not return until every single row is processed.

Ross Leishman
Re: Insert into table slows down query [message #476962 is a reply to message #476734] Mon, 27 September 2010 08:46 Go to previous message
S.Rajaram
Messages: 1027
Registered: October 2006
Location: United Kingdom
Senior Member
Quote:

Didn't any alarm bells go off when Oracle "returned" 34M rows in less than one-tenth of a second?

Unless OP is using Exadata (I know he is not).

http://structureddata.org/2010/04/23/the-core-performance-fundamentals-of-oracle-data-warehousing-data-loading/

Regards

Raj
Previous Topic: Flushing Buffer Cache.
Next Topic: Columns of v$ sessions_event.
Goto Forum:
  


Current Time: Fri Nov 22 07:43:26 CST 2024