Re: Why does pg_class.reltuples count only live tuples in indexes (after VACUUM runs)? - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Why does pg_class.reltuples count only live tuples in indexes (after VACUUM runs)?
Date
Msg-id CAH2-Wzm02=sDM=NZYTcUPXQ2s5FxKSyMCOYywCmOdW_oJ6BuUA@mail.gmail.com
Whole thread Raw
In response to Re: Why does pg_class.reltuples count only live tuples in indexes (after VACUUM runs)?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Why does pg_class.reltuples count only live tuples in indexes (after VACUUM runs)?  (Peter Geoghegan <pg@bowt.ie>)
List pgsql-hackers
On Mon, Apr 18, 2022 at 1:10 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> The places where index AMs refer to num_heap_tuples seem to be using
> it as a ceiling on estimated index tuple counts.  Given that we should
> be counting dead index entries, redefining it as you suggest would be
> wrong.

I would argue that it would be correct for the first time -- at least
if we take the behavior within heapam_index_build_range_scan (and
everywhere else) as authoritative. That's a feature, not a bug.

-- 
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Why does pg_class.reltuples count only live tuples in indexes (after VACUUM runs)?
Next
From: Andrew Dunstan
Date:
Subject: Re: Postgres perl module namespace