All Questions
Database Indexing easy

Why is it generally ineffective to index a 'Low Cardinality' column like `Gender` ('Male'/'Female')?

  1. A Standard B-Tree indexes are strictly limited to numeric identifiers and cannot store variable-length string data like `Gender` categories.
  2. B If a query returns a large percentage of the table (>20%), a Sequential Scan is significantly faster than performing thousands of random index seeks.
  3. C Low cardinality indexes consume a disproportionate amount of physical disk storage due to the way they handle internal page-filling policies.
  4. D Filtering by low cardinality columns causes the database engine to acquire aggressive, table-level locks that frequently lead to application deadlocks.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions