Results 1 to 5 of 5

Thread: primary keys

  1. #1
    Join Date
    Sep 2003
    Location
    manila
    Posts
    21

    Question Unanswered: 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!

  2. #2
    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

  3. #3
    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

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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

  5. #5
    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •