pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Move attribute statistics functions to stat_utils.c
Date: Thu, 25 Dec 2025 06:17:02 +0000
Message-ID: <E1vYeej-002ZaE-2z@gemulon.postgresql.org> (raw)

Move attribute statistics functions to stat_utils.c

Many of the operations done for attribute stats in attribute_stats.c
share the same logic as extended stats, as done by a patch under
discussion to add support for extended stats import and export.  All the
pieces necessary for extended statistics are moved to stats_utils.c,
which is the file where common facilities are shared for stats files.

The following renames are done:
* get_attr_stat_type() -> statatt_get_type()
* init_empty_stats_tuple() -> statatt_init_empty_tuple()
* set_stats_slot() -> statatt_set_slot()
* get_elem_stat_type() -> statatt_get_elem_type()

While on it, this commit adds more documentation for all these
functions, describing more their internals and the dependencies that
have been implied for attribute statistics.  The same concepts apply to
extended statistics, at some degree.

Author: Corey Huinker <corey.huinker@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Yu Wang <wangyu_runtime@163.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/CADkLM=dpz3KFnqP-dgJ-zvRvtjsa8UZv8wDAQdqho=qN3kX0Zg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/213a1b89527049cb27bbcd6871fdb0c0916b43e1

Modified Files
--------------
src/backend/statistics/attribute_stats.c | 464 ++++---------------------------
src/backend/statistics/stat_utils.c      | 378 +++++++++++++++++++++++++
src/include/statistics/stat_utils.h      |  18 ++
3 files changed, 456 insertions(+), 404 deletions(-)



Message-ID: <E1vYeej-002ZaE-2z@gemulon.postgresql.org>
Permalink:  ../E1vYeej-002ZaE-2z@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vYeej-002ZaE-2z@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Move attribute statistics functions to stat_utils.c
  In-Reply-To: <E1vYeej-002ZaE-2z@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox