Portrait of Mihaly Kertesz

hub / sql server indexing guide

SQL Server
indexing guide.

Most index advice sounds smart until write load, plan churn, and maintenance cost show up. The work only gets better when it stays tied to the real workload.

The focus here is on access patterns, clustered choices, covering versus write cost, and how to review indexes without treating missing-index suggestions as gospel. If deadlocks or contention are already part of the story, keep the SQL Server deadlocks guide nearby.

Related

Use SQL Server consulting when index work needs to stay anchored to production workload instead of generic tuning theatre. Read the SQL Server sizing guide when platform fit is part of the same slowdown, and keep the SQL Server deadlocks guide open when poor access paths first surfaced as concurrency pain.

Use this when

  • Indexes are there to support real access patterns, not to make a missing-index list feel complete.
  • A helpful index can still be a bad index if write cost and maintenance overhead were ignored.
  • Selectivity, lookup behavior, and execution plan quality matter more than generic indexing rules.
  • Index review works best when it starts from workload evidence, not theory alone.

1 / Start point

SQL Server indexes are tradeoffs, not trophies

Every index is a bet that a certain access path is worth maintaining. That bet should be made against real workload behavior, not just a generic idea that more indexing must be better.

The costs are real too: write overhead, maintenance work, storage, plan complexity, and a larger surface for statistics drift and tuning mistakes.

2 / Access paths

Selectivity and access-path quality matter more than generic index enthusiasm

The right index helps SQL Server reach the useful rows with less wasted work. That means table layout, filter pattern, join pattern, and selectivity all matter. A mediocre index can still look reasonable in isolation while doing little for the real workload.

Access checks

  • Which filters and joins really drive the workload?
  • How selective are the leading columns under real usage?
  • Is the plan still touching too much data after the index is added?
  • Are multiple near-duplicate indexes trying to solve the same weak design?

3 / Structure

Pick clustered and nonclustered structures from workload behavior

The clustered key is not just one more index choice. It affects row order, nonclustered index payload, fragmentation behavior, and sometimes the whole way the table performs under mixed read and write pressure.

That is why bad clustered decisions echo through the rest of the design. You can add clever nonclustered indexes later, but they still inherit the structure and maintenance cost of the base choice underneath them.

ChoiceThink about
Clustered keyRow order, write behavior, fragmentation pressure, and the table's dominant access patterns.
Nonclustered indexSpecific query support, lookup cost, and overlap with existing access paths.
Wide key designExtra maintenance and storage cost that may not earn its keep.
Too many overlapping indexesA tuning smell that usually points to weak review discipline.

4 / Coverage

Covering an access path can help, but only if the tradeoff is still worth it

Covering can reduce expensive lookups, but it also broadens the index, increases maintenance cost, and may encourage overfitting the structure to one query at the expense of the broader workload. The real question is still workload value, not elegance.

That tradeoff gets expensive faster than teams expect. A wider index can double the storage and write footprint for a narrow query win, especially when many included columns were added just to silence one painful plan.

Covering checks

  • Is the lookup cost real enough to justify a wider index?
  • Will the included columns increase write and storage cost disproportionately?
  • Is this index serving one query or a meaningful slice of the workload?
  • Could a narrower access-path improvement solve the problem more cleanly?

5 / Cost

Write cost and maintenance impact deserve the same respect as read gains

Extra indexes are not free. They change insert, update, delete, rebuild, storage, and maintenance behavior. In write-heavy or operationally busy estates, that cost can outweigh the nice-looking read improvement if the index was not justified carefully.

6 / Plan behavior

Statistics and plan behavior matter because a good index still needs a sane plan

Index design and statistics quality work together. Even a structurally sound index can underperform when estimates are weak, the workload is skewed, or plans are unstable for reasons the raw index list does not explain.

Review questions

  • Does the execution plan still make sense after the index change?
  • Are estimates close enough to trust the chosen access path?
  • Is the problem actually statistics, skew, or plan stability rather than missing structure?
  • Will the index keep working as the workload shifts?

7 / Workflow

Index review works best when it starts from workload evidence and ends with pruning too

Good index review is sequencing work. If you jump straight to adding structures, the estate gets noisier before anyone proved that the access path problem was even the main problem.

StepWhy it matters
Start from the real workloadIt keeps the review tied to business pain instead of index superstition.
Map access patternsUseful indexes serve repeated query shapes, not isolated guesses.
Measure read and write tradeoffsA better read path can still be a net loss.
Remove or merge redundant indexesGood indexing also includes cleanup, not just addition.

8 / What goes wrong

Common indexing failures come from solving the wrong thing with more structure

MistakeWhat it leads to
Adding indexes from generic suggestions aloneMore structures with weak workload payoff.
Ignoring write costA read improvement that degrades the broader system.
Overlapping indexes everywhereMaintenance bloat and weaker review clarity.
No pruning disciplineThe index estate grows until nobody trusts it.
Forgetting plan and statistics contextIndex changes that never solve the real execution problem.

9 / Review work

Outside index review helps when the team has suggestions but not confidence

The reason to bring help in is not that indexing is obscure. It is that real workloads make the tradeoffs hard to judge quickly, especially when read pain, write cost, plan behavior, and overlapping structures are all mixed together.

Next step

If index decisions need to be checked against the real workload instead of theory, use SQL Server consulting.

Next useful reads: the SQL Server deadlocks guide for concurrency symptoms, the SQL Server sizing guide for the broader hardware and workload-fit side, and the SQL Server monitoring guide for evidence about where the workload is drifting.