public inbox for [email protected]  
help / color / mirror / Atom feed
From: Adrian Klaver <[email protected]>
To: Matthew Tice <[email protected]>
Cc: [email protected]
Subject: Re: dead tuple difference between pgstattuple and pg_stat_user_tables
Date: Fri, 23 Aug 2024 09:51:17 -0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+taBv9QcWyPZDcXh03spn9MJkUrGD5UnH=4i3Zt_5mp8awnfA@mail.gmail.com>
References: <CA+taBv8ce8KtXLcD3sHWRuvPfb4scHU6oVSz8NwcUX=F=ECZBA@mail.gmail.com>
	<[email protected]>
	<CA+taBv9QcWyPZDcXh03spn9MJkUrGD5UnH=4i3Zt_5mp8awnfA@mail.gmail.com>

On 8/23/24 09:33, Matthew Tice wrote:
> 
> 
> On Fri, Aug 23, 2024 at 10:26 AM Adrian Klaver 
> <[email protected] <mailto:[email protected]>> 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
[email protected]







view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: dead tuple difference between pgstattuple and pg_stat_user_tables
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox