Sunday, January 23, 2011

Finding Clustering Factor for Oracle Index

A good CF is equal (or near) to the values of number of blocks of table.

-  A bad CF is equal (or near) to the number of rows of table.
 
It not 100% true that Rebuilding of index can improve the CF.To improve the CF, it’s the table that must be rebuilt (and reordered)
 
====== Script to find the same ======
 
select a.index_name,b.num_rows,b.blocks,a.clustering_factor


from dba_indexes a, dba_tables b

where

index_name in('INDEX_1','INDEX_2','INDEX_3')

and a.table_name=b.table_name;
 

No comments:

Post a Comment