If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > UDB Merge issues/problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-26-07, 16:04
mrehman mrehman is offline
Registered User
 
Join Date: Sep 2006
Posts: 6
UDB Merge issues/problem

We have 64 partition 50+ terabyte datawarehouse environments. The development team wanted to use Merge statement for populating the data from one layer to another 1 to 1. Did anyone saw any issues or problem with Merge statement for moving data in millions or rows? Wouldn’t ETL (datastage) be a better option?
Reply With Quote
  #2 (permalink)  
Old 04-27-07, 10:20
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
I'm not sure I can give a definitive answer to suit your environment ...

Generally speaking , there is no specific disadvantage using MERGE Statement that I'm aware of ... I would think, a MERGE stmt will perform much better than a ETL job as there is no data movement outside the database manager ...

Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 04-27-07, 11:33
mrehman mrehman is offline
Registered User
 
Join Date: Sep 2006
Posts: 6
I agree with the no data movement outside of the DBM. However, since there is no control over frequent commits. The transaction put an exclusive lock on the tables. This will result into table being not available for access for other users. What you’re thought on this.
Reply With Quote
  #4 (permalink)  
Old 04-28-07, 14:29
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Locking is probably not a big issue. A much bigger problem will be logging. Each change to the table is logged and a MERGE statement that changes a lot of rows produces a lot of log records. You could use NOT LOGGED INITIALLY for your table to avoid logging, but that has certain implications on the recoverability of the database.

As for the question regarding committing in between, you could apply the usual techniques to process batches of rows (with a single MERGE statement) and commit after each batch.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On