From: | Simon Riggs <simon(dot)riggs(at)enterprisedb(dot)com> |
---|---|
To: | Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Maximize page freezing |
Date: | 2022-07-29 14:37:58 |
Message-ID: | CANbhV-F86YcjEv8G6wRHNpf4AiQ2-O1zdh2mYYjZJxFmBizhQQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Thu, 28 Jul 2022 at 14:55, Matthias van de Meent
<boekewurm+postgres(at)gmail(dot)com> wrote:
>
> On Thu, 28 Jul 2022 at 15:36, Simon Riggs <simon(dot)riggs(at)enterprisedb(dot)com> wrote:
> >
> > Starting new thread with updated patch to avoid confusion, as
> > mentioned by David Steele on the original thread:
> > Original messageid: 20201118020418(dot)GA13408(at)alvherre(dot)pgsql
> > On Wed, 18 Nov 2020 at 02:04, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote:
> > > On 2020-Nov-17, Simon Riggs wrote:
> > >
> > > > As an additional optimization, if we do find a row that needs freezing
> > > > on a data block, we should simply freeze *all* row versions on the
> > > > page, not just the ones below the selected cutoff. This is justified
> > > > since writing the block is the biggest cost and it doesn't make much
> > > > sense to leave a few rows unfrozen on a block that we are dirtying.
> > >
> > > Yeah. We've had earlier proposals to use high and low watermarks: if any
> > > tuple is past the high watermark, then freeze all tuples that are past
> > > the low watermark. However this is ancient thinking (prior to
> > > HEAP_XMIN_FROZEN) and we don't need the low watermark to be different
> > > from zero, since the original xid is retained anyway.
> > >
> > > So +1 for this idea.
> >
> > Updated patch attached.
>
> Great idea, yet this patch seems to only freeze those tuples that are
> located after the first to-be-frozen tuple. It should probably
> re-visit earlier live tuples to potentially freeze those as well.
Like this?
--
Simon Riggs http://www.EnterpriseDB.com/
Attachment | Content-Type | Size |
---|---|---|
one_freeze_then_max_freeze.v9a.patch | application/octet-stream | 2.6 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Önder Kalacı | 2022-07-29 14:59:20 | Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher |
Previous Message | Ashutosh Sharma | 2022-07-29 14:32:08 | Re: making relfilenodes 56 bits |