Make heap_fetch API more consistent by having the buffer remain pinned
Tom Lane <tgl@sss.pgh.pa.us>
Make heap_fetch API more consistent by having the buffer remain pinned in all cases when keep_buf = true. This allows ANALYZE's inner loop to use heap_release_fetch, which saves multiple buffer lookups for the same page and avoids overestimation of cost by the vacuum cost mechanism.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/heap/heapam.c | modified | +23 −18 |
| src/backend/access/nbtree/nbtinsert.c | modified | +2 −2 |
| src/backend/commands/analyze.c | modified | +6 −8 |