What is index cardinality?
-
Number of distinct values a column contain
-
Number of distinct values a column or columns contain
-
Number of distinct values a row contain
-
Number of distinct values a row or rows contain
Index cardinality refers to the number of distinct values in the indexed column(s). A single-column index's cardinality is the count of distinct values in that column. For multi-column (composite) indexes, it's the count of distinct value combinations. Options A and B both correctly capture this definition.
Index cardinality refers to the number of distinct (unique) values contained in an indexed column, or in the combined set of columns when the index spans more than one column. Higher cardinality means more distinct values relative to the total row count, which generally makes the index more selective and useful to the query optimizer. It's a property of the column(s) being indexed, not of individual rows.