Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Clustering and Indexing

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Clustering and Indexing
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    Post subject: Reply to: Clustering and Indexing
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    Post subject: Reply to: Clustering and Indexing
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    Post subject:
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    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 DB2 indexing Rohit Umarjikar DB2 5 Thu Jun 21, 2012 2:08 pm
No new posts Clustering Index Column order gylbharat DB2 5 Thu Sep 22, 2011 7:23 pm
No new posts Indexing in db2 with expressions knn9413 DB2 4 Tue Sep 20, 2011 2:42 am
No new posts Indexing issue kanha DB2 1 Mon Jul 25, 2011 1:04 pm
No new posts Table Clustering Index djgoer DB2 9 Thu Sep 24, 2009 9:25 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us