Re: Extended Statistics set/restore/clear functions.

From: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, Tender Wang <tndrwang(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Extended Statistics set/restore/clear functions.
Date: 2026-01-21 20:42:21
Message-ID: CADkLM=c3s-BtSebTHggY__DOYFMCdknaLuJHwG0o817o0Q9tNA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
> Hmm. Not sure yet which one is better here, TBH. The "ok" pattern
> feels a but better to me because a Datum == 0 could also be fine in
> some cases, be they existing of future cases, so that's more flexible
> by design.
>

I went with the "ok" model wherever possible.

> When I review a patch and that I want to do a clean split, I tend to
> apply the whole, then remove the parts that can be split out, reapply,
> and then generate a diff of the previously-removed code. It's just
> easier to delete code. For this patch set, it would mean removing the
> MVC variables and related structures. It is actually not that bad
> based on how you have structured the restore function; there is no
> strong dependency between each code path treating each stxkind. This
> is just thinking of possible strategy if this whole thing cannot make
> it into the tree by the freeze deadline. Some of it may be better
> than nothing of it, and it is possible to add more parameters later
> with the right basics in place. For me, review and integration tends
> to be easier as a incremental set of small-ish steps, but I think that
> you are aware of my way of doing things :D
>

I've added about 30 tests covering various things that can go wrong with
extended stats parameter combinations, parameter contents, expression
parameter combinations.

There is one WARNING I can see that still needs coverage, but I'm at a loss
as to how to set it up. It's the extended_stats.c:1202 "could not determine
element type of expression" which should only happen if we have a datatype
that appears to be an array but actually isn't...

Also improved documentation, moved some code to import_mcv to behave like
import_expressions, etc.

Attachment Content-Type Size
v29-0001-Add-pg_restore_extended_stats.patch text/x-patch 144.1 KB
v29-0002-Include-Extended-Statistics-in-pg_dump.patch text/x-patch 14.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ilia Evdokimov 2026-01-21 20:44:08 Re: [PATCH] ANALYZE: hash-accelerate MCV tracking for equality-only types
Previous Message Bruce Momjian 2026-01-21 20:25:16 Re: Can we remove support for standard_conforming_strings = off yet?