Re: Fix --missing-stats-only false positive for partitioned expression indexes

Nathan Bossart <nathandbossart@gmail.com>

From: Nathan Bossart <nathandbossart@gmail.com>
To: Baji Shaik <baji.pgdev@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@lists.postgresql.org>
Date: 2026-06-16T16:14:10Z
Lists: pgsql-hackers
On Tue, Jun 16, 2026 at 10:25:52AM -0500, Baji Shaik wrote:
> I tested "vacuumdb --missing-stats-only"  and found that it flags
> partitioned tables that have expression indexes, even after a full
> ANALYZE.

Thanks for reporting.

-							 " OR EXISTS (SELECT NULL FROM pg_catalog.pg_attribute a\n"
+							 " OR (NOT p.inherited"
+							 " AND EXISTS (SELECT NULL FROM pg_catalog.pg_attribute a\n"

I'm curious why you added this check to the beginning and surrounded the
rest with parentheses.  Wouldn't it be better to follow the example of the
surrounding clauses and an "AND NOT p.inherited" somewhere in the middle?

-- 
nathan



Commits

  1. vacuumdb: Fix --missing-stats-only for partitioned indexes.