Re: pgstattuple_approx for toasted table

Lists: pgsql-performance
From: Mariel Cherkassky <mariel(dot)cherkassky(at)gmail(dot)com>
To: PostgreSQL mailing lists <pgsql-performance(at)postgresql(dot)org>
Subject: pgstattuple_approx for toasted table
Date: 2019-03-03 15:59:56
Message-ID: CA+t6e1kTYbcQY4ohOS-OUvyu5T+=PTj_TZKvyMBeCS5V6V7ZFA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-performance

Hi,
I was testing pgstattuple and I realized that pgstattuple is working on
toasted table but pgstattuple_approx is raising the next error msg :

ERROR: "pg_toast_18292" is not a table or materialized view

ahm, is that because the pgstattuple_approx uses visibility map ? Can
someone explain ? tnx.


From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Mariel Cherkassky <mariel(dot)cherkassky(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-performance(at)postgresql(dot)org>
Subject: Re: pgstattuple_approx for toasted table
Date: 2019-03-04 05:21:39
Message-ID: 43864a0e35504ffc6047dd90eaf648287ed75e65.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-performance

Mariel Cherkassky wrote:
> I was testing pgstattuple and I realized that pgstattuple is working on toasted table but pgstattuple_approx is raising the next error msg :
>
> ERROR: "pg_toast_18292" is not a table or materialized view
>
> ahm, is that because the pgstattuple_approx uses visibility map ? Can someone explain ? tnx.

You are right; here is the code:

/*
* We support only ordinary relations and materialised views, because we
* depend on the visibility map and free space map for our estimates about
* unscanned pages.
*/
if (!(rel->rd_rel->relkind == RELKIND_RELATION ||
rel->rd_rel->relkind == RELKIND_MATVIEW))
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("\"%s\" is not a table or materialized view",
RelationGetRelationName(rel))));

Yours,
Laurenz Albe

--
Cybertec | https://www.cybertec-postgresql.com