pgsql: Optimize TransactionIdIsCurrentTransactionId().

From: Thomas Munro <tmunro(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Optimize TransactionIdIsCurrentTransactionId().
Date: 2019-11-11 04:08:35
Message-ID: E1iU10F-00031k-1r@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Optimize TransactionIdIsCurrentTransactionId().

If the passed in xid is the current top transaction, we can do a fast
check and exit early. This should work well for the current heap but
also works very well for proposed AMs that don't use a separate xid
for subtransactions.

Author: Ashwin Agrawal, based on a suggestion from Andres Freund
Reviewed-by: Thomas Munro
Discussion: https://postgr.es/m/CALfoeiv0k3hkEb3Oqk%3DziWqtyk2Jys1UOK5hwRBNeANT_yX%2Bng%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/695c5977c8bc115029a85dcc1821d7b0136b4e4c

Modified Files
--------------
src/backend/access/transam/xact.c | 3 +++
1 file changed, 3 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2019-11-11 09:19:51 pgsql: Fix whitespace
Previous Message Amit Kapila 2019-11-11 02:18:33 pgsql: Rearrange dropdb() to avoid errors after allowing other sessions