All jobs / Database administrator / Performance
Database administrator interview question · 1–3 years
What is a covering index and when is it worth it?
The strongest answer
An index that holds every column the query needs, so the engine never touches the table; worth it for a hot, narrow query, at the cost of a wider index on every write
Why it works
Exactly — no table lookup, but a wider index to maintain; reserve it for hot paths.
What a good answer covers
- Index holds all needed columns.
- No table lookup.
- Wider index, more write cost.
- For hot, narrow queries.
Answers that fall short
- Close, but not the strongest: An index on all columns of the table
An index on every column is a copy of the table, not a covering index. - Weak: Any index that the query happens to use in its execution plan
Using an index is not the same as being satisfied entirely by it. - Red flag: A special index type that automatically covers whatever queries appear
Nothing covers automatically; you choose the included columns for a known query.
Who gets asked this
More Performance questions
- Hundreds of application pods each keep a pool of twenty connections. The database is out of connections. Fix?
- The same parameterised query is fast for most customers and terribly slow for one large customer. What is…
- The plan cache is full of thousands of near-identical statements that differ only by literal values. Impact…
- A nightly job updating a few million rows locks the entire table and blocks the application. Why, and what do…
- One row holding a global counter is updated by every request and has become the bottleneck. Options?
- A table is partitioned by month but queries still scan every partition. Why?
- The server is busy and nobody can say why. How do you use wait statistics to answer that?
- In plain words, how does an index make a query faster?