Insert takes too long (forever) into TABLE A, but is fast into TABLE B
724017Apr 29 2011 — edited May 13 2011Hi all,
I have been struggling with a performance issue in a newly created package for my project, which is inserting data to a specific table.
This table (lets call it TABLE A) is partitioned by month, and I managed to perform historical loadings of some 9months (with about 9million rows per month). The procedure is executed at a daily level (with cycle to load full month) - about 2min to load a day, and so around 1h per month for the historical loadings.
All of a sudden when I was starting the loading of the next month, the procedure got stuck in the first day of the month... more than 1h working on what usually is less than 2min... and even so didn't complete. Had to kill the session... tried again, but again the same problem... simply got stuck. After several tries hadn't managed to load any other day.
If I run the query without the insert statement I get the results back on the expected time duration... but not with the insert. Tried loading different days, but never successful after the first hang... (oh.. and there's no lock on the table, case you're wondering)
Just to test, I created another table (with CREATE TABLE B AS SELECT BLAH BLAH) using the exact same query using a specific day. It was loaded with that day's data in the same 2min... Changed it to an insert statement on this new table (TABLE B) and replaced dates, and again was able to load a month worth of data into this new table in the expected duration... so it's not a data/query problem... somehow the insert statement cannot insert more data into the original table (TABLE A)
My question is - what may be the problem with the original table that is causing this issue? Any ideas?
Thank you so much,
NV