All Questions
Database Indexing easy

When defining a composite index, which column should typically come first?

  1. A The column with the smallest physical data type (e.g., Integer) to minimize the footprint of the B-Tree's internal branch nodes.
  2. B The column used in equality predicates (`=`) that has the highest selectivity (i.e., it filters out the largest number of rows).
  3. C The column used in broad range predicates (e.g., `>` or `<`) to ensure that the search space is immediately partitioned by time or value.
  4. D The column that appears first alphabetically to ensure that the index's internal sort order is consistent with the database's metadata.

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

Get the app

Related questions