Database indexing: the questions we get asked most
There is no clever trick in this one, just a handful of decisions worth making deliberately. The questions about database indexing that come up most often on our calls.
Real-world numbers from actual visitors matter more than a score produced on a fast laptop. Most teams find the first pass takes an afternoon and the maintenance takes minutes a month.
Do we need to care about this?
The right index turns seconds into milliseconds. Small and consistent beats large and occasional here. Write the reasoning down alongside the decision, because the reasoning is what changes first.
Can it wait until after launch?
Occasionally. More often the post-launch version costs several times the pre-launch one. In practice this is a scheduling problem more than a technical one.
How do we know it is working?
Look at the query plan instead of guessing. Where this goes wrong is almost never a lack of knowledge. The version that survives contact with a real deadline is the simple one.
In practice
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
- Every index also slows writes, so be deliberate — 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.