Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Clustering Index Column order

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Sep 22, 2011 7:23 pm    Post subject: Clustering Index Column order
Reply with quote

Hi,

I want to know if the table column order and clustering index column order has a impact on the performance of the DB2 sorting?

Example

Code:

Table1
(
COL1 CHAR(10),
COL2 CHAR(10),
COL3 CHAR(10),
COL4 CHAR(10)
)

Cluster index1
Code:

COL3 ASC,
COL4 ASC


So my question here is if putting col3 and col4 as 1st two columns of the table will improve any performance or not?
Back to top
View user's profile Send private message

GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1278
Location: Belgium

PostPosted: Thu Sep 22, 2011 9:13 pm    Post subject:
Reply with quote

I don't think so.
which column gets the most updates is more important
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Fri Sep 23, 2011 12:39 pm    Post subject:
Reply with quote

Thanks GuyC...

Actually our DBA suggest to keep COL3 and COL4 as the 1st two columns of the table

like
Code:

Table1
(
COL3 CHAR(10),
COL4 CHAR(10),
COL1 CHAR(10),
COL2 CHAR(10)
)


as the columns are part of cluster index
Code:

ClusterIndex
(
COL3 ASC,
COL4 ASC
)
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Fri Sep 23, 2011 12:39 pm    Post subject:
Reply with quote

Also... Always there will be inserts to this table.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1278
Location: Belgium

PostPosted: Fri Sep 23, 2011 2:59 pm    Post subject:
Reply with quote

It is defenitely good practice to make the primary key columns the first columns. Clustering key-columns is an acceptable variation on the same theme.
Because usually/hopefully these columns don't get much updates.

AFAIK Column order vs inserts are not relevant for performance.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Fri Sep 23, 2011 4:44 pm    Post subject:
Reply with quote

Thanks GuyC..
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Add system date inside of a PS file a... pramitdas DFSORT/ICETOOL 5 Sun Aug 28, 2016 12:06 am
No new posts Converting NULL column into NOT NULL ... Raghu navaikulam DB2 5 Sat Aug 06, 2016 3:45 pm
No new posts Several errors during building altern... Andi1982 JCL & VSAM 11 Wed Jul 06, 2016 7:39 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us