Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/backend/access/nbtree/nbtsearch.c
Original file line number Diff line number Diff line change
Expand Up @@ -1191,8 +1191,8 @@ _bt_first(IndexScanDesc scan, ScanDirection dir)
else if (!enable_indexscan_prefetch || !scan->heapRelation)
so->prefetch_maximum = 0; /* disable prefetch */

/* If key bounds are not specified, then we will scan the whole relation and it make sense to start with the largest possible prefetch distance */
so->current_prefetch_distance = (keysCount == 0) ? so->prefetch_maximum : 0;
/* Start with minimal prefetch distance to minimize prefetch overhead for exact or limited index scans */
so->current_prefetch_distance = 0;

/*
* If we found no usable boundary keys, we have to start from one end of
Expand Down