aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeBitmapHeapscan.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2011-06-27 10:27:17 -0400
committerRobert Haas <rhaas@postgresql.org>2011-06-27 10:27:17 -0400
commit4da99ea4231e3d8bbf28b666748c1028e7b7d665 (patch)
treec91fede8b34009adc608d542ec3ebbc5fab20c0c /src/backend/executor/nodeBitmapHeapscan.c
parent8c8745b298d20b49e64c77c1e4ba4c8ac300e9e6 (diff)
downloadpostgresql-4da99ea4231e3d8bbf28b666748c1028e7b7d665.tar.gz
postgresql-4da99ea4231e3d8bbf28b666748c1028e7b7d665.zip
Avoid having two copies of the HOT-chain search logic.
It's been like this since HOT was originally introduced, but the logic is complex enough that this is a recipe for bugs, as we've already found out with SSI. So refactor heap_hot_search_buffer() so that it can satisfy the needs of index_getnext(), and make index_getnext() use that rather than duplicating the logic. This change was originally proposed by Heikki Linnakangas as part of a larger refactoring oriented towards allowing index-only scans. I extracted and adjusted this part, since it seems to have independent merit. Review by Jeff Davis.
Diffstat (limited to 'src/backend/executor/nodeBitmapHeapscan.c')
-rw-r--r--src/backend/executor/nodeBitmapHeapscan.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/executor/nodeBitmapHeapscan.c b/src/backend/executor/nodeBitmapHeapscan.c
index e20ef1433ed..40ad7757587 100644
--- a/src/backend/executor/nodeBitmapHeapscan.c
+++ b/src/backend/executor/nodeBitmapHeapscan.c
@@ -349,9 +349,11 @@ bitgetpage(HeapScanDesc scan, TBMIterateResult *tbmres)
{
OffsetNumber offnum = tbmres->offsets[curslot];
ItemPointerData tid;
+ HeapTupleData heapTuple;
ItemPointerSet(&tid, page, offnum);
- if (heap_hot_search_buffer(&tid, scan->rs_rd, buffer, snapshot, NULL))
+ if (heap_hot_search_buffer(&tid, scan->rs_rd, buffer, snapshot,
+ &heapTuple, NULL, true))
scan->rs_vistuples[ntup++] = ItemPointerGetOffsetNumber(&tid);
}
}