Re: pg15: reltuples stuck at -1 after pg_upgrade and VACUUM - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: pg15: reltuples stuck at -1 after pg_upgrade and VACUUM
Date
Msg-id CAH2-Wzm=UwJjO+KgoBu6p1ibn0Bu2_rRNvZk_7fqqE6Z3m3+vQ@mail.gmail.com
Whole thread Raw
In response to Re: pg15: reltuples stuck at -1 after pg_upgrade and VACUUM  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, Aug 9, 2023 at 6:18 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Perhaps, though, there's a case for forcing all pages to be visited
> if we start with reltuples == -1?  I'm not sure it matters much
> though given that you also need an ANALYZE run to be really in a
> good place after pg_upgrade.  The ANALYZE should update this.

Right. VACUUM is sometimes much less efficient than just using ANALYZE
to establish an initial reltuples. Other times it is much less
accurate. I can't see any argument for opting to use VACUUM instead of
ANALYZE after an upgrade.

--
Peter Geoghegan



pgsql-hackers by date:

Previous
From: GF
Date:
Subject: Re: Adding a pg_servername() function
Next
From: Tomas Vondra
Date:
Subject: Re: pgsql: Ignore BRIN indexes when checking for HOT udpates