Re: Proposal: ANALYZE (MODIFIED_STATS) using autoanalyze thresholds

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Sami Imseih <samimseih(at)gmail(dot)com>
Cc: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com>, VASUKI M <vasukianand0119(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Robert Treat <rob(at)xzilla(dot)net>, Ilia Evdokimov <ilya(dot)evdokimov(at)tantorlabs(dot)com>, Christoph Berg <myon(at)debian(dot)org>, Andreas Karlsson <andreas(at)proxel(dot)se>
Subject: Re: Proposal: ANALYZE (MODIFIED_STATS) using autoanalyze thresholds
Date: 2026-02-24 17:01:45
Message-ID: aZ3ZeWdKHok1s1d6@nathan
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Feb 24, 2026 at 08:19:55AM -0600, Sami Imseih wrote:
> But from a high-level, I am not sure how providing a VIEW or functions in
> which users will be required to script out the ANALYZE commands to run is
> better than providing ANALYZE options? the difference is putting the
> burden on the user to come up with the SQL script vs a simple ANALYZE
> option. IMO, the latter is more appealing from a user perspective.

My principle objection isn't with the option itself, it's that _just_
adding the option papers over the current state of affairs without taking
the opportunity to do a bunch of really useful centralization/refactoring.
By exposing the auto{vacuum,analyze} prioritization code and building off
that, we get a consistent picture wherever it is needed (e.g.,
auto{vacuum,analyze}, vacuumdb, monitoring tools, custom scripts, and any
new VACUUM/ANALYZE options) without having to reinvent the wheel each time.
Sure, we could have vacuumdb just use MISSING_STATS_ONLY for every command
in --missing-stats-only mode, but that seems like a lot of overhead, and we
still aren't helping with observability (which I expect to become even more
important as autovacuum's prioritization code evolves).

I'm admittedly waving my hands a bit here, but in any case, I think this is
an opportunity to do a bunch of super useful improvements that will have
much bigger benefits down the road.

--
nathan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Herrera 2026-02-24 17:08:04 Re: [PATCH] Add Windows support for backtrace_functions (MSVC only)
Previous Message Fujii Masao 2026-02-24 16:37:13 Re: Fix bug of clearing of waitStart in ProcWakeup()