what is index cardinality?
-
no of duplicate values
-
no of distinct values
-
no of null values
-
both 1 & 2
Index cardinality refers to the number of distinct (unique) values in an indexed column. A high cardinality index has many unique values (like a primary key), making it very selective and efficient for queries. A low cardinality index has many duplicate values (like a gender column with only 'M' and 'F'), making it less selective. Cardinality helps the query optimizer choose the best execution plan - high cardinality indexes are preferred for filtering and joins. Option A (duplicate values) is the opposite of cardinality. Option C (null values) is unrelated to cardinality definition.
Cardinality of an index refers to the number of distinct (unique) values stored in the indexed column relative to the total number of rows. High cardinality (many distinct values, e.g. a primary key) makes an index highly selective and efficient; low cardinality (e.g. a boolean flag) makes the index less useful for filtering. It has nothing to do with duplicate counts or null counts specifically.