INSERT Statement Optimization

A script is inserting data into one table, it was taking 15 min to complete before. Today it is taking more than 2 hours. What kind of action you will take?

Questions by mailtonagaraja   answers by mailtonagaraja

Showing Answers 1 - 12 of 12 Answers

Following steps need to be taken


1) See the last date when the table was analyzed.
2) See the explain plan of the query which taking longer time.

  Was this answer useful?  Yes

luciapop

  • Jun 29th, 2010
 

1. I would create indexes on the table.
2. I would parallelize the load (using the parallel hint).
3. I would partition the table and do the insert into the new partition.

  Was this answer useful?  Yes

Do not paste in sql client and run the script. 

Use sql administration console. First analyze it and browse the sql dump file and execute it. 
Think there will be no issue.

  Was this answer useful?  Yes

smonroy

  • Sep 28th, 2011
 

Also you can do the below steps

1.- Normalization your DB
2.- Break the INSERT in some INSERTs instead have one
3.- You need to create indexes on the table

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions