digoal
2023-11-28
PostgreSQL , PolarDB , pg_stats , range
Display length and bounds histograms in pg_stats
author Alexander Korotkov <akorotkov@postgresql.org>
Sun, 26 Nov 2023 23:30:39 +0000 (01:30 +0200)
committer Alexander Korotkov <akorotkov@postgresql.org>
Sun, 26 Nov 2023 23:32:17 +0000 (01:32 +0200)
commit bc3c8db8ae2f899cfd65edce99fe9cf65caf1ed7
tree 6d5f6620a3be298e871c3fbfccb434a3f2df8283 tree
parent 441c8a31349105590e778fe7dd1db0d0c89299df commit | diff
Display length and bounds histograms in pg_stats
Values corresponding to STATISTIC_KIND_RANGE_LENGTH_HISTOGRAM and
STATISTIC_KIND_BOUNDS_HISTOGRAM were not exposed to pg_stats when these
slot kinds were introduced in 918eee0c49.
This commit adds the missing fields to pg_stats.
Catversion is bumped.
Discussion: https://postgr.es/m/flat/b67d8b57-9357-7e82-a2e7-f6ce6eaeec67@postgrespro.ru
Author: Egor Rogov, Soumyadeep Chakraborty
Reviewed-by: Tomas Vondra, Justin Pryzby, Jian He
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>range_length_histogram</structfield> <type>anyarray</type>
+ </para>
+ <para>
+ A histogram of the lengths of non-empty and non-null range values of a
+ range type column. (Null for non-range types.)
+ </para>
+ <para>
+ This histogram is calculated using the <literal>subtype_diff</literal>
+ range function regardless of whether range bounds are inclusive.
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>range_empty_frac</structfield> <type>float4</type>
+ </para>
+ <para>
+ Fraction of column entries whose values are empty ranges.
+ (Null for non-range types.)
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>range_bounds_histogram</structfield> <type>anyarray</type>
+ </para>
+ <para>
+ A histogram of lower and upper bounds of non-empty and non-null range
+ values. (Null for non-range types.)
+ </para>
+ <para>
+ These two histograms are represented as a single array of ranges, whose
+ lower bounds represent the histogram of lower bounds, and upper bounds
+ represent the histogram of upper bounds.
+ </para></entry>