mirror of https://github.com/postgres/postgres
293e24e507
This avoids a very significant amount of buffer manager traffic and contention when scanning hash indexes, because it's no longer necessary to lock and pin the metapage for every scan. We do need some way of figuring out when the cache is too stale to use any more, so that when we lock the primary bucket page to which the cached metapage points us, we can tell whether a split has occurred since we cached the metapage data. To do that, we use the hash_prevblkno field in the primary bucket page, which would otherwise always be set to InvalidBuffer. This patch contains code so that it will continue working (although less efficiently) with hash indexes built before this change, but perhaps we should consider bumping the hash version and ripping out the compatibility code. That decision can be made later, though. Mithun Cy, reviewed by Jesper Pedersen, Amit Kapila, and by me. Before committing, I made a number of cosmetic changes to the last posted version of the patch, adjusted _hash_getcachedmetap to be more careful about order of operation, and made some necessary updates to the pageinspect documentation and regression tests. |
||
---|---|---|
.. | ||
expected | ||
sql | ||
.gitignore | ||
Makefile | ||
brinfuncs.c | ||
btreefuncs.c | ||
fsmfuncs.c | ||
ginfuncs.c | ||
hashfuncs.c | ||
heapfuncs.c | ||
pageinspect--1.0--1.1.sql | ||
pageinspect--1.1--1.2.sql | ||
pageinspect--1.2--1.3.sql | ||
pageinspect--1.3--1.4.sql | ||
pageinspect--1.4--1.5.sql | ||
pageinspect--1.5--1.6.sql | ||
pageinspect--1.5.sql | ||
pageinspect--unpackaged--1.0.sql | ||
pageinspect.control | ||
pageinspect.h | ||
rawpage.c |