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 > Partitioned Table Performance

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-26-09, 15:32
db2udbgirl db2udbgirl is offline
Registered User
 
Join Date: Mar 2006
Location: Tuticorin, India
Posts: 100
Partitioned Table Performance

DB2 9.1/AIX 5.3

I used the new table partitioning feature available in DB2 9.1 based on a column which divides a big table into two big chunks as below.

HTML Code:
/tmp > db2 "select distinct(src_type), count(*) from cust_p group by src_type with ur"

SRC_TYPE 2
---------------- -----------
R                   58877755
S                   70305552

  2 record(s) selected.
I placed data in two differenct tablespaces one for 'R' and 'S'. My query has a filter on SRC_TYPE='R' still I do not see any major performance gain of partition elimination after partitioning this table.

Any thoughts about this table partitioning feature on DB2 9 or is this not a good candidate ?
Reply With Quote
  #2 (permalink)  
Old 05-26-09, 18:52
Stealth_DBA Stealth_DBA is offline
Registered User
 
Join Date: May 2009
Posts: 472
db2udbgirl, The more distinct you can make the partition keys, the fewer rows will be in each partition.

Even though you have 2 partitions instead of one table, you are still going to be doing a partition scan of about 60 million rows. An Index on the column wouldn't be used as the optimizer can tell it would have to retrieve half the rows in the table anyway. SRC_TYPE by itself isn't unique enough to break the partition down to smaller chucks.

As an example, Assume SRC_TYPE could be all 26 letters of the alphabet. Also the rows are evenly distributed across all letters (a bit of a stretch, I know), you would then have on average, 5 million rows per partition. This still won't be very fast but it should run in a little less than 1/10 the time.

Another factor is what disks you are using and where the containers are defined. If you can spread the partitions on different disks, you can improve parallel I/O. Assuming the 26 SRC_TYPE values again, if you had something like SRC_TYPE IN('A', 'Z'), and the partitions are on different disks, two parallel tasks could be started to read both partitions at the same time cutting the query time in about 1/2.
Reply With Quote
  #3 (permalink)  
Old 05-27-09, 09:21
MarkhamDBA MarkhamDBA is offline
Registered User
 
Join Date: Dec 2008
Location: Toronto, Canada
Posts: 381
I am preparing for partitioning in our environment and here is what I realized.

It's simple logic: the indexes of partitioned tables are not partitioned (each index is still located in one TS) so for index scans there would not be any performance improvement. You might notice some improvement in index scan cases if you place indexe(s) in separate TS(s). But you could do it in prev. versions of DB2 too.

Does it make sense?
__________________
DB2 v9.5 ESE on AIX v6.1/ v9./10 on z/OS

Last edited by MarkhamDBA; 05-27-09 at 09:47.
Reply With Quote
  #4 (permalink)  
Old 05-27-09, 16:17
db2udbgirl db2udbgirl is offline
Registered User
 
Join Date: Mar 2006
Location: Tuticorin, India
Posts: 100
Thanks for the response. I will retry with a good partitioning key.
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