Re: Optimize SnapBuildPurgeOlderTxn: use in-place compaction instead of temporary array

From: Kirill Reshke <reshkekirill(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Xuneng Zhou <xunengzhou(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Optimize SnapBuildPurgeOlderTxn: use in-place compaction instead of temporary array
Date: 2025-10-21 05:04:52
Message-ID: CALdSSPi6x1fqj9jH_AHBGjcg0MhpLe3PydRreGGrMtANXEQvEA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 21 Oct 2025 at 04:31, Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Sat, Oct 18, 2025 at 01:59:40PM +0500, Kirill Reshke wrote:
> > Indeed, these changes look correct.
> > I wonder why b89e151054a0 did this place this way, hope we do not miss
> > anything here.
>
> Perhaps a lack of time back in 2014? It feels like an item where we
> would need to research a bit some of the past threads, and see if this
> has been discussed, or if there were other potential alternatives
> discussed. This is not saying that what you are doing in this
> proposal is actually bad, but it's a bit hard to say what an
> "algorithm" should look like in this specific code path with XID
> manipulations. Perhaps since 2014, we may have other places in the
> tree that share similar characteristics as what's done here.
>
> So it feels like this needs a bit more historical investigation first,
> rather than saying that your proposal is the best choice on the table.
> --
> Michael

Sure

Commit b89e151054a0 comes from [0]
Comment of SnapBuildPurgeCommittedTxn tracks to [1] (it was in form
"XXX: Neater algorithm?")

Between these two messages, it was not disucccesseed...

I will also study other related threads like [2], but i don't think
they will give more insight here.

[0] https://www.postgresql.org/message-id/20140303162652.GB16654%40awork2.anarazel.de
[1] https://www.postgresql.org/message-id/20140115002223.GA17204%40awork2.anarazel.de
[2] https://www.postgresql.org/message-id/flat/20130914204913.GA4071%40awork2.anarazel.de#:~:text=20130914204913.GA4071%40awork2.anarazel.de

--
Best regards,
Kirill Reshke

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2025-10-21 05:10:10 Re: Eliminating SPI / SQL from some RI triggers - take 3
Previous Message Srinath Reddy Sadipiralla 2025-10-21 04:36:26 Re: Making pg_rewind faster