5 ms·
It's not a "stupid reason". Indexes are not free, you either pay to maintain indexes or you pay for a full table scan at query time. I for one want that control
by perrygeo 2y ago
It's not a "stupid reason". Indexes are not free, you either pay to maintain indexes or you pay for a full table scan at query time. I for one want that control. First of all, tables < millions of rows can fit comfortably into memory and a full table scan can be perfectly fine. The "Index every possible thing" strategy can backfire horribly and cause massive inefficiencies - only to discover half the indexes aren't even getting used. Benchmark first.
- hinkley 2y agoForeign key indexes are pretty cheap. If you have a spot where that’s breaking your architecture, that might be your architecture and not the index. And as I already said, you should be able to opt out.