Re: Optional skipping of unchanged relations during ANALYZE? - Mailing list pgsql-hackers

From Ilia Evdokimov
Subject Re: Optional skipping of unchanged relations during ANALYZE?
Date
Msg-id 65da80c0-52fb-454e-b29e-b1d5a254ec38@tantorlabs.com
Whole thread Raw
In response to Re: Optional skipping of unchanged relations during ANALYZE?  (VASUKI M <vasukianand0119@gmail.com>)
List pgsql-hackers
On 23.01.2026 09:33, VASUKI M wrote:
> Relation to vacuumdb --missing-stats-only
> I agree this is related but slightly different in intent. 
> --missing-stats-only answers “does this table have any statistics at 
> all?”, while SMART ANALYZE answers “has this table changed since the 
> last statistics collection?”. Both seem useful, but they target 
> different use cases. I see SMART ANALYZE primarily as a performance 
> optimization for repeated manual ANALYZE runs on mostly-static schemas.

LGTM. Thanks to Sami for pointing this out.

It seems reasonable to start by introducing an option for plain ANALYZE 
(without specifying tables or columns) that follows the same idea as 
vacuumdb --missing-stats-only. While this flag was originally introduced 
primarily to support pg_upgrade workflows, exposing similar 
functionality at the ANALYZE level also seems useful on its own. That 
would give us a clear and well-defined first step. At the SQL level, a 
name such as ANALYZE (MISSING_STATS_ONLY) would be a good fit and remain 
consistent with the vacuumdb option.

Thoughts?

-- 
Best regards,
Ilia Evdokimov,
Tantor Labs LLC,
https://tantorlabs.com/




pgsql-hackers by date:

Previous
From: Michael Banck
Date:
Subject: Re: Time to drop RADIUS support?
Next
From: Dilip Kumar
Date:
Subject: Re: Proposal: Conflict log history table for Logical Replication