View previous topic :: View next topic
|
Author |
Message |
Muthukumar.PLindia
New User
Joined: 03 Jul 2006 Posts: 51 Location: Chennai
|
|
|
|
hi,
could this be clarified...
1) on creating a table with primary key, an index will be created. Is it a cluster index.....
2) on creating a cluster index, the physical locations wil be changed.. so if we have indexes before.. how does the pointing positions be altered...
If anybody have good refrences about index scanning, cluster index.. please provide some info.. |
|
Back to top |
|
|
MFRASHEED
Active User
Joined: 14 Jun 2005 Posts: 186 Location: USA
|
|
|
|
Quote: |
1) on creating a table with primary key, an index will be created. Is it a cluster index.....
|
A index will be created only if processed by the schema processor.
When a table is created with UNIQUE or PRIMARY KEY clause, it is marked unavailable until you explicity create an index.
A clustering index will not be created unless specified.
Quote: |
on creating a cluster index, the physical locations wil be changed.. so if we have indexes before.. how does the pointing positions be altered...
|
REORG has to be done.
A clustering index determines how the rows are physically ordered in a table. The data manager uses the clustering index to determine where to insert a row. The CLUSTERING RATIO is the percentage of rows in sequence on the data pages. It is a value computed by the RUNSTATS UTILITY. If a table as a clustering ratio in lower nineties, Db2 may consider it as non-clustered.
So 3 R's (REORG, RUNSTATS,REBIND) have to be frequently run to keep table index in good shape. |
|
Back to top |
|
|
MFRASHEED
Active User
Joined: 14 Jun 2005 Posts: 186 Location: USA
|
|
Back to top |
|
|
Muthukumar.PLindia
New User
Joined: 03 Jul 2006 Posts: 51 Location: Chennai
|
|
|
|
thanks a lot rasheed for your help |
|
Back to top |
|
|
|