A short guide to database indexing
We end up explaining this on discovery calls often enough that it deserved writing down. Everything we would tell a client about database indexing in the time it takes to drink a coffee.
Speed is a feature people notice only in its absence, and then they leave rather than complain. The version that survives contact with a real deadline is the simple one.
What it costs to ignore
The right index turns seconds into milliseconds. Where this goes wrong is almost never a lack of knowledge. If two people in the business would answer this differently, that gap is the actual problem.
How to approach it
Every index also slows writes, so be deliberate. That sounds obvious written down. It is still the thing most often skipped. It is worth deciding this deliberately rather than inheriting whatever the last person set up.
The mistakes we see most
Look at the query plan instead of guessing. Small and consistent beats large and occasional here. Assume whoever inherits this will have half your context and none of your patience.
In practice
Real-world numbers from actual visitors matter more than a score produced on a fast laptop. Three things worth confirming about database indexing before you move on:
- Someone can say what the current setup is without going to look
- The right index turns seconds into milliseconds — and you know whether that is true here
- There is a way to tell whether the last change to this helped
Pick the one that would hurt most if it failed, and start there.