Avoid having two copies of the HOT-chain search logic.
Robert Haas <rhaas@postgresql.org>
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.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/heap/heapam.c | modified | +46 −26 |
| src/backend/access/index/genam.c | modified | +1 −3 |
| src/backend/access/index/indexam.c | modified | +21 −153 |
| src/backend/executor/nodeBitmapHeapscan.c | modified | +3 −1 |
| src/include/access/heapam.h | modified | +2 −1 |
| src/include/access/relscan.h | modified | +1 −3 |