If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > How can we increase CLUSTERRATIO of a regular index??

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-04-11, 06:24
shore shore is offline
Registered User
 
Join Date: Aug 2011
Location: Mumbai,India
Posts: 49
How can we increase CLUSTERRATIO of a regular index??

How can we increase CLUSTERRATIO of a regular index??
Reply With Quote
  #2 (permalink)  
Old 10-04-11, 06:35
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
there can be only 1 ci
if the table is also organized by this index, the ratio will increase
in most tables - data is organized according ci and other indexes are not part of organization
they will be used for specific predicates
if you don't have ci - unload the data with order by the clmns from this index and reload data. data will be organized according the index and ratio will increase. the data will not be maintained according the index
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #3 (permalink)  
Old 10-04-11, 14:33
Peter.Vanroose Peter.Vanroose is offline
Registered User
 
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
Just a simple example to clarify this:
suppose you have a table with two columns: country names and city names.
suppose that you define two indexes, one per column.
finally suppose that your table data is physically sorted on the city names, and then (for equal cities) on the country name.

The cluster ratio of the "city names" index will then be 100%, while it would be very unlikely that the cluster ratio of the other index is higher than 10% (unless there are very few different cities or countries): country names will appear in seemingly random order.

The other way around, and assuming several cities per country, the cluster ratio of the "cities" index *could* be around 50% or even higher, e.g. when rows would be physically sorted on city for equal countries. But you'll never get both indexes have cluster ratio 100%, unless there's just a single country, or in the very unlikely event when the first few characters of city names equal their country name.
__________________
--_Peter Vanroose,
__IBM Certified Database Administrator, DB2 9 for z/OS
__IBM Certified Application Developer
__ABIS Training and Consulting
__http://www.abis.be/
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On