Re: [PoC] Improve dead tuple storage for lazy vacuum

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: John Naylor <johncnaylorls(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Yura Sokolov <y(dot)sokolov(at)postgrespro(dot)ru>
Subject: Re: [PoC] Improve dead tuple storage for lazy vacuum
Date: 2023-12-11 06:17:37
Message-ID: CAD21AoBSqoduhDc9kzY+DH-Zsu48rtT-x2Hajh_p=62126nLGQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Dec 8, 2023 at 9:44 PM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
>
> On Fri, Dec 8, 2023 at 7:46 PM John Naylor <johncnaylorls(at)gmail(dot)com> wrote:
> >
> > On Fri, Dec 8, 2023 at 3:06 PM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
> > >
> > > BTW Given that the actual value size can be calculated only by the
> > > caller, how does the tree know if the value is embedded or not? It's
> > > probably related to how to store combined pointer/value slots.
> >
> > Right, this is future work. At first, variable-length types will have
> > to be single-value leaves. In fact, the idea for storing up to 3
> > offsets in the bitmap header could be done this way -- it would just
> > be a (small) single-value leaf.
>
> Agreed.
>
> >
> > (Reminder: Currently, fixed-length values are compile-time embeddable
> > if the platform pointer size is big enough.)
> >
> > > If leaf
> > > nodes have a bitmap array that indicates the corresponding slot is an
> > > embedded value or a pointer to a value, it would be easy.
> >
> > That's the most general way to do it. We could do it much more easily
> > with a pointer tag, although for the above idea it may require some
> > endian-aware coding. Both were mentioned in the paper, I recall.
>
> True. Probably we can use the combined pointer/value slots approach
> only if the tree is able to use the pointer tagging. That is, if the
> caller allows the tree to use one bit of the value.
>
> I'm going to update the patch based on the recent discussion (RT_SET()
> and variable-length values) etc., and post the patch set early next
> week.

I've attached the updated patch set. From the previous patch set, I've
merged patches 0007 to 0010. The other changes such as adding RT_GET()
still are unmerged for now, for discussion. Probably we can make them
as follow-up patches as we discussed. 0011 to 0015 patches are new
changes for v44 patch set, which removes RT_SEARCH() and RT_SET() and
support variable-length values.

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com

Attachment Content-Type Size
v44-ART.tar.gz application/x-gzip 53.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2023-12-11 07:32:24 Re: Synchronizing slots from primary to standby
Previous Message Dilip Kumar 2023-12-11 06:14:06 Re: trying again to get incremental backup