Long time for Insert in Bteq


Long time for Insert in Bteq

Hello All,

I am doing a simple Select Insert through a Bteq job like below. The count is huge around 500 millions.

Insert into target_table (a,b,c) select a,b,c from input_table;

After running the Bteq for sometime, by doing, "locking row for access select count(*) from target_table", I can see all the records are already inserted. But the Bteq command is still on and looks like the table is still being inserted. Because the "select count(*)" command is taking more time. After another 10-15 mins, the job is getting completed.

Can anyone pls put some light on it. How to avoid such behaviour and complete the loading immidiately.

Thanks in Advance


Tags (3)