All Questions
Postgresql medium

You have a table where 99% of rows are 'Processed' and 1% are 'Pending'. How should you index this to optimize for 'Pending' searches?

  1. A Implement a Partial Index: index only the rows where the status is explicitly 'Pending'.
  2. B Implement a Cover Index: include all columns in the index to avoid accessing the heap.
  3. C Implement a Cluster Index: reorder the physical storage of the table based on status.
  4. D Implement a Unique Index: ensure that no two rows can have the same timestamp value.

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

Get the app

Related questions