All jobs / Database administrator / Performance
Database administrator interview question · 0–1 years
What are table statistics and why should a DBA care about them?
The strongest answer
They are the optimiser’s picture of row counts and value distribution; if they are stale it estimates badly and picks a poor plan, so I keep them fresh after big changes
Why it works
Exactly — plans are only as good as the estimates behind them.
What a good answer covers
- Statistics feed the optimiser.
- Stale stats, bad plans.
- Refresh after big changes.
- Every engine relies on them.
Answers that fall short
- Close, but not the strongest: They are usage counters that show which tables are most popular
Those are activity counters; planner statistics describe the data’s shape. - Weak: They are only useful for reporting on database growth
Growth reporting is a side use; plan quality is the main one. - Red flag: Modern optimisers do not need them; they look at the data directly
No optimiser reads the whole table to plan a query; it relies on statistics.
Who gets asked this
More Performance questions
- Does the column order in a composite index matter?
- You index a status column that has three possible values and the query is no faster. Why?
- Dozens of sessions are waiting and the app has slowed to a crawl. How do you find the culprit?
- The application logs show deadlocks a few times a day. What do you do?
- Several sessions sit “idle in transaction” for hours. Why does that matter and what do you do?
- A query that ran in milliseconds now takes minutes, right after a large data load. First suspect?
- 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?