pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Melanie Plageman <melanieplageman@gmail.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid BufferGetPage() calls in heap_update()
Date: Sun, 15 Mar 2026 14:43:43 +0000
Message-ID: <E1w1mgw-000IIs-30@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8d2c1df4f4c54d0a73fcabaf5e25bc55ce7fb5fa

Modified Files
--------------
src/backend/access/heap/heapam.c      | 17 ++++++++++-------
src/backend/access/heap/heapam_xlog.c | 34 ++++++++++++++++++----------------
2 files changed, 28 insertions(+), 23 deletions(-)



Message-ID: <E1w1mgw-000IIs-30@gemulon.postgresql.org>
Permalink:  ../E1w1mgw-000IIs-30@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1w1mgw-000IIs-30@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: melanieplageman@gmail.com, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Avoid BufferGetPage() calls in heap_update()
  In-Reply-To: <E1w1mgw-000IIs-30@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox