]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Move attribute statistics functions to stat_utils.c
authorMichael Paquier <michael@paquier.xyz>
Thu, 25 Dec 2025 06:13:39 +0000 (15:13 +0900)
committerMichael Paquier <michael@paquier.xyz>
Thu, 25 Dec 2025 06:13:39 +0000 (15:13 +0900)
commit213a1b89527049cb27bbcd6871fdb0c0916b43e1
tree19c3d9b0e4c8df7dec36f814a8cf3e97dd0ba39f
parent325808cac9b379869099f47fe4f8198ddd7805c0
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
src/backend/statistics/attribute_stats.c
src/backend/statistics/stat_utils.c
src/include/statistics/stat_utils.h