By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,756 Members | 1,749 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,756 IT Pros & Developers. It's quick & easy.

DB2 Merge performance

P: 1
I have a base table with almost 8 million records.
There are 2 tables one containing the new inserts and other containing updates to the base table.
Now I have two options:-
1. Use Update statement and then Insert into the base table.

2. Use Merge statement on base table and staging table that will contain both the inserts as well as updated records.

This query needs to be run everyday.
Which approach should I follow considering the performance criteria?

I would appreciate any help to the above problem?
Aug 21 '07 #1
Share this Question
Share on Google+
1 Reply


P: 12
I have a base table with almost 8 million records.
There are 2 tables one containing the new inserts and other containing updates to the base table.
Now I have two options:-
1. Use Update statement and then Insert into the base table.

2. Use Merge statement on base table and staging table that will contain both the inserts as well as updated records.

This query needs to be run everyday.
Which approach should I follow considering the performance criteria?

I would appreciate any help to the above problem?
I'm not sure you've provided enough information. The answer may depend on how many rows are in the insert and updates tables. If they're small relative to the base table, then I'd go with option 1. Probably the best thing you can do is to test both options and choose the option that performs best in your environment.

Fritz
Aug 24 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.