1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

pgstattuple: Have pgstattuple_approx accept TOAST tables

TOAST tables have a visibility map and a free space map, so they can
be supported by pgstattuple_approx just fine.

Add test cases to show how various pgstattuple functions accept TOAST
tables.  Also add similar tests to pg_visibility, which already
accepted TOAST tables correctly but had no test coverage for them.

Reviewed-by: Laurenz Albe <laurenz.albe@cybertec.at>
Discussion: https://www.postgresql.org/message-id/flat/27c4496a-02b9-dc87-8f6f-bddbef54e0fe@2ndquadrant.com
This commit is contained in:
Peter Eisentraut
2020-06-30 00:29:35 +02:00
parent ea57e531b9
commit ee0202d552
5 changed files with 52 additions and 12 deletions

View File

@ -100,6 +100,11 @@ select pgstattuple('test_partition');
select pgstattuple_approx('test_partition');
select pg_relpages('test_partition');
-- toast tables should work
select pgstattuple((select reltoastrelid from pg_class where relname = 'test'));
select pgstattuple_approx((select reltoastrelid from pg_class where relname = 'test'));
select pg_relpages((select reltoastrelid from pg_class where relname = 'test'));
-- not for the index calls though, of course
select pgstatindex('test_partition');
select pgstatginindex('test_partition');