What do index searches mean in Postgres 18's explain analyze?
pgmustard.com·4h·
Discuss: Hacker News
Flag this post

Cover photo credit: Diogo Nunes* (nature draws indexes pretty well, huh?)*

In Postgres 18 you’ll now see “Index Searches” lines in EXPLAIN ANALYZE output. If like me you were wondering what those mean exactly, you’re in the right place.

The simple case

The standard case is “Index Searches: 1” which means a single descent of the index. This may be very efficient, if everything we need is in the same area of the index. It may also be very inefficient, if the entries we need are not colocated, and therefore lots of the entries scanned through do not meet our conditions. More on this later!

What about when Index Searches > 1

In Postgres 17, there was a nice optimisation to “allow btree indexes to more efficiently find a set of values, such as…

Similar Posts

Loading similar posts...