Getting started with database indexing
This is cheap to get right at the start and expensive to retrofit. A short on-ramp to database indexing for teams who have not touched it before.
Performance work is mostly subtraction, which makes it unpopular and effective. Check it against what you would want a competitor's site to get wrong.
What it costs to ignore
The right index turns seconds into milliseconds. Small and consistent beats large and occasional here. The version that survives contact with a real deadline is the simple one.
Your first week
- Find out what is already in place
- Every index also slows writes, so be deliberate
- Change one thing and measure it
Look at the query plan instead of guessing. It is worth being explicit about, because assumptions differ quietly. Assume whoever inherits this will have half your context and none of your patience.
The short version
Speed is a feature people notice only in its absence, and then they leave rather than complain. 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
If you want a second opinion on how yours is set up, ask.