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 > primary keys

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-23-04, 23:33
starra starra is offline
Registered User
 
Join Date: Sep 2003
Location: manila
Posts: 21
Question primary keys

Hi All,

Im using DB2 ver 7 for OS/390.
I haven't got the time to test this although I really intend to but could somebody tell me if there's a rule against this scenario.

Table A have have a primary key defined in col1. I intend to partition this table. Is it ok to partitioned it according to col2 although the primary key is defined in col1.

Logically i don't see any problem but can someone tell if there's a rule against it?

thanks!
Reply With Quote
  #2 (permalink)  
Old 05-24-04, 04:03
RKrick RKrick is offline
Registered User
 
Join Date: Feb 2002
Location: Germany
Posts: 141
You normally won't use your primary key as partitioning key (although you can). It's OK to use another column. Remember: you only can have one cluster index per table.
Your decision should be based on your knowledge of the data (how is my data distributed, why should some pieces of information stay together in one partition, etc.).

HTH
__________________
Rodney Krick
Reply With Quote
  #3 (permalink)  
Old 05-24-04, 06:43
starra starra is offline
Registered User
 
Join Date: Sep 2003
Location: manila
Posts: 21
Wink

Thanks! Actually I already did a test and it works as you have said. And thanks for the reminder.

starra
Reply With Quote
  #4 (permalink)  
Old 05-24-04, 14:24
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
Partitioning on OS/390 is quite different than on other DB2 platforms, since they use range partitioning, instead of hash partitioning. So it is more likely that the primary key would be used as the partitioning index.
__________________
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
  #5 (permalink)  
Old 05-25-04, 00:44
starra starra is offline
Registered User
 
Join Date: Sep 2003
Location: manila
Posts: 21
Quote:
Originally Posted by Marcus_A
Partitioning on OS/390 is quite different than on other DB2 platforms, since they use range partitioning, instead of hash partitioning. So it is more likely that the primary key would be used as the partitioning index.

thanks! I appreciate the input!
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