Re: dead tuple difference between pgstattuple and pg_stat_user_tables - Mailing list pgsql-general

From Adrian Klaver
Subject Re: dead tuple difference between pgstattuple and pg_stat_user_tables
Date
Msg-id 5f0601fd-7ab9-4b40-9356-43c463223bed@aklaver.com
Whole thread Raw
In response to Re: dead tuple difference between pgstattuple and pg_stat_user_tables  (Matthew Tice <mjtice@gmail.com>)
Responses Re: dead tuple difference between pgstattuple and pg_stat_user_tables
List pgsql-general
On 8/23/24 09:33, Matthew Tice wrote:
> 
> 
> On Fri, Aug 23, 2024 at 10:26 AM Adrian Klaver 
> <adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>> wrote:

>     https://www.postgresql.org/docs/current/pgstattuple.html
>     <https://www.postgresql.org/docs/current/pgstattuple.html>
> 
>     pgstattuple_approx(regclass) returns record
> 
>           pgstattuple_approx is a faster alternative to pgstattuple that
>     returns approximate results.
> 
>     Not sure how you get exact count out of that?
> 
> 
> Maybe the wording is a little confusing to me. Under the section 
> for pgstattuple_approx:
> "pgstattuple_approx tries to avoid the full-table scan and returns exact 
> dead tuple statistics along with an approximation of the number and size 
> of live tuples and free space."

Yeah, see what you mean.

The part that bears more investigating for this case is:

"It does this by skipping pages that have only visible tuples according 
to the visibility map (if a page has the corresponding VM bit set, then 
it is assumed to contain no dead tuples).

Wondering if PostgreSQl-compatible covers this?




-- 
Adrian Klaver
adrian.klaver@aklaver.com




pgsql-general by date:

Previous
From: Matthew Tice
Date:
Subject: Re: dead tuple difference between pgstattuple and pg_stat_user_tables
Next
From: Adrian Klaver
Date:
Subject: Re: dead tuple difference between pgstattuple and pg_stat_user_tables