Re: Statistics Import and Export

From: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: "Shinoda, Noriyoshi (SXD Japan FSIP)" <noriyoshi(dot)shinoda(at)hpe(dot)com>, jian he <jian(dot)universality(at)gmail(dot)com>, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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>, "alvherre(at)alvh(dot)no-ip(dot)org" <alvherre(at)alvh(dot)no-ip(dot)org>
Subject: Re: Statistics Import and Export
Date: 2024-10-18 23:14:58
Message-ID: CADkLM=fuZgyuMr=x9p9Bas7coVpSnezpzebU0Dc8HGe_5hodWQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
> What is the benefit of a return value from the pg_set_*_stats variants?
> As far as I can tell, there is none because they throw an ERROR if
> anything goes wrong, so they should just return VOID. What am I
> missing?
>

Probably nothing. The nuances of "this stat didn't get set but these other
two did" are too complex for a scalar to report, and
pg_set_relation_stats() doesn't do nuance, anyway. I've attached a patch
that returns void instead.

>
> The return value is more interesting for pg_restore_relation_stats()
> and pg_restore_attribute_stats(), which will be used by pg_dump and
> which are designed to keep going on non-fatal errors. Isn't that what
> this discussion should be about?
>

Yes. I was trying to focus the conversation on something that could be
easily resolved first, and then move on to -restore which is trickier.

Patch that allows relation_statistics_update to continue after one failed
stat (0001) attached, along with bool->void change (0002).

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andy Fan 2024-10-19 00:03:57 Re: Considering fractional paths in Append node
Previous Message Peter Geoghegan 2024-10-18 21:28:24 Re: Avoiding superfluous buffer locking during nbtree backwards scans