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 <[email protected]> Reviewed-by: Chao Li <[email protected]> Reviewed-by: Yu Wang <[email protected]> Reviewed-by: Michael Paquier <[email protected]> Discussion: https://postgr.es/m/CADkLM=dpz3KFnqP-dgJ-zvRvtjsa8UZv8wDAQdqho=qn3kx...@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(-)
