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 > DB2 Database Partitioning

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-01-11, 14:25
getback0 getback0 is offline
Registered User
 
Join Date: Oct 2010
Posts: 73
DB2 Database Partitioning

Hello Gurus,

Quick question - my application is DB2 'partitioning-aware'. It initiates 2 application partitions to connect to each of the 2 physical database partitions. I can see messages in the application log indicating each of the application connections connected to individual database partitions.

This particular ETL routine is performing a join between 2 tables A1 and A2 - A1 is hash partitioned on AK1 and A2 is hashed on AK2.

When I look at the queries generated by the application partitions, I see -

Application Partition 1:
Select * from A1 , A2 where A1.AK1 = A2.AK1 and Nodenumber(A1.AK1) = 1

Application Partition 2:
Select * from A1 , A2 where A1.AK1 = A2.AK1 and Nodenumber(A1.AK1) = 2



While I can confirm if there will be data lost due to the above partitioning (application) by reviewing the data, the data load is in progress, and is going to take quite a while,

I was wondering if you guys could tell by just reviewing the description above that my application would miss data because of how it is connecting to the data nodes and performing a non-collocated join.

Thanks in advance for your help!

- G
Reply With Quote
  #2 (permalink)  
Old 11-01-11, 15:57
getback0 getback0 is offline
Registered User
 
Join Date: Oct 2010
Posts: 73
Please help!!!

too complicated - too uninteresting????
Reply With Quote
  #3 (permalink)  
Old 11-01-11, 16:25
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
You will miss data, not because of which partition the applicaiton is connected to, but because of Nodenumber specification in the query. I have no idea why you would do that.

In all probability (without me being able to see the entire db design) both tables should be hashed on column AK2, since it appears to be the column that both table have in common for their PK's.

Always hashing on the full PK's is usually a mistake if done automatically without thinking about it. You should have as many tables as possible (that might participate in joins) be hashed on the same column.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #4 (permalink)  
Old 11-01-11, 19:50
getback0 getback0 is offline
Registered User
 
Join Date: Oct 2010
Posts: 73
Doesnt match with the output

Marcus,

Thanks for the review and response! Although, I am seeing I got all my records back. I guess my question is -

if the application says its logically connected to node number 2 and also applies nodenumber(col) = 2 predicate, does that prevent it from retrieving non collocated records for another table?

The output I am seeing from this test run seems to suggest the database actually pulled other tables' non collocated records and included in the result set of the respective application partition.

- G
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