Re: [DOCS] HOT - correct claim about indexes not referencing old line pointers

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: James Coleman <jtc331(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [DOCS] HOT - correct claim about indexes not referencing old line pointers
Date: 2023-09-29 18:03:30
Message-ID: CAKFQuwYyY992nPr_L=aQt4+8jcg5H9OoHGAH_bSsUni4ssum-g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 29, 2023 at 10:45 AM James Coleman <jtc331(at)gmail(dot)com> wrote:

> Hello,
>
> While working on my talk for PGConf.NYC next week I came across this
> bullet in the docs on heap only tuples:
>
> > Old versions of updated rows can be completely removed during normal
> > operation, including SELECTs, instead of requiring periodic vacuum
> > operations. (This is possible because indexes do not reference their page
> > item identifiers.)
>
> But when a HOT update happens the entry in an (logically unchanged)
> index still points to the original heap tid, and that line item is
> updated with a pointer to the new line pointer in the same page.
>
> Assuming I'm understanding this correctly, attached is a patch
> correcting the description.
>
>
I think we want to somehow distinguish between the old tuple that is the
root of the chain and old tuples that are not. This comment refers to
pruning the chain and removing intermediate links in the chain that are no
longer relevant because the root has been updated to point to the live
tuple. In README.HOT, tuple 2 in the example after 1 points to 3.

https://github.com/postgres/postgres/blob/ec99d6e9c87a8ff0f4805cc0c6c12cbb89c48e06/src/backend/access/heap/README.HOT#L109

David J.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2023-09-29 18:04:27 Re: [DOCS] HOT - correct claim about indexes not referencing old line pointers
Previous Message James Coleman 2023-09-29 17:39:07 [DOCS] HOT - correct claim about indexes not referencing old line pointers