IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Clustering and Indexing


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
murugan_mf

Active User


Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

PostPosted: Tue Sep 16, 2008 2:11 pm
Reply with quote

Hi all,
Can any one explain Clustering and Indexing with respect to creation of tables and which one is efficient?
Back to top
View user's profile Send private message
vishal_arora

New User


Joined: 20 May 2005
Posts: 16

PostPosted: Tue Sep 16, 2008 2:24 pm
Reply with quote

A clustered index is a special type of index that reorders the way records in the table are physically stored.
Therefore table can have only one clustered index. The leaf nodes of a clustered index contain the data pages.

Clustered index is more efficient . Rows ordered on clustered index makes load as well as retrieval faster
Back to top
View user's profile Send private message
Prasanthhere

Active User


Joined: 03 Aug 2005
Posts: 306

PostPosted: Tue Sep 16, 2008 3:45 pm
Reply with quote

A DB2 index is a clustering index if the CLUSTER keyword is specified when the index is created.In a clustered index rows are stored contionously in sequence

When you define a clustering index on a DB2 table, you direct DB2 to insert rows into the table in the order of the clustering key values. The first index that you define on the table serves implicitly as the clustering index unless you explicitly specify CLUSTER when you create or alter another index. For example, if you first define a unique index on |the ACCTID column of the TRANS table, DB2 inserts rows into the TRANS table in the order of the customer account number unless you explicitly define another index to be the clustering index

Eg:CREATE INDEX Indexname
ON tablenam CLUSTER;
Back to top
View user's profile Send private message
murugan_mf

Active User


Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

PostPosted: Tue Sep 16, 2008 5:23 pm
Reply with quote

Thanks Prasanth
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts array indexing PL/I & Assembler 4
No new posts choice of clustering index DB2 3
No new posts DB2 indexing DB2 5
No new posts Clustering Index Column order DB2 5
No new posts Indexing in db2 with expressions DB2 4
Search our Forums:

Back to Top