From 4da99ea4231e3d8bbf28b666748c1028e7b7d665 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Mon, 27 Jun 2011 10:27:17 -0400 Subject: 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. --- src/backend/access/index/genam.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/backend/access/index/genam.c') diff --git a/src/backend/access/index/genam.c b/src/backend/access/index/genam.c index db04e26a65d..fe3aa3c9c1d 100644 --- a/src/backend/access/index/genam.c +++ b/src/backend/access/index/genam.c @@ -113,9 +113,7 @@ RelationGetIndexScan(Relation indexRelation, int nkeys, int norderbys) ItemPointerSetInvalid(&scan->xs_ctup.t_self); scan->xs_ctup.t_data = NULL; scan->xs_cbuf = InvalidBuffer; - scan->xs_hot_dead = false; - scan->xs_next_hot = InvalidOffsetNumber; - scan->xs_prev_xmax = InvalidTransactionId; + scan->xs_continue_hot = false; return scan; } -- cgit v1.2.3