Re: Statistics Import and Export

From: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
To: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jeff Davis <pgsql(at)j-davis(dot)com>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, 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>, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
Subject: Re: Statistics Import and Export
Date: 2024-04-26 03:27:08
Message-ID: CADkLM=dHYkDa-raQrahd5-PkO_=aw1RuffUxVAfEnEyX5ZOB5A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
>
> You can set autovacuum_analyze_threshold and *_scale_factor to
> excessively high values, which has the effect of disabling autoanalyze
> until it has had similarly excessive tuple churn. But that won't
> guarantee autoanalyze won't run; that guarantee only exists with
> autovacuum = off.
>

I'd be a bit afraid to set to those values so high, for fear that they
wouldn't get reset when normal operations resumed, and nobody would notice
until things got bad.

v20 is attached. It resolves the dependency issue in v19, so while I'm
still unclear as to why we want it this way vs the simplicity of
SECTION_NONE, I'm going to roll with it.

Next up for question is how to handle --statistics-only or an equivalent.
The option would be mutually exclusive with --schema-only and --data-only,
and it would be mildly incongruous if it didn't have a short option like
the others, so I'm suggested -P for Probablity / Percentile / ρ:
correlation / etc.

One wrinkle with having three mutually exclusive options instead of two is
that the existing code was able to assume that one of the options being
true meant that we could bail out of certain dumpXYZ() functions, and now
those tests have to compare against two, which makes me think we should add
three new DumpOptions that are the non-exclusive positives (yesSchema,
yesData, yesStats) and set those in addition to the schemaOnly, dataOnly,
and statsOnly flags. Thoughts?

Attachment Content-Type Size
v20-0001-Create-pg_set_relation_stats-pg_set_attribute_st.patch text/x-patch 109.9 KB
v20-0002-Enable-dumping-of-table-index-stats-in-pg_dump.patch text/x-patch 22.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2024-04-26 03:34:10 Re: sql/json remaining issue
Previous Message Peter Smith 2024-04-26 02:33:20 Re: Improve the connection failure error messages