Re: vacuumdb changes for stats import/export

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Frédéric Yhuel <frederic(dot)yhuel(at)dalibo(dot)com>
Cc: Nathan Bossart <nathandbossart(at)gmail(dot)com>, Corey Huinker <corey(dot)huinker(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, John Naylor <johncnaylorls(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Jeff Davis <pgsql(at)j-davis(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" <alvherre(at)alvh(dot)no-ip(dot)org>
Subject: Re: vacuumdb changes for stats import/export
Date: 2025-07-28 16:22:29
Message-ID: CAKFQuwYzgRbRBH6T+QZ=Cioy5rLB4mJDZUH2CjMebpFBDKuC_g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Monday, July 28, 2025, Frédéric Yhuel <frederic(dot)yhuel(at)dalibo(dot)com> wrote:

>
>
> On 7/28/25 16:47, Nathan Bossart wrote:
>
>> I can't remember who wrote this line, but it was borrowed from the
>> --analyze-in-stages description. The point is that if you use
>> --analyze-in-stages without --missing-stats-only, there will be a period
>> where existing statistics will be replaced with ones generated with lower
>> statistics targets.
>>
>
> Aha, it makes sense now, thank you!
>
> Obviously, this wording isn't clear enough. We might
>> need to either remove that sentence or add "When used in conjunction with
>> --analyze-in-stages..."
>>
>
> I vote for the second option.
>
>
Makes sense. This does beg the question - what happens if a column is left
with a lower statistics target than what would be applied during an
analyze, but one is present? I don’t see where the statistics target is
saved anywhere. Can we start recording that piece of data and teach
analyze in stages to just never go backwards - reporting any it had to skip
to adhere to that rule. Seems like a better policy than missing-only.

David J.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey Borodin 2025-07-28 17:23:24 Re: MultiXact\SLRU buffers configuration
Previous Message Daniel Gustafsson 2025-07-28 16:14:20 Re: Support getrandom() for pg_strong_random() source