Skip to content

Commit 67be093

Browse files
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 459e7bf, so we can safely enable batchmode for bitmap heap scans.
1 parent 54a3615 commit 67be093

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/backend/access/heap/heapam.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,13 +1204,8 @@ heap_beginscan(Relation relation, Snapshot snapshot,
12041204
}
12051205
else if (scan->rs_base.rs_flags & SO_TYPE_BITMAPSCAN)
12061206
{
1207-
/*
1208-
* Currently we can't trivially use batching, due to the
1209-
* VM_ALL_VISIBLE check in bitmapheap_stream_read_next. While that
1210-
* could be made safe, we are about to remove the all-visible logic
1211-
* from bitmap scans due to its unsoundness.
1212-
*/
1213-
scan->rs_read_stream = read_stream_begin_relation(READ_STREAM_DEFAULT,
1207+
scan->rs_read_stream = read_stream_begin_relation(READ_STREAM_DEFAULT |
1208+
READ_STREAM_USE_BATCHING,
12141209
scan->rs_strategy,
12151210
scan->rs_base.rs_rd,
12161211
MAIN_FORKNUM,

0 commit comments

Comments
 (0)