Re: Remaining case where reltuples can become distorted across multiple VACUUM operations - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Remaining case where reltuples can become distorted across multiple VACUUM operations
Date
Msg-id CAH2-Wzk56LWsb7JCHpgqjD+DJU8+Zxc6T=CePGBtvHEODZzAuw@mail.gmail.com
Whole thread Raw
In response to Re: Remaining case where reltuples can become distorted across multiple VACUUM operations  (Matthias van de Meent <boekewurm+postgres@gmail.com>)
Responses Re: Remaining case where reltuples can become distorted across multiple VACUUM operations
List pgsql-hackers
On Mon, Aug 8, 2022 at 8:33 AM Matthias van de Meent
<boekewurm+postgres@gmail.com> wrote:
> For example, if currently the measured 2% of the pages contains more
> than 100% of the previous count of tuples, or with your patch the last
> page contains more than 100% of the previous count of the tuples, that
> new count is ignored, which seems silly considering that the vacuum
> count is supposed to be authorative.

The 2% thing is conditioned on the new relpages value precisely
matching the existing relpages from pg_class -- which makes it very
targeted. I don't see why scanned_tuples greatly exceeding the
existing reltuples from pg_class is interesting (any more interesting
than the other way around).

We'll always accept scanned_tuples as authoritative when VACUUM
actually scans all pages, no matter what. Currently it isn't possible
for VACUUM to skip pages in a table that is 32 pages or less in size.
So even the new "single page" thing from the patch cannot matter
there.


--
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [PATCH] CF app: add "Returned: Needs more interest"
Next
From: "Jonathan S. Katz"
Date:
Subject: 2022-08-11 release announcement draft