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?