3 ms·
I always put an index on nearly every field that could potentially be used to do a SELECT or an ORDER BY on. I'm not sure I've ever run into a serious problem d
by akie 7y ago
I always put an index on nearly every field that could potentially be used to do a SELECT or an ORDER BY on. I'm not sure I've ever run into a serious problem doing this. Usually, the opposite is true - not having an index can cause serious problems.
In a way, I look at indexes like I used to look at these "turbo" buttons (1) on older PCs: no reason not to press it.
(1) https://en.wikipedia.org/wiki/Turbo_button https://en.wikipedia.org/wiki/Turbo_button
- zambal 7y agoIndexes mostly have an impact on write performance and space used on disk, so if both are not a concern for your use case, creating lots of indexes is fine.
- ivanhoe 7y agoOh, yes, turbo button, the only thing more useless than caps lock :) Usually compound indexes are the best idea, but you need first to see what queries are running against DB to know what to add.