postgresql/src/include/utils
Alexander Korotkov 6df7a9698b 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
2020-12-20 07:20:33 +03:00
..
.gitignore Revert "Add gitignore entries for jsonpath_gram.h" 2019-03-23 00:19:34 +01:00
acl.h Unify drop-by-OID functions 2020-06-09 09:39:46 +02:00
aclchk_internal.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
array.h Support subscripting of arbitrary types, not only arrays. 2020-12-09 12:40:37 -05:00
arrayaccess.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
ascii.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
attoptcache.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
builtins.h Replace remaining StrNCpy() by strlcpy() 2020-08-10 23:20:37 +02:00
bytea.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
cash.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
catcache.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
combocid.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
date.h Prevent internal overflows in date-vs-timestamp and related comparisons. 2020-10-07 17:10:26 -04:00
datetime.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
datum.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
dsa.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
dynahash.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
elog.h Tidy up definitions of pg_attribute_hot and pg_attribute_cold 2020-11-25 10:52:50 +13:00
evtcache.h Fix up recent breakage of headerscheck and cpluspluscheck. 2020-03-21 18:28:44 -04:00
expandeddatum.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
expandedrecord.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
float.h Remove underflow error in float division with infinite divisor. 2020-11-04 18:11:15 -05:00
fmgrtab.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
formatting.h Allow to_date/to_timestamp to recognize non-English month/day names. 2020-03-03 11:06:47 -05:00
freepage.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
geo_decls.h Fix FPeq() and friends to get the right answers for infinities. 2020-11-21 16:46:43 -05:00
guc.h Avoid spamming the client with multiple ParameterStatus messages. 2020-11-25 11:40:44 -05:00
guc_tables.h Avoid spamming the client with multiple ParameterStatus messages. 2020-11-25 11:40:44 -05:00
help_config.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
hsearch.h Improve hash_create()'s API for some added robustness. 2020-12-15 11:38:53 -05:00
index_selfuncs.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
inet.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
int8.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
inval.h WAL Log invalidations at command end with wal_level=logical. 2020-07-23 08:34:48 +05:30
json.h Adjust src/include/utils/jsonapi.h so it's not backend-only. 2020-01-24 09:58:37 -08:00
jsonb.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
jsonfuncs.h Fix some header identifications 2020-07-14 13:39:45 +09:00
jsonpath.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
logtape.h logtape.c: do not preallocate for tapes when sorting 2020-09-11 17:10:02 -07:00
lsyscache.h Multirange datatypes 2020-12-20 07:20:33 +03:00
memdebug.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
memutils.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
multirangetypes.h Multirange datatypes 2020-12-20 07:20:33 +03:00
numeric.h Expose internal function for converting int64 to numeric 2020-09-09 20:16:28 +02:00
old_snapshot.h Expose oldSnapshotControl definition via new header. 2020-09-24 13:33:09 -04:00
palloc.h Add pg_nodiscard decorations to some functions 2020-11-11 11:00:27 +01:00
partcache.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
pg_crc.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
pg_locale.h Track collation versions for indexes. 2020-11-03 01:19:50 +13:00
pg_lsn.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
pg_rusage.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
pidfile.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
plancache.h Add generic_plans and custom_plans fields into pg_prepared_statements. 2020-07-20 11:55:50 +09:00
portal.h Represent command completion tags as structs 2020-03-02 18:19:51 -03:00
ps_status.h Refactor ps_status.c API 2020-03-11 16:38:31 +01:00
queryenvironment.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
rangetypes.h Multirange datatypes 2020-12-20 07:20:33 +03:00
regproc.h Eliminate cache lookup errors in SQL functions for object addresses 2020-07-15 09:03:10 +09:00
rel.h Track collation versions for indexes. 2020-11-03 01:19:50 +13:00
relcache.h Skip WAL for new relfilenodes, under wal_level=minimal. 2020-04-04 12:25:34 -07:00
relfilenodemap.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
relmapper.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
relptr.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
reltrigger.h Enable BEFORE row-level triggers for partitioned tables 2020-03-18 18:58:05 -03:00
resowner.h Improve performance of "simple expressions" in PL/pgSQL. 2020-03-26 18:58:57 -04:00
resowner_private.h Change SHA2 implementation based on OpenSSL to use EVP digest routines 2020-12-04 10:49:23 +09:00
rls.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
ruleutils.h Implement operator class parameters 2020-03-30 19:17:23 +03:00
sampling.h Report progress of ANALYZE commands 2020-01-15 11:14:39 -03:00
selfuncs.h Multirange datatypes 2020-12-20 07:20:33 +03:00
sharedtuplestore.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
snapmgr.h snapshot scalability: Don't compute global horizons while building snapshots. 2020-08-12 16:03:49 -07:00
snapshot.h snapshot scalability: cache snapshots using a xact completion counter. 2020-08-17 21:08:30 -07:00
sortsupport.h Add support for building GiST index by sorting. 2020-09-17 11:33:40 +03:00
spccache.h Introduce a maintenance_io_concurrency setting. 2020-03-16 17:14:26 +13:00
syscache.h Multirange datatypes 2020-12-20 07:20:33 +03:00
timeout.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
timestamp.h Fix and simplify some usages of TimestampDifference(). 2020-11-10 22:51:54 -05:00
tuplesort.h Add support for building GiST index by sorting. 2020-09-17 11:33:40 +03:00
tuplestore.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
typcache.h Multirange datatypes 2020-12-20 07:20:33 +03:00
tzparser.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
uuid.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
varbit.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
varlena.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
xid8.h Add SQL type xid8 to expose FullTransactionId to users. 2020-04-07 12:03:59 +12:00
xml.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00