]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix EXPLAIN Bitmap heap scan to count pages with no visible tuples
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 18 Mar 2024 12:04:19 +0000 (14:04 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 18 Mar 2024 12:04:19 +0000 (14:04 +0200)
commit262757b73286d6dab2c563123ff11bee2b295e31
treecf97a3b366e137162c16aa3c3f59c3e462dae70c
parent3621ffd9f21b313116e84301a1dce0d3f1dc2f8a
Fix EXPLAIN Bitmap heap scan to count pages with no visible tuples

Previously, bitmap heap scans only counted lossy and exact pages for
explain when there was at least one visible tuple on the page.

heapam_scan_bitmap_next_block() returned true only if there was a
"valid" page with tuples to be processed. However, the lossy and exact
page counters in EXPLAIN should count the number of pages represented
in a lossy or non-lossy way in the constructed bitmap, regardless of
whether or not the pages ultimately contained visible tuples.

Backpatch to all supported versions.

Author: Melanie Plageman
Discussion: https://www.postgresql.org/message-id/CAAKRu_ZwCwWFeL_H3ia26bP2e7HiKLWt0ZmGXPVwPO6uXq0vaA@mail.gmail.com
Discussion: https://www.postgresql.org/message-id/CAAKRu_bxrXeZ2rCnY8LyeC2Ls88KpjWrQ%2BopUrXDRXdcfwFZGA@mail.gmail.com
src/backend/executor/nodeBitmapHeapscan.c
src/test/regress/expected/partition_prune.out