Re: Remove HeapTuple and Buffer dependency for predicate locking functions
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Ashwin Agrawal <aagrawal@pivotal.io>
Cc: Thomas Munro <thomas.munro@gmail.com>, PostgreSQL mailing lists <pgsql-hackers@postgresql.org>, Kuntal Ghosh <kuntalghosh.2007@gmail.com>
Date: 2019-07-31T17:55:48Z
Lists: pgsql-hackers
Hi, On 2019-07-31 10:42:50 -0700, Ashwin Agrawal wrote: > On Tue, Jul 30, 2019 at 2:58 PM Thomas Munro <thomas.munro@gmail.com> wrote: > > > On Tue, Jun 25, 2019 at 6:02 AM Andres Freund <andres@anarazel.de> wrote: > > > > - CheckForSerializableConflictOut() no more takes HeapTuple nor > > > > buffer, instead just takes xid. Push heap specific parts from > > > > CheckForSerializableConflictOut() into its own function > > > > HeapCheckForSerializableConflictOut() which calls > > > > CheckForSerializableConflictOut(). The alternative option could be > > > > CheckForSerializableConflictOut() take callback function and > > > > callback arguments, which gets called if required after performing > > > > prechecks. Though currently I fell AM having its own wrapper to > > > > perform AM specific task and then calling > > > > CheckForSerializableConflictOut() is fine. > > > > > > I think it's right to move the xid handling out of > > > CheckForSerializableConflictOut(). But I think we also ought to move the > > > subtransaction handling out of the function - e.g. zheap doesn't > > > want/need that. > > > > Thoughts on this Ashwin? > > > > I think the only part its doing for sub-transaction is > SubTransGetTopmostTransaction(xid). If xid passed to this function is > already top most transaction which is case for zheap and zedstore, then > there is no downside to keeping that code here in common place. Well, it's far from a cheap function. It'll do unnecessary on-disk lookups in many cases. I'd call that quite a downside. Greetings, Andres Freund
Commits
-
Remove dependency on HeapTuple from predicate locking functions.
- 6f38d4dac381 13.0 landed
-
Optimize PredicateLockTuple().
- db2687d1f378 13.0 landed
-
Optimize TransactionIdIsCurrentTransactionId().
- 695c5977c8bc 13.0 landed
-
Fix predicate-locking of HOT updated rows.
- 54c98fa71ac1 9.4.25 landed
- fd298cd6394b 9.5.20 landed
- 75774cc221e5 9.6.16 landed
- 65468cc705ea 10.11 landed
- c5b796125299 11.6 landed
- f8d30182b121 12.0 landed
- 1169fcf129f4 13.0 landed
-
Introduce logical decoding.
- b89e151054a0 9.4.0 cited
-
Fix bugs in SSI tuple locking.
- 81fbbfe3352d 9.4.0 cited
-
Implement genuine serializable isolation level.
- dafaa3efb75c 9.1.0 cited