All Questions
Database Indexing easy

In a composite index `(A, B)`, if specific rows have `NULL` for column B, are they included in the index?

  1. A No, standard B-Tree indexes strictly exclude all rows containing a NULL value to minimize the overall physical footprint of the index file.
  2. B Yes, modern B-Tree indexes typically include NULL as a sortable value, allowing the database to efficiently satisfy `IS NULL` query predicates.
  3. C Only in specialized NoSQL databases, as relational systems require all indexed columns to possess a concrete, non-null value for hash-consistency.
  4. D Yes, but only if the database is configured to automatically convert all incoming NULL values into empty strings or zero-value numeric equivalents.

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

Get the app

Related questions