Re: Optional skipping of unchanged relations during ANALYZE?

From: Sami Imseih <samimseih(at)gmail(dot)com>
To: VASUKI M <vasukianand0119(at)gmail(dot)com>
Cc: Robert Treat <rob(at)xzilla(dot)net>, Ilia Evdokimov <ilya(dot)evdokimov(at)tantorlabs(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com>, Christoph Berg <myon(at)debian(dot)org>
Subject: Re: Optional skipping of unchanged relations during ANALYZE?
Date: 2026-01-29 18:54:30
Message-ID: CAA5RZ0tcacqD_9VQUWk4-b-8BpDZ-CwPd=xuRQoxWBpStsHDSg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thanks for the patch!

> This is conceptually similar to vacuumdb --missing-stats-only, but exposed
> at the SQL ANALYZE level for interactive and scripted use.

What is being proposed in v3 is not similar in behavior.

I am wondering if we should take the current SQL used by vacuumdb to
find missing stats and perform direct syscache lookups in C?

The benefit there is we can also change vacuumdb to use the ANALYZE
(MISSING_STATS) option
directly rather than deriving the SQL, and the MISSING_STATS behavior
will be the same
if we do this type of analyze from vacuumdb or manually via ANALYZE command.

Attached is the query used by vacuumdb on HEAD.

What do you think?

--
Sami Imseih
Amazon Web Services (AWS)

Attachment Content-Type Size
vacuumdb_missing_stats_only.sql application/octet-stream 3.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Corey Huinker 2026-01-29 19:20:26 Re: Import Statistics in postgres_fdw before resorting to sampling.
Previous Message Robert Haas 2026-01-29 18:45:21 more surprising enable_indexonlyscan behavior