]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Avoid BufferGetPage() calls in heap_update()
authorMelanie Plageman <melanieplageman@gmail.com>
Sun, 15 Mar 2026 14:42:34 +0000 (10:42 -0400)
committerMelanie Plageman <melanieplageman@gmail.com>
Sun, 15 Mar 2026 14:42:34 +0000 (10:42 -0400)
commit8d2c1df4f4c54d0a73fcabaf5e25bc55ce7fb5fa
tree7e0f3a8c88a965787aff2baae790511717b12d47
parenta3511443e5e1cb59bae86d0757aa727dda099704
Avoid BufferGetPage() calls in heap_update()

BufferGetPage() isn't cheap and heap_update() calls it multiple times
when it could just save the page from a single call. Do that.
While we are at it, make separate variables for old and new page in
heap_xlog_update(). It's confusing to reuse "page" for both pages.

Author: Melanie Plageman <melanieplageman@gmail.com>
Discussion: https://postgr.es/m/CAAKRu_a%2BhO4PCptyaPR7AMZd7FjcHfOFKKJT8ouU3KedMud0tQ%40mail.gmail.com
src/backend/access/heap/heapam.c
src/backend/access/heap/heapam_xlog.c