Re: Rename dead_tuples to dead_items in vacuumlazy.c - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Rename dead_tuples to dead_items in vacuumlazy.c
Date
Msg-id 202111241437.ut2ui4gs4jku@alvherre.pgsql
Whole thread Raw
In response to Re: Rename dead_tuples to dead_items in vacuumlazy.c  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Rename dead_tuples to dead_items in vacuumlazy.c
List pgsql-hackers
On 2021-Nov-24, Robert Haas wrote:

> On Wed, Nov 24, 2021 at 7:48 AM Masahiko Sawada <sawada.mshk@gmail.com> wrote:
> > I think it's more consistent if we change it to one side. I prefer
> > "dead items".
> 
> I feel like "items" is quite a generic word, so I think I would prefer
> TIDs. But it's probably not a big deal.

Is there clarity on what each term means? 

Since this patch only changes things that are specific to heap
vacuuming, it seems OK to rely the convention that "item" means "heap
item" (not just any generic item).  However, I'm not sure that we fully
agree exactly what a heap item is.  Maybe if we agree to a single non
ambiguous definition for each of those terms we can agree what
terminology to use.

It seems to me we have the following terms:

- tuple
- line pointer
- [heap] item
- TID

My mental model is that "tuple" (in the narrow context of heap vacuum)
is the variable-size on-disk representation of a row in a page; "line
pointer" is the fixed-size struct at the bottom of each page that
contains location, size and flags of a tuple: struct ItemIdData.  The
TID is the address of a line pointer -- an ItemPointerData.

What is an item?  Is an item the same as a line pointer?  That seems
confusing.  I think "item" means the tuple as a whole.  In that light,
using the term TID for some of the things that the patch renames to
"item" seems more appropriate.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/



pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: Parallel vacuum workers prevent the oldest xmin from advancing
Next
From: Robert Haas
Date:
Subject: Re: Post-CVE Wishlist