Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to speed up sequence insert

Vishal RautSep 30 2024 — edited Sep 30 2024

I have a table with about 5 million records. At specific day, we transfer these records from source table to target table. The only column difference is that target table has a sequence column. For this I have created a sequence with a cache of 10000. Insert query would be like this:

insert into target select seq_name.nextval, * from source;

With sequence added, the above statement takes 2 minutes to complete. I have tried couple of other ways, like first adding the record to target table & then updating sequence or using merge to update sequence later. But it always take more time.

Is there any other way to increase the performance of the insert query?

Comments
Post Details
Added on Sep 30 2024
22 comments
1,485 views