Re: SUBTRANS: Minimizing calls to SubTransSetParent()

From: Simon Riggs <simon(dot)riggs(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Julien Tachoires <julmon(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Japin Li <japinli(at)hotmail(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: SUBTRANS: Minimizing calls to SubTransSetParent()
Date: 2022-11-17 17:29:13
Message-ID: CANbhV-H8Qxs7D6z5m3OgC9b-or9nJWAvqPrGmP0RdjZiT2qjRA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 17 Nov 2022 at 17:04, Simon Riggs <simon(dot)riggs(at)enterprisedb(dot)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 Content-Type Size
subtrans-head-vs-patched-v13.png image/png 124.2 KB
003_only_store_subtrans_when_needed.v13.patch application/x-patch 8.3 KB
002_redesign_subtrans_calls_and_xidinmvccsnapshot.v13.patch application/x-patch 26.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message PG Doc comments form 2022-11-17 17:32:01 Logical replication missing information
Previous Message Robert Haas 2022-11-17 17:21:03 Re: Report checkpoint progress with pg_stat_progress_checkpoint (was: Report checkpoint progress in server logs)