Cardianlity and Selectivity


Cardinality - no of distinct rows.

Selectivity -  no of distinct rows./ total rows.

Highly selective index - has small no of distinct values, for low selective indexes better do a full table scan.

If the optimizer feels that the selectivity of the index is low it ignores. In that case we give hints.