Dabish Digital
Performance

Why database indexing matters more than it looks

The advice here is unglamorous, which is probably why it gets skipped. Database indexing is easy to treat as a detail, and that is exactly why it is worth a few minutes of attention.

Speed is a feature people notice only in its absence, and then they leave rather than complain. The practical test is whether someone new to the project could tell, in a minute, that it had been handled.

What is actually at stake

The right index turns seconds into milliseconds. The teams that handle this well are rarely the ones with the biggest budgets. Write the reasoning down alongside the decision, because the reasoning is what changes first.

Every index also slows writes, so be deliberate. In practice this is a scheduling problem more than a technical one. The practical test is whether someone new to the project could tell, in a minute, that it had been handled.

Warning signs

Look at the query plan instead of guessing. This is the sort of thing that compounds, quietly, in both directions. Assume whoever inherits this will have half your context and none of your patience.

How to tell if yours is fine

Performance work is mostly subtraction, which makes it unpopular and effective. Three things worth confirming about database indexing before you move on:

  • Someone can say what the current setup is without going to look
  • Look at the query plan instead of guessing — and you know whether that is true here
  • There is a way to tell whether the last change to this helped

If any of that sounds like a description of your current setup, it is fixable.