RE: Index selectivity versus clustering factor

  • From: "Bobak, Mark" <Mark.Bobak@xxxxxxxxxxxx>
  • To: "Amir.Hameed@xxxxxxxxx" <Amir.Hameed@xxxxxxxxx>, "oracle-l@xxxxxxxxxxxxx" <oracle-l@xxxxxxxxxxxxx>
  • Date: Tue, 23 Apr 2013 12:10:08 -0400

Hi Amir,

It depends on the execution plan.

Consider that if your index access is *not* followed by a "TABLE ACCESS BY 
ROWID", then clustering factor is irrelevant.

Also, the more selective an index is (the fewer rows will be identified through 
index access), the less important the clustering factor is.

The clustering factor is a relative measure of how much work Oracle will have 
to do when doing TABLE ACCESS BY ROWID lookups, based on the index range scan.  
The larger the range of rows (less selective) the index returns based on your 
predicates, the more important clustering factor will be in the cost 
calculations.

Hope that helps,

-Mark
________________________________________
From: oracle-l-bounce@xxxxxxxxxxxxx [oracle-l-bounce@xxxxxxxxxxxxx] On Behalf 
Of Hameed, Amir [Amir.Hameed@xxxxxxxxx]
Sent: Tuesday, April 23, 2013 11:37
To: oracle-l@xxxxxxxxxxxxx
Subject: Index selectivity versus clustering factor

The MTL_MATERIAL_TRANSACTION table in the Oracle ERP database has multiple 
indexes on it. Statistics are gathered on this table once a week. We have 
noticed that SQL plan for a particular SQL statement is alternating between two 
indexes,  MTL_MATERIAL_TRANSACTIONS_N1 & MTL_MATERIAL_TRANSACTIONS_N3. The 
Selectivity and CF of these two indexes is shown below:
INDEX_NAME                         NUM_ROWS DISTINCT_KEYS CLUSTERING_FACTOR
------------------------------ ------------ ------------- -----------------
MTL_MATERIAL_TRANSACTIONS_N1    133,880,400    68,318,310        81,749,000
MTL_MATERIAL_TRANSACTIONS_N3    138,635,500    36,643,500        43,579,800

It seems that index MTL_MATERIAL_TRANSACTIONS_N1 is more selective than 
MTL_MATERIAL_TRANSACTIONS_N3 but MTL_MATERIAL_TRANSACTIONS_N3 has a better CF. 
In this scenario, when preparing an execution plan, which statistic takes 
precedence over the other?

Thank you,
Amir

--
//www.freelists.org/webpage/oracle-l




--
//www.freelists.org/webpage/oracle-l


Other related posts: