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: Stephen Frost <sfrost(at)snowman(dot)net>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Matthias van de Meent <boekewurm+postgres(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>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Statistics Import and Export
Date: 2024-03-30 05:34:16
Message-ID: CADkLM=c8hAew1CdUBQNWr3r0dkZCu9DNhXV-X7ccLDNiQKhAnA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
> Right, I think there are some interesting things to pursue here. I also
> had an idea to use logical decoding to get a streaming sample, which
> would be better randomness than block sampling. At this point that's
> just an idea, I haven't looked into it seriously.
>
> Regards,
> Jeff Davis
>
>

v15 attached

0001:
- fixed an error involving tsvector types
- only derive element type if element stats available
- general cleanup

0002:

- 002pg_upgrade.pl now dumps before/after databases with --no-statistics. I
tried to find out why some tables were getting their relstats either not
set, or set and reset, never affecting the attribute stats. I even tried
turning autovacuum off for both instances, but nothing seemed to change the
fact that the same tables were having their relstats reset.

TODO list:

- decision on whether suppressing stats in the pg_upgrade TAP check is for
the best
- pg_upgrade option to suppress stats import, there is no real pattern to
follow there
- what message text to convey to the user about the potential stats import
errors and their remediation, and to what degree that replaces the "you
ought to run vacuumdb" message.
- what additional error context we want to add to the array_in() imports of
anyarray strings

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Melanie Plageman 2024-03-30 05:57:10 Re: Combine Prune and Freeze records emitted by vacuum
Previous Message Thomas Munro 2024-03-30 03:38:11 Re: broken JIT support on Fedora 40