Re: pgsql: Add functions to 'pageinspect' to inspect GiST indexes.

From: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>, pgsql-committers <pgsql-committers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgsql: Add functions to 'pageinspect' to inspect GiST indexes.
Date: 2021-02-12 05:22:34
Message-ID: E0794687-7315-4C29-A9C7-EC54D448596D@yandex-team.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

> 12 февр. 2021 г., в 01:53, Peter Geoghegan <pg(at)bowt(dot)ie> написал(а):
>
> On Wed, Jan 13, 2021 at 12:36 AM Heikki Linnakangas
> <heikki(dot)linnakangas(at)iki(dot)fi> wrote:
>> Add functions to 'pageinspect' to inspect GiST indexes.
>
> Is gist_page_items() robust with deleted pages? I think that it's
> unsafe to assume that deleted pages will have index tuples, since the
> page contents will actually be a GISTDeletedPageContents.
>
> Simplest fix would be to assume maxoff is 0 for the page, perhaps.
> Right now we just use PageGetMaxOffsetNumber(), which implicitly
> assumes that the page uses slotted tuples with an array of line
> pointers (actually it can also deal with a zeroed page, but that's not
> relevant here).

Thanks, Peter! I agree that taking PageGetMaxOffsetNumber() seems
incorrect for deleted page, because we set pd_lower for the deleted page.
Also, there was an idea to add a column for LP_DEAD.
As long as we are dealing with deleted data anyway, maybe let's add this column?
PFW both patches.

Thanks!

Best regards, Andrey Borodin.

Attachment Content-Type Size
0001-Prevent-pageinspect-from-using-maxoffset-on-GiST-del.patch application/octet-stream 2.0 KB
0002-Add-bool-column-for-LP_DEAF-flag-to-GiST-pageinspect.patch application/octet-stream 5.2 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Alexander Korotkov 2021-02-12 14:28:51 pgsql: pg_attribute_no_sanitize_alignment() macro
Previous Message Amit Kapila 2021-02-12 05:21:47 Re: pgsql: Allow multiple xacts during table sync in logical replication.