On Fri, May 9, 2025 at 1:19 PM Tomas Vondra <to...@vondra.me> wrote: > Not sure I understand. Why would it need to scan 85 index pages? There's > only 100 matching tuples total, spread over the 100 partitions. We'll > need to scan maybe 1 page per partition.
I was unclear. The thing about 85 leaf pages only applies when partitioning isn't in use. When it is in use, each individual partition's index has only one index leaf page. So each individual index scan is indeed fairly inexpensive, particularly relative to startup cost/preprocessing cost. -- Peter Geoghegan