public inbox for [email protected]
help / color / mirror / Atom feedFrom: Matthew Tice <[email protected]>
Cc: [email protected]
Subject: Re: dead tuple difference between pgstattuple and pg_stat_user_tables
Date: Fri, 23 Aug 2024 10:33:38 -0600
Message-ID: <CA+taBv9QcWyPZDcXh03spn9MJkUrGD5UnH=4i3Zt_5mp8awnfA@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CA+taBv8ce8KtXLcD3sHWRuvPfb4scHU6oVSz8NwcUX=F=ECZBA@mail.gmail.com>
<[email protected]>
On Fri, Aug 23, 2024 at 10:26 AM Adrian Klaver <[email protected]>
wrote:
> On 8/23/24 09:14, Matthew Tice wrote:
> > Hi All,
> >
> > I'm trying to understand why there's a difference between what
> > pgstattuple reports and pg_stat_user_tables reports (for the number of
> > dead tuples).
> >
> > As I understand, pgstattuple and pgstattuple_approx return the exact
> > number of dead tuples (as noted in the documentation) and based on an
>
> 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."
>
> > This is a Google Alloy DB instance running:
>
> https://cloud.google.com/alloydb/docs/overview
>
> "AlloyDB for PostgreSQL is a fully managed, PostgreSQL-compatible
> database service that's designed for your most demanding workloads,
> including hybrid transactional and analytical processing. AlloyDB pairs
> a Google-built database engine with a cloud-based, multi-node
> architecture to deliver enterprise-grade performance, reliability, and
> availability."
>
> Where the important parts are 'PostgreSQL-compatible' and 'Google-built
> database engine'. You probably need to reach out to Google to see what
> that means for this situation.
>
> Got it, thanks Adrian.
>
> > > select version();
> > -[ RECORD 1 ]-------------------------
> > version | PostgreSQL 14.10 on x86_64-pc-linux-gnu, compiled by Debian
> > clang version 12.0.1, 64-bit
> > SELECT 1
>
> --
> Adrian Klaver
> [email protected]
>
>
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]
Subject: Re: dead tuple difference between pgstattuple and pg_stat_user_tables
In-Reply-To: <CA+taBv9QcWyPZDcXh03spn9MJkUrGD5UnH=4i3Zt_5mp8awnfA@mail.gmail.com>
* 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