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

Поиск
Список
Период
Сортировка
От James Coleman
Тема Re: [DOCS] HOT - correct claim about indexes not referencing old line pointers
Дата
Msg-id CAAaqYe87o9jFqtNAJ68qhHch_tep1LffDpvPjwx51ZZbdOPRuA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [DOCS] HOT - correct claim about indexes not referencing old line pointers  (Peter Geoghegan <pg@bowt.ie>)
Ответы Re: [DOCS] HOT - correct claim about indexes not referencing old line pointers
Список pgsql-hackers
On Fri, Sep 29, 2023 at 2:39 PM Peter Geoghegan <pg@bowt.ie> wrote:
>
> On Fri, Sep 29, 2023 at 11:04 AM Peter Geoghegan <pg@bowt.ie> wrote:
> > > 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.
> >
> > It's true that the original root heap tuple (which is never a
> > heap-only tuple) must have its line pointer changed from LP_NORMAL to
> > LP_REDIRECT the first time pruning takes place that affects its HOT
> > chain. But I don't think that referring to the root item as something
> > along the lines of "an obsolescent/old tuple's line pointer" is
> > particularly helpful.
>
> To be clear, the existing wording seems correct to me. Even heap-only
> tuples require line pointers. These line pointers are strictly
> guaranteed to never be *directly* referenced from indexes (if they are
> then we'll actually detect it and report data corruption on recent
> versions). The name "heap-only tuple" quite literally means that the
> tuple and its line pointer are only represented in the heap, and never
> in indexes.

Hmm, to my reading the issue is that "old versions" doesn't say
anything about "old HOT versions; it seems to be describing what
happens generally when a heap-only tuple is written -- which would
include the first time a heap-only tuple is written. And when it's the
first heap-only tuple the "old version" would be the original version,
which would not be a heap-only tuple.

I can work up a tweaked version of the patch that shows there are two
paths here (original tuple is being updated versus an intermediate
heap-only tuple is being updated); would you be willing to consider
that?

Thanks,
James Coleman



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: [DOCS] HOT - correct claim about indexes not referencing old line pointers
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: [DOCS] HOT - correct claim about indexes not referencing old line pointers