pgstattuple: Have pgstattuple_approx accept TOAST tables

Started by Peter Eisentrautalmost 6 years ago3 messageshackers
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

I alluded to this in [0]/messages/by-id/dc35a398-37d0-75ce-07ea-1dd71d98f8ec@2ndquadrant.com, 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]: /messages/by-id/dc35a398-37d0-75ce-07ea-1dd71d98f8ec@2ndquadrant.com
/messages/by-id/dc35a398-37d0-75ce-07ea-1dd71d98f8ec@2ndquadrant.com

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

Attachments:

0001-pgstattuple-Have-pgstattuple_approx-accept-TOAST-tab.patchtext/plain; charset=UTF-8; name=0001-pgstattuple-Have-pgstattuple_approx-accept-TOAST-tab.patch; x-mac-creator=0; x-mac-type=0Download+52-13
#2Laurenz Albe
laurenz.albe@cybertec.at
In reply to: Peter Eisentraut (#1)
Re: pgstattuple: Have pgstattuple_approx accept TOAST tables

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]:
/messages/by-id/dc35a398-37d0-75ce-07ea-1dd71d98f8ec@2ndquadrant.com

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

#3Peter Eisentraut
peter_e@gmx.net
In reply to: Laurenz Albe (#2)
Re: pgstattuple: Have pgstattuple_approx accept TOAST tables

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]:
/messages/by-id/dc35a398-37d0-75ce-07ea-1dd71d98f8ec@2ndquadrant.com

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