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: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, 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>
Subject: Re: Statistics Import and Export
Date: 2024-03-29 09:32:40
Message-ID: CADkLM=e=_6dtacmrvd2NJWacOnQ3Zu5iaRZFgePL1=0L5-7P_w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 29, 2024 at 2:25 AM Jeff Davis <pgsql(at)j-davis(dot)com> wrote:

> I also attached a patch implementing a different approach to the
> pg_dump support. Instead of trying to create a query that uses SQL
> "format()" to create more SQL, I did all the formatting in C. It turned
> out to be about 30% fewer lines, and I find it more understandable and
> consistent with the way other stuff in pg_dump happens.
>

That is fairly close to what I came up with per our conversation (attached
below), but I really like the att_stats_arginfo construct and I definitely
want to adopt that and expand it to a third dimension that flags the fields
that cannot be null. I will incorporate that into v15.

As for v14, here are the highlights:

0001:
- broke up pg_set_attribute_stats() into many functions. Every stat kind
gets its own validation function. Type derivation is now done in its own
function.
- removed check on inherited stats flag that required the table be
partitioned. that was in error
- added check for most_common_values to be unique in ascending order, and
tests to match
- no more mention of pg_dump in the function documentation
- function documentation cites pg-stats-view as reference for the
parameter's data requirements

0002:
- All relstats and attrstats calls are now their own statement instead of a
compound statement
- moved the archive TOC entry from post-data back to SECTION_NONE (as it
was modeled on object COMMENTs), which seems to work better.
- remove meta-query in favor of more conventional query building
- removed all changes to fe_utils/

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2024-03-29 09:33:01 Re: Introduce XID age and inactive timeout based replication slot invalidation
Previous Message Richard Guo 2024-03-29 09:14:30 Remove excessive trailing semicolons