diff options
author | Alexander Korotkov <akorotkov@postgresql.org> | 2020-12-20 07:20:33 +0300 |
---|---|---|
committer | Alexander Korotkov <akorotkov@postgresql.org> | 2020-12-20 07:20:33 +0300 |
commit | 6df7a9698bb036610c1e8c6d375e1be38cb26d5f (patch) | |
tree | dc5985310422e2b41e06bc1770f9e384e0bd6525 /src/include/utils/selfuncs.h | |
parent | 08b01d4dd982b491a2f9641804b368185b8f4c53 (diff) | |
download | postgresql-6df7a9698bb036610c1e8c6d375e1be38cb26d5f.tar.gz postgresql-6df7a9698bb036610c1e8c6d375e1be38cb26d5f.zip |
Multirange datatypes
Multiranges are basically sorted arrays of non-overlapping ranges with
set-theoretic operations defined over them.
Since v14, each range type automatically gets a corresponding multirange
datatype. There are both manual and automatic mechanisms for naming multirange
types. Once can specify multirange type name using multirange_type_name
attribute in CREATE TYPE. Otherwise, a multirange type name is generated
automatically. If the range type name contains "range" then we change that to
"multirange". Otherwise, we add "_multirange" to the end.
Implementation of multiranges comes with a space-efficient internal
representation format, which evades extra paddings and duplicated storage of
oids. Altogether this format allows fetching a particular range by its index
in O(n).
Statistic gathering and selectivity estimation are implemented for multiranges.
For this purpose, stored multirange is approximated as union range without gaps.
This field will likely need improvements in the future.
Catversion is bumped.
Discussion: https://postgr.es/m/CALNJ-vSUpQ_Y%3DjXvTxt1VYFztaBSsWVXeF1y6gTYQ4bOiWDLgQ%40mail.gmail.com
Discussion: https://postgr.es/m/a0b8026459d1e6167933be2104a6174e7d40d0ab.camel%40j-davis.com#fe7218c83b08068bfffb0c5293eceda0
Author: Paul Jungwirth, revised by me
Reviewed-by: David Fetter, Corey Huinker, Jeff Davis, Pavel Stehule
Reviewed-by: Alvaro Herrera, Tom Lane, Isaac Morland, David G. Johnston
Reviewed-by: Zhihong Yu, Alexander Korotkov
Diffstat (limited to 'src/include/utils/selfuncs.h')
-rw-r--r-- | src/include/utils/selfuncs.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/include/utils/selfuncs.h b/src/include/utils/selfuncs.h index 3a2cfb7efa6..68ffd7761f1 100644 --- a/src/include/utils/selfuncs.h +++ b/src/include/utils/selfuncs.h @@ -39,6 +39,9 @@ /* default selectivity estimate for range inequalities "A > b AND A < c" */ #define DEFAULT_RANGE_INEQ_SEL 0.005 +/* default selectivity estimate for multirange inequalities "A > b AND A < c" */ +#define DEFAULT_MULTIRANGE_INEQ_SEL 0.005 + /* default selectivity estimate for pattern-match operators such as LIKE */ #define DEFAULT_MATCH_SEL 0.005 |