pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Korotkov <akorotkov@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Optimize memory access in GetRunningTransactionData()
Date: Wed, 03 Jul 2024 23:21:13 +0000
Message-ID: <E1sP9Hk-000DNB-Cz@gemulon.postgresql.org> (raw)

Optimize memory access in GetRunningTransactionData()

e85662df44 made GetRunningTransactionData() calculate the oldest running
transaction id within the current database.  This commit optimized this
calculation by performing a cheap transaction id comparison before fetching
the process database id, while the latter could cause extra cache misses.

Reported-by: Noah Misch
Discussion: https://postgr.es/m/20240630231816.bf.nmisch%40google.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6897f0ec024582a570868939d3f34a6853374723

Modified Files
--------------
src/backend/storage/ipc/procarray.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)



Message-ID: <E1sP9Hk-000DNB-Cz@gemulon.postgresql.org>
Permalink:  ../E1sP9Hk-000DNB-Cz@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1sP9Hk-000DNB-Cz@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: akorotkov@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Optimize memory access in GetRunningTransactionData()
  In-Reply-To: <E1sP9Hk-000DNB-Cz@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