Re: Remove HeapTuple and Buffer dependency for predicate locking functions

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Ashwin Agrawal <aagrawal(at)pivotal(dot)io>
Cc: Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>, Kuntal Ghosh <kuntalghosh(dot)2007(at)gmail(dot)com>
Subject: Re: Remove HeapTuple and Buffer dependency for predicate locking functions
Date: 2019-11-08 04:43:46
Message-ID: CA+hUKGLbRZV-o6Eq=9HA_4H-TSWo4yVaUBmbkEXt32zf=TN5mw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Aug 8, 2019 at 6:53 AM Ashwin Agrawal <aagrawal(at)pivotal(dot)io> wrote:
>>> - I wonder if CheckForSerializableConflictOutNeeded() shouldn't have a
>>> portion of it's code as a static inline. In particular, it's a shame
>>> that we currently perform external function calls at quite the
>>> frequency when serializable isn't even in use.
>>
>> I am not sure on portion of the code part? SerializationNeededForRead() is static inline function in C file. Can't inline CheckForSerializableConflictOutNeeded() without moving SerializationNeededForRead() and some other variables to header file. CheckForSerializableConflictOut() wasn't inline either, so a function call was performed earlier as well when serializable isn't even in use.

I agree that it's strange that we do these high frequency function
calls just to figure out that we're not even using this stuff, which
ultimately comes down to the static global variable MySerializableXact
being not reachable from (say) an inline function defined in a header.
That's something to look into in another thread.

> Attaching re-based version of the patches on top of current master, which has the fix for HOT serializable predicate locking bug spotted by Andres committed now.

I'm planning to commit these three patches on Monday. I've attached
versions with whitespace-only changes from pgindent, and commit
messages lightly massaged and updated to point to this discussion and
reviewers.

Attachment Content-Type Size
v3-0001-Optimize-TransactionIdIsCurrentTransactionId.patch application/octet-stream 1.3 KB
v3-0002-Optimize-PredicateLockTuple.patch application/octet-stream 1.9 KB
v3-0003-Remove-HeapTuple-dependency-for-predicate-locking.patch application/octet-stream 26.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Khandekar 2019-11-08 05:01:33 Re: Minimal logical decoding on standbys
Previous Message Laurenz Albe 2019-11-08 04:40:31 Re: Collation versioning