pgsql: Optimize memory access in GetRunningTransactionData()

From: Alexander Korotkov <akorotkov(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Optimize memory access in GetRunningTransactionData()
Date: 2024-07-03 23:21:13
Message-ID: E1sP9Hk-000DNB-Cz@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alexander Korotkov 2024-07-03 23:26:38 pgsql: Fix typo in GetRunningTransactionData()
Previous Message David Rowley 2024-07-03 21:45:08 pgsql: Remove incorrect Asserts in buffile.c