Relstats after VACUUM FULL and CLUSTER - Mailing list pgsql-hackers

From Erik Nordström
Subject Relstats after VACUUM FULL and CLUSTER
Date
Msg-id CACAa4VKmyz51BFAFZyKGBt9-yt8Vyk09s_26++FHy2ngfb9k0Q@mail.gmail.com
Whole thread Raw
Responses Re: Relstats after VACUUM FULL and CLUSTER
List pgsql-hackers
Hi all,

I noticed a potential issue with the heap cluster code used by VACUUM FULL and CLUSTER, but I am not sure so I thought I'd post the question to the list.

The code in question counts the number of tuples it processes and uses that count to update reltuples in pg_class. However, the tuple count seems off sometimes because it includes recently dead tuples (due to updates and deletes). However, the wrong reltuples count is set, AFAICT, only on tables that don't have indexes because the cluster code also later rebuilds indexes which then updates reltuples to the "correct" value.

Does this seem like a bug or is it intentional?

Best regards,

Erik

--
Database Architect, Timescale

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Retiring some encodings?
Next
From: Bertrand Drouvot
Date:
Subject: Re: Avoid orphaned objects dependencies, take 3