summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMelanie Plageman2025-04-03 22:23:02 +0000
committerMelanie Plageman2025-04-03 22:23:02 +0000
commit67be093562b6b345c170417312dff22f467055ba (patch)
tree1dfc38467f362e64f01f6e3dc86d4de8526dd1ba /src
parent54a3615f15b9b2e1433bc47cfb150317885d7c1f (diff)
Use AIO batchmode for bitmap heap scans
Previously bitmap heap scan was not AIO batchmode safe because of the visibility map reads potentially done for the "skip fetch" optimization (which skipped fetching tuples from the heap if the pages were all visible and none of the columns were used in the query). The skip fetch optimization implementation was found to have bugs and was removed in 459e7bf8e2f8, so we can safely enable batchmode for bitmap heap scans.
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/heap/heapam.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index 5b3fe4a1d3b..ed2e3021799 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -1204,13 +1204,8 @@ heap_beginscan(Relation relation, Snapshot snapshot,
}
else if (scan->rs_base.rs_flags & SO_TYPE_BITMAPSCAN)
{
- /*
- * Currently we can't trivially use batching, due to the
- * VM_ALL_VISIBLE check in bitmapheap_stream_read_next. While that
- * could be made safe, we are about to remove the all-visible logic
- * from bitmap scans due to its unsoundness.
- */
- scan->rs_read_stream = read_stream_begin_relation(READ_STREAM_DEFAULT,
+ scan->rs_read_stream = read_stream_begin_relation(READ_STREAM_DEFAULT |
+ READ_STREAM_USE_BATCHING,
scan->rs_strategy,
scan->rs_base.rs_rd,
MAIN_FORKNUM,