There seems to be an assumption that the burden of proof is on showing that the index adds enough value to be worth it. My understanding is that the cost of adding an index is quite small though—it’s easy, battle tested, doesn’t lead to bugs, and doesn’t have much impact on performance at insertion time—so it at least seems worth discussing the question of burden of proof instead of assuming an answer to it.
If you are already using a database and think you might want a simple index (ex: on an ID) then sure, just add it. But if feeling like you should have an index pushes you to start using a database, or if you want the support something complicated like full text search, then I don’t think it’s so clear.
(This post is not anti-index, it is anti-”you should never be doing full table scans in production”)
There seems to be an assumption that the burden of proof is on showing that the index adds enough value to be worth it. My understanding is that the cost of adding an index is quite small though—it’s easy, battle tested, doesn’t lead to bugs, and doesn’t have much impact on performance at insertion time—so it at least seems worth discussing the question of burden of proof instead of assuming an answer to it.
If you are already using a database and think you might want a simple index (ex: on an ID) then sure, just add it. But if feeling like you should have an index pushes you to start using a database, or if you want the support something complicated like full text search, then I don’t think it’s so clear.
(This post is not anti-index, it is anti-”you should never be doing full table scans in production”)
I see. That makes sense.