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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to speed up sequence insert

Vishal Raut3 days ago — edited 3 days ago

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 3 days ago
19 comments
157 views