pgstattuple: Have pgstattuple_approx accept TOAST tables

Lists: pgsql-hackers
From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: pgstattuple: Have pgstattuple_approx accept TOAST tables
Date: 2020-04-17 11:01:46
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

I alluded to this in [0], but it's better discussed in its own thread.

I think the check that makes pgstattuple_approx reject TOAST tables is a
mistake. They have visibility and free space map, and it works just
fine if the check is removed.

Attached is a patch to fix this and add some tests related to how
pgstattuple and pg_visibility accept TOAST tables for inspection.

[0]:
https://www.postgresql.org/message-id/[email protected]

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
0001-pgstattuple-Have-pgstattuple_approx-accept-TOAST-tab.patch text/plain 8.0 KB

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgstattuple: Have pgstattuple_approx accept TOAST tables
Date: 2020-06-17 11:39:30
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, 2020-04-17 at 13:01 +0200, Peter Eisentraut wrote:
> I alluded to this in [0], but it's better discussed in its own thread.
>
> I think the check that makes pgstattuple_approx reject TOAST tables is a
> mistake. They have visibility and free space map, and it works just
> fine if the check is removed.
>
> Attached is a patch to fix this and add some tests related to how
> pgstattuple and pg_visibility accept TOAST tables for inspection.
>
>
> [0]:
> https://www.postgresql.org/message-id/[email protected]

I gave the patch a spin, and it passes regression tests and didn't
cause any problems when I played with it.

No upgrade or dump considerations, of course.

This is a clear improvement.

I'll mark the patch as "ready for committer".

Yours,
Laurenz Albe


From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgstattuple: Have pgstattuple_approx accept TOAST tables
Date: 2020-06-29 23:14:31
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

On 2020-06-17 13:39, Laurenz Albe wrote:
> On Fri, 2020-04-17 at 13:01 +0200, Peter Eisentraut wrote:
>> I alluded to this in [0], but it's better discussed in its own thread.
>>
>> I think the check that makes pgstattuple_approx reject TOAST tables is a
>> mistake. They have visibility and free space map, and it works just
>> fine if the check is removed.
>>
>> Attached is a patch to fix this and add some tests related to how
>> pgstattuple and pg_visibility accept TOAST tables for inspection.
>>
>>
>> [0]:
>> https://www.postgresql.org/message-id/[email protected]
>
> I gave the patch a spin, and it passes regression tests and didn't
> cause any problems when I played with it.
>
> No upgrade or dump considerations, of course.
>
> This is a clear improvement.
>
> I'll mark the patch as "ready for committer".

committed, thanks

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services