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 > nodenumber help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-27-10, 17:28
getback0 getback0 is offline
Registered User
 
Join Date: Oct 2010
Posts: 73
nodenumber help

Hello,

I am running a multithreaded application against a DB2 database - and I am trying to breakdown the total data retrieved by the query below into smaller subsets that each of the threads in the application could process independently -

Select
X.C1
from X left outer join Y
on
X.Ck = Y.Ck*

Ck - is the distribution key for both X and Y - they are collocated

(This query is representative of the actual workload I am trying to optimize)

The first query I wrote to split this workload down into 8 smaller subsets (as there are 8 partitions on our test DB server) was -

Partition-1

Select
X.C1
from X left outer join Y
on
X.Ck = Y.Ck
where mod(X.Ck,8) = 0

Partition-2
Select
X.C1
from X left outer join Y
on
X.Ck = Y.Ck
where mod(X.Ck,8) = 1

and so on for other partitions

however, I am told that this is running 8 joins - one for each thread - ON ALL PARTITIONS and then the mod predicate is being applied - that defeats the purpose of breaking the workload down

So I am considering using the nodenumber function as an alternative to the mod function -

obvious question - Would nodenumber function ensure the query issued from each partition be restricted to a single node?

As always, thanks for your help!!!!

- G
Reply With Quote
  #2 (permalink)  
Old 12-28-10, 04:34
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
The documentation of NODENUMBER() does not give such a guarantee, so naturally you cannot really rely on this. It depends on the plan that the optimizer chooses for the queries. Have you had a look at those?
__________________
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