2 ms·
I also recommend this. It can really help when trying to understand why a query may be slow even though you’re using indices. For example, one index was on a B
by withinboredom 4y ago
I also recommend this. It can really help when trying to understand why a query may be slow even though you’re using indices.
For example, one index was on a Boolean field and the query took several seconds. Most rows were “true” and very rarely did we query for false, and when we did query for false, latency was acceptable. If you know a btree is being used under the hood, you can imagine what the tree looks like and that it is very lopsided. From there, as soon as you see the EXPLAIN, you know how to fix it: drop the index.