public inbox for [email protected]  
help / color / mirror / Atom feed
pgsql: vacuumdb: Add option for analyzing only relations missing stats.
3+ messages / 3 participants
[nested] [flat]

* pgsql: vacuumdb: Add option for analyzing only relations missing stats.
@ 2025-03-07 03:29 John Naylor <[email protected]>
  2025-03-07 03:36 ` Re: pgsql: vacuumdb: Add option for analyzing only relations missing stats. John Naylor <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: John Naylor @ 2025-03-07 03:29 UTC (permalink / raw)
  To: [email protected]

vacuumdb: Add option for analyzing only relations missing stats.

This commit adds a new --missing-only option that can be used in
conjunction with --analyze-only and --analyze-in-stages.  When this
option is specified, vacuumdb will generate ANALYZE commands for a
relation if it is missing any statistics it should ordinarily have.
For example, if a table has statistics for one column but not
another, we will analyze the whole table.  A similar principle
applies to extended statistics, expression indexes, and table
inheritance.

Co-authored-by: Corey Huinker <[email protected]>
Reviewed-by: TODO
Discussion: https://postgr.es/m/Z5O1bpcwDrMgyrYy%40nathan

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5f8eb25706b62923c53172e453c8a4dedd877a3d
Author: Nathan Bossart <[email protected]>

Modified Files
--------------
doc/src/sgml/ref/vacuumdb.sgml           | 16 ++++++
src/bin/scripts/t/102_vacuumdb_stages.pl | 60 +++++++++++++++++++++
src/bin/scripts/vacuumdb.c               | 92 ++++++++++++++++++++++++++++++++
src/test/perl/PostgreSQL/Test/Cluster.pm | 27 ++++++++++
4 files changed, 195 insertions(+)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pgsql: vacuumdb: Add option for analyzing only relations missing stats.
  2025-03-07 03:29 pgsql: vacuumdb: Add option for analyzing only relations missing stats. John Naylor <[email protected]>
@ 2025-03-07 03:36 ` John Naylor <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: John Naylor @ 2025-03-07 03:36 UTC (permalink / raw)
  To: John Naylor <[email protected]>; +Cc: [email protected]

On Fri, Mar 7, 2025 at 10:29 AM John Naylor <[email protected]> wrote:
>
> vacuumdb: Add option for analyzing only relations missing stats.

My apologies, I didn't realize I had applied this to master branch
when reviewing it, will revert.

-- 
John Naylor
Amazon Web Services






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: vacuumdb: Add option for analyzing only relations missing stats.
@ 2025-03-18 21:33 Nathan Bossart <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Nathan Bossart @ 2025-03-18 21:33 UTC (permalink / raw)
  To: [email protected]

vacuumdb: Add option for analyzing only relations missing stats.

This commit adds a new --missing-stats-only option that can be used
with --analyze-only or --analyze-in-stages.  When this option is
specified, vacuumdb will analyze a relation if it lacks any
statistics for a column, expression index, or extended statistics
object.  This new option is primarily intended for use after
pg_upgrade (since it can now retain most optimizer statistics), but
it might be useful in other situations, too.

Author: Corey Huinker <[email protected]>
Co-authored-by: Nathan Bossart <[email protected]>
Reviewed-by: John Naylor <[email protected]>
Discussion: https://postgr.es/m/Z5O1bpcwDrMgyrYy%40nathan

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/edba754f052ea0c02287080004aa6051eaa4f597

Modified Files
--------------
doc/src/sgml/ref/vacuumdb.sgml           |  16 +++++
src/bin/scripts/t/100_vacuumdb.pl        |  60 ++++++++++++++++
src/bin/scripts/vacuumdb.c               | 114 ++++++++++++++++++++++++++++++-
src/test/perl/PostgreSQL/Test/Cluster.pm |  27 ++++++++
4 files changed, 215 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2025-03-18 21:33 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-03-07 03:29 pgsql: vacuumdb: Add option for analyzing only relations missing stats. John Naylor <[email protected]>
2025-03-07 03:36 ` John Naylor <[email protected]>
2025-03-18 21:33 pgsql: vacuumdb: Add option for analyzing only relations missing stats. Nathan Bossart <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox