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

From: Xuneng Zhou <xunengzhou(at)gmail(dot)com>
To: Dewei Dai <daidewei1970(at)163(dot)com>
Cc: Neil Chen <carpenter(dot)nail(dot)cz(at)gmail(dot)com>, Pgsql Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Kirill Reshke <reshkekirill(at)gmail(dot)com>
Subject: Re: Re: Optimize SnapBuildPurgeOlderTxn: use in-place compaction instead of temporary array
Date: 2026-01-08 16:03:22
Message-ID: CABPTF7UoJG0=httrz62gvmEHKp=maymKo2w=OQsCS_aiH6bcXA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Dewei,

On Thu, Jan 8, 2026 at 6:42 PM Dewei Dai <daidewei1970(at)163(dot)com> wrote:
>
> Hi Xuneng,
>
> On Thu, Jan 8, 2026 at 4:15 PM Xuneng Zhou <xunengzhou(at)gmail(dot)com> wrote:
> >
> > v3-0001 fixes a critical issue where the snapshot->xip array in
> > SnapBuildBuildSnapshot might not be sorted before reaching the
> > consistent state. Sorry for the noise here.
> >
> >
> I just reviewed the v3 and I got a few comment
> in function `SnapBuildAddCommittedTxns`
> `builder->committed.xcnt_space = builder->committed.xcnt_space * 2 + 1`
>
> Wouldn't it be more appropriate to use:
> `builder->committed.cnt_space = builder->committed.xcnt_space * 2`
>
>
> Best regards,
>

Thanks for looking into this.

Yeah, we don't need the +1 in the while loop. I'll remove it.

--
Best,
Xuneng

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2026-01-08 16:05:33 Re: Optimize SnapBuildPurgeOlderTxn: use in-place compaction instead of temporary array
Previous Message Peter Eisentraut 2026-01-08 16:03:02 Re: SQL:2011 Application Time Update & Delete