All jobs / Database administrator / Performance
Database administrator interview question · 1–3 years
A data migration loaded three years of history into a table that had held one month.
A query that ran in milliseconds now takes minutes, right after a large data load. First suspect?
The strongest answer
Stale statistics — the optimiser still thinks the table is small and chose a plan that no longer fits; refresh statistics and compare the plans
Why it works
Exactly — a big load is the classic trigger for estimates that no longer match reality.
What a good answer covers
- Big load, stale stats.
- Compare old and new plans.
- Refresh statistics first.
- Do not guess at hardware.
Answers that fall short
- Close, but not the strongest: The load fragmented the table, so I would rebuild it
Fragmentation rarely turns milliseconds into minutes; a plan flip does. - Weak: The server needs more memory since the table grew
Memory is a guess before the plan has been read. - Red flag: Someone changed the query; I would check the code history
Possible, but the timing points at the data, not the code.
Who gets asked this
More Performance questions
- The database shows thousands of identical tiny queries per page load. What is happening and what do you…
- What is a covering index and when is it worth it?
- 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?