Re: SUBTRANS: Minimizing calls to SubTransSetParent() - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: SUBTRANS: Minimizing calls to SubTransSetParent()
Date
Msg-id CANbhV-H8Qxs7D6z5m3OgC9b-or9nJWAvqPrGmP0RdjZiT2qjRA@mail.gmail.com
Whole thread Raw
In response to Re: SUBTRANS: Minimizing calls to SubTransSetParent()  (Simon Riggs <simon.riggs@enterprisedb.com>)
Responses Re: SUBTRANS: Minimizing calls to SubTransSetParent()
Re: SUBTRANS: Minimizing calls to SubTransSetParent()
List pgsql-hackers
On Thu, 17 Nov 2022 at 17:04, Simon Riggs <simon.riggs@enterprisedb.com> wrote:
>
> New version with greatly improved comments coming very soon.

> > Perhaps it would be a good idea to split up the patch.  The business
> > about making pg_subtrans flat rather than a tree seems like a good
> > idea in any event, although as I said it doesn't seem like we've got
> > a fleshed-out version of that here.  We could push forward on getting
> > that done and then separately consider the rest of it.
>
> Yes, I thought you might ask that so, after some thought, have found a
> clean way to do that and have split this into two parts.

Attached.

002 includes many comment revisions, as well as flattening the loops
in SubTransGetTopmostTransaction and TransactionIdDidCommit/Abort
003 includes the idea to not-always do SubTransSetParent()

> Julien has agreed to do further perf tests and is working on that now.
>
> I will post new versions soon, earliest tomorrow.

Julien's results show that 002 patch on its own is probably all we
need, but I'm posting 003 also in case that situation changes based on
other later results with different test cases.

Detailed numbers shown here, plus graph derived from them - thanks Julien!

nsubxacts  HEAD (3d0c95)  patched 002-v13  patched 002+003-v13
0          434161         436778           437287
8          432619         434718           435381
16         432856         434710           435092
24         429954         431835           431974
32         434643         436134           436793
40         433939         436121           435622
48         434503         434368           435662
56         432965         434229           436182
64         433672         433951           436192
72          93555         431626           433551
80          66642         431421           434305
88          61349         432776           433664
96          55892         432306           434212
104         52270         432571           434133
112         49166         433655           434754
120         46477         432817           434104
128         43226         432258           432611
(yes, the last line shows x10 performance patched, that is not a typo)

--
Simon Riggs                http://www.EnterpriseDB.com/

Attachment

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Report checkpoint progress with pg_stat_progress_checkpoint (was: Report checkpoint progress in server logs)
Next
From: Andres Freund
Date:
Subject: Re: Assertion failure in SnapBuildInitialSnapshot()