zlacker

[return to "Introduction to PostgreSQL Indexes"]
1. jihadj+aB[view] [source] 2026-01-25 13:59:32
>>dlt+(OP)
The section on multi-column indexes mirrors how I was taught and how I’ve generally handled such indexes in the past. But is it still true for more recent PG versions? I had an index and query similar to the third example, and IIRC PG was able to use an index, though I believe it was a bitmap index scan.

I am also unsure of the specific perf tradeoffs between index scan types in that case, but when I saw that happen in the EXPLAIN plan it was enough for me to call into question what had been hardcoded wisdom in my mind for quite some time.

Further essential reading is the classic Use The Index, Luke [0] site, and the book is a great buy for the whole team.

0: https://use-the-index-luke.com/

◧◩
2. glenja+2W[view] [source] 2026-01-25 16:21:36
>>jihadj+aB
A bitmap index scan allows the database to narrow down which pages could include the data, but then still has to recheck the condition on the contents of those pages - so will still not be as performant as an proper index scan
◧◩◪
3. isbvho+fC1[view] [source] 2026-01-25 20:49:40
>>glenja+2W
With postgres indexes not containing liveness data for tuples you'll have to hit quite a lot of those pages anyway, unless they are frozen.
[go to top]