| From: | Corey Huinker <corey(dot)huinker(at)gmail(dot)com> |
|---|---|
| To: | pgsql-hackers(at)postgresql(dot)org, etsuro(dot)fujita(at)gmail(dot)com, michael(at)paquier(dot)xyz |
| Subject: | Remove fcinfo from statistics update internal functions |
| Date: | 2026-08-25 19:18:25 |
| Message-ID: | CADkLM=eo7MtuCE=YjovW+=ASw1=q39qQ3qarrsw+EKfU901ztA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
This thread is an offshoot of
https://www.postgresql.org/message-id/flat/CA+TgmoYqMtWb4zLUkT98oFnEkJ=Wz0Pw-ggDJrp9wnSXPzUaeQ(at)mail(dot)gmail(dot)com
covering the refactoring we wanted to do but lacked the time to get it done
in v19.
The big changes from the previous effort are:
1. Instead of having separate per-stat parameters, or a shorted stat-only
array of NullableDatum (thus requiring a separate index of datums, or some
offset), instead we're just going to accept that the _internal function
will ignore the first few elements of the NullableDatum array, specifically
the ones concerning the object identification parameters that have already
been checked/used/resolved. This removes the need for a second enum to
index the shorter array, which in turn removes the need to rename the enum
values.
2. The wrapper functions around the recovery check and locking were not
implemented, and so the *_update() functions were not removed, and so the
the renaming of the *_update_internal() functions to the name of the
recently vacated *_update() function is not done either. I think this
leaves the _update() functions rather "thin" in what they do, but that
gives us a chance to review how much further we want to go. The function
attribute_statistics_update() is called in only by
pg_restore_attribute_stats, and therefore could be entirely folded into
that function. However, removing relation_statistics_update() would result
in that code being duplicated in pg_restore_relation_stats() and
pg_clear_relation_stats(), so that's less of a win without the stat_util
wrapper function.
0001-0003 phase out the use of FunctionCallInfo in any place where a simple
NullableDatum array would suffice. It's still in 3 parts to make each
change easier to see.
0004-0005 are the removal of "version" as a special parameter. They are
strictly speaking outside the scope of $SUBJECT, so its fine if they don't
get addressed in this thread.
| Attachment | Content-Type | Size |
|---|---|---|
| v1-0003-Change-stats_fill_fcinfo_from_arg_pairs-to-Nullab.patch | application/octet-stream | 17.5 KB |
| v1-0005-Remove-check-and-ignore-of-version-parameter-in-s.patch | application/octet-stream | 5.1 KB |
| v1-0002-Make-internal-statistics_update-functions-stop-us.patch | application/octet-stream | 17.7 KB |
| v1-0001-Convert-stats_check-functions-from-fcinfo-to-Null.patch | application/octet-stream | 10.1 KB |
| v1-0004-Have-pg_clear_extended_stats-use-its-own-StatsArg.patch | application/octet-stream | 3.4 KB |
| From | Date | Subject | |
|---|---|---|---|
| Previous Message | Nathan Bossart | 2026-08-25 19:10:35 | Re: SSI: ON CONFLICT DO SELECT takes no predicate lock on the returned row |