Indexing Strategy and Design Questions

Choosing and designing indexes: B-tree, hash, composite, covering, partial, and full-text/inverted indexes, and the trade-offs between read acceleration and write/storage overhead. Covers selecting index columns from query patterns, cardinality and selectivity reasoning, diagnosing why an index is or is not used, and index maintenance: rebuilding or reorganizing a fragmented index, finding and dropping redundant or unused indexes, and rolling out a new index to production safely. Also covers indexing in analytical (bitmap, columnar), partitioned, and distributed/NoSQL systems. Central to database performance interviews.

HardTechnical
35 practiced

Describe an approach to find and remove redundant, unused, or overly costly indexes on a production system. What would you check to identify candidates, and what safety checks and monitoring would you put in place before and after dropping one?

MediumSystem Design
55 practiced

Before rolling out a new index to production, how would you measure whether it actually helps? Describe a before/after benchmarking approach, including what you'd measure and what would make you roll the change back.

MediumTechnical
34 practiced

A dashboard (or application) has degraded after an index was added to a frequently-updated table. Outline a diagnostic checklist, metrics, logs, queries you'd check, to determine whether the new index is the cause, and how you'd measure the impact before deciding to roll it back or adjust it.

HardSystem Design
39 practiced

Design a plan to add a large index to a production table with zero downtime. How do you avoid locking the table for the duration of the build, verify the new index is correct before relying on it, and confirm no query regressions occurred?

EasyTechnical
35 practiced

A nightly ETL loads 200M rows into a reporting table. Describe the differences between index REBUILD and REORGANIZE (or VACUUM in PostgreSQL) and recommend when you would schedule each for a large reporting DB to minimize report downtime.

Unlock Full Question Bank

Get access to all 9 Indexing Strategy and Design interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.