Re: vacuumdb changes for stats import/export

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Jeff Davis <pgsql(at)j-davis(dot)com>, Corey Huinker <corey(dot)huinker(at)gmail(dot)com>, jian he <jian(dot)universality(at)gmail(dot)com>, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Magnus Hagander <magnus(at)hagander(dot)net>, Stephen Frost <sfrost(at)snowman(dot)net>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, alvherre(at)alvh(dot)no-ip(dot)org
Subject: Re: vacuumdb changes for stats import/export
Date: 2025-02-04 21:43:57
Message-ID: Z6KKHX9PZkB19lAK@nathan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I had the opportunity to bring this patch set up for discussion at the
developer meeting at FOSDEM PGDay last week [0]. There seemed to be a
strong consensus that the idea of a "missing only" mode for vacuumdb's
analyze options was useful (especially so if the extended stats piece of
the stats import/export project doesn't make it into v18), but that we
shouldn't change the default behavior of the existing options. Given that,
I have modified the patch set to instead introduce a --missing-only option
that can be used in conjuction with --analyze-only and --analyze-in-stages.
The underlying implementation is the same as in v1 of the patch set, except
for the following changes:

* I've modified the extended stats part of the query to also check for
pg_statistic_ext.stxstattarget IS DISTINCT FROM 0.

* I've added a new clause to check for extended statistics on tables with
inheritance children, i.e., those with pg_statistic_ext_data.stxdinherit
set to true.

* I've added a server version check that disallows --missing-only on
servers older than v15. The catalog query would need some adjustments to
work on older versions, but that didn't seem critically important. We
could always revisit this in the future.

[0] https://2025.fosdempgday.org/devmeeting

--
nathan

Attachment Content-Type Size
v2-0001-vacuumdb-Save-catalog-query-results-for-analyze-i.patch text/plain 13.1 KB
v2-0002-vacuumdb-Add-option-for-analyzing-only-relations-.patch text/plain 13.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-02-04 21:55:25 Re: should we have a fast-path planning for OLTP starjoins?
Previous Message Tomas Vondra 2025-02-04 21:42:24 Re: should we have a fast-path planning for OLTP starjoins?