Hi Hackers, I’m planning to work on a small improvement around ANALYZE behavior and wanted to ask the community for guidance before proceeding.
Currently, when ANALYZE is run over many relations, it analyzes all eligible tables even if some of them have not changed since their last ANALYZE. In environments with many mostly-static tables, this can lead to repeated work with little benefit. I’m considering working on an optional mode where ANALYZE would skip relations that have not been modified since their last analyze, based on existing pg_stat counters (for example, mod_since_analyze = 0). Before moving forward, I’d like to understand: --whether this aligns with PostgreSQL’s statistics and planner design, --if there are reasons ANALYZE should always re-run even for unchanged relations, --and whether such behavior would be acceptable if it were strictly opt-in. Any feedback, concerns, or pointers would be very helpful. Thanks, Vasuki M C-DAC,Chennai
