summaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gistutil.c
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2023-04-05 13:47:46 -0700
committerAndres Freund <andres@anarazel.de>2023-04-05 13:47:46 -0700
commitdad50f677c42de207168a3f08982ba23c9fc6720 (patch)
treeb588d8497042b1a89a774f260ce2034abd701881 /src/backend/access/gist/gistutil.c
parent65eb2d00c6c1bab29db9fa6575185a40d823fe9d (diff)
downloadpostgresql-dad50f677c42de207168a3f08982ba23c9fc6720.tar.gz
bufmgr: Acquire and clean victim buffer separately
Previously we held buffer locks for two buffer mapping partitions at the same time to change the identity of buffers. Particularly for extending relations needing to hold the extension lock while acquiring a victim buffer is painful.But it also creates a bottleneck for workloads that just involve reads. Now we instead first acquire a victim buffer and write it out, if necessary. Then we remove that buffer from the old partition with just the old partition's partition lock held and insert it into the new partition with just that partition's lock held. By separating out the victim buffer acquisition, future commits will be able to change relation extensions to scale better. On my workstation, a micro-benchmark exercising buffered reads strenuously and under a lot of concurrency, sees a >2x improvement. Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi> Reviewed-by: Melanie Plageman <melanieplageman@gmail.com> Discussion: https://postgr.es/m/20221029025420.eplyow6k7tgu6he3@awork3.anarazel.de
Diffstat (limited to 'src/backend/access/gist/gistutil.c')
0 files changed, 0 insertions, 0 deletions