What is the best way to do an upsert
S62065Jan 12 2011 — edited Jan 13 2011Hi all,
I am new to transaction system. Need help on a requirement.
We have a requirement where we have to do an update else insert into a table.
The input data comes from a file and the number of rows should be around 100000 at a time.
The table may contain around 5 million rows. We have to search the table based on nine columns.
What is the best way to do it?
1. A merge or update statement takes hours to complete.
2. Is there any way we can improve the performance? I have tried using index on the nine columns of the table, but the merge statement doesn't use the index, although I am not sure creating an index is going to help here.
Thanks.