pgsql: Optimize PredicateLockTuple().

From: Thomas Munro <tmunro(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Optimize PredicateLockTuple().
Date: 2019-11-11 04:08:35
Message-ID: [email protected]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Optimize PredicateLockTuple().

PredicateLockTuple() has a fast exit if tuple was written by the current
transaction, as in that case it already has a lock. This check can be
performed using TransactionIdIsCurrentTransactionId() instead of
SubTransGetTopmostTransaction(), to avoid any chance of having to hit the
disk.

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/db2687d1f3787aa8113b3dbb358153feee30c64c

Modified Files
--------------
src/backend/storage/lmgr/predicate.c | 22 +++-------------------
1 file changed, 3 insertions(+), 19 deletions(-)

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