Hi all, Thanks a lot for the thoughtful feedback.
The points about statistics targets and random sampling make sense. In particular, I agree that even without data changes, re-running ANALYZE can still be beneficial (for example after increasing default_statistics_target or per-column targets, or simply to obtain a different sample). Given that, my intention is to keep this strictly as an opt-in behavior, so that existing semantics are unchanged unless the user explicitly requests it. In the current prototype, tables that have never been analyzed before are not skipped, and SMART only considers relations that already have statistics. Regarding statistics targets, since PostgreSQL does not currently track which target was used to collect existing statistics, SMART ANALYZE would not attempt to account for target changes. I plan to document this limitation clearly so users understand the trade-off when opting into this mode [for now later will look into it]. I’ll take this feedback into account while cleaning up the patch and documentation, and will follow up with a v1 proposal once ready. Thanks again for the guidance. Regards, Vasuki M C-DAC,Chennai
