git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 08b01d4) | patch
Multirange datatypes
2020年12月20日 04:20:33 +0000 (07:20 +0300)
2020年12月20日 04:20:33 +0000 (07:20 +0300)
commit 6df7a9698bb036610c1e8c6d375e1be38cb26d5f
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
67 files changed:
doc/src/sgml/catalogs.sgml diff | blob | blame | history
doc/src/sgml/datatype.sgml diff | blob | blame | history
doc/src/sgml/extend.sgml diff | blob | blame | history
doc/src/sgml/func.sgml diff | blob | blame | history
doc/src/sgml/rangetypes.sgml diff | blob | blame | history
doc/src/sgml/ref/create_type.sgml diff | blob | blame | history
src/backend/catalog/pg_range.c diff | blob | blame | history
src/backend/catalog/pg_type.c diff | blob | blame | history
src/backend/commands/typecmds.c diff | blob | blame | history
src/backend/executor/functions.c diff | blob | blame | history
src/backend/parser/parse_coerce.c diff | blob | blame | history
src/backend/utils/adt/Makefile diff | blob | blame | history
src/backend/utils/adt/multirangetypes.c [new file with mode: 0644] blob
src/backend/utils/adt/multirangetypes_selfuncs.c [new file with mode: 0644] blob
src/backend/utils/adt/pg_upgrade_support.c diff | blob | blame | history
src/backend/utils/adt/pseudotypes.c diff | blob | blame | history
src/backend/utils/adt/rangetypes.c diff | blob | blame | history
src/backend/utils/adt/rangetypes_typanalyze.c diff | blob | blame | history
src/backend/utils/cache/lsyscache.c diff | blob | blame | history
src/backend/utils/cache/syscache.c diff | blob | blame | history
src/backend/utils/cache/typcache.c diff | blob | blame | history
src/backend/utils/fmgr/funcapi.c diff | blob | blame | history
src/bin/pg_dump/pg_dump.c diff | blob | blame | history
src/bin/pg_dump/pg_dump.h diff | blob | blame | history
src/bin/pg_dump/t/002_pg_dump.pl diff | blob | blame | history
src/include/access/tupmacs.h diff | blob | blame | history
src/include/catalog/binary_upgrade.h diff | blob | blame | history
src/include/catalog/catversion.h diff | blob | blame | history
src/include/catalog/pg_aggregate.dat diff | blob | blame | history
src/include/catalog/pg_amop.dat diff | blob | blame | history
src/include/catalog/pg_amproc.dat diff | blob | blame | history
src/include/catalog/pg_cast.dat diff | blob | blame | history
src/include/catalog/pg_opclass.dat diff | blob | blame | history
src/include/catalog/pg_operator.dat diff | blob | blame | history
src/include/catalog/pg_opfamily.dat diff | blob | blame | history
src/include/catalog/pg_proc.dat diff | blob | blame | history
src/include/catalog/pg_range.dat diff | blob | blame | history
src/include/catalog/pg_range.h diff | blob | blame | history
src/include/catalog/pg_type.dat diff | blob | blame | history
src/include/catalog/pg_type.h diff | blob | blame | history
src/include/commands/typecmds.h diff | blob | blame | history
src/include/utils/lsyscache.h diff | blob | blame | history
src/include/utils/multirangetypes.h [new file with mode: 0644] blob
src/include/utils/rangetypes.h diff | blob | blame | history
src/include/utils/selfuncs.h diff | blob | blame | history
src/include/utils/syscache.h diff | blob | blame | history
src/include/utils/typcache.h diff | blob | blame | history
src/pl/plpgsql/src/pl_comp.c diff | blob | blame | history
src/test/regress/expected/dependency.out diff | blob | blame | history
src/test/regress/expected/hash_func.out diff | blob | blame | history
src/test/regress/expected/multirangetypes.out [new file with mode: 0644] blob
src/test/regress/expected/opr_sanity.out diff | blob | blame | history
src/test/regress/expected/plpgsql.out diff | blob | blame | history
src/test/regress/expected/polymorphism.out diff | blob | blame | history
src/test/regress/expected/rangefuncs.out diff | blob | blame | history
src/test/regress/expected/rangetypes.out diff | blob | blame | history
src/test/regress/expected/sanity_check.out diff | blob | blame | history
src/test/regress/expected/type_sanity.out diff | blob | blame | history
src/test/regress/parallel_schedule diff | blob | blame | history
src/test/regress/serial_schedule diff | blob | blame | history
src/test/regress/sql/hash_func.sql diff | blob | blame | history
src/test/regress/sql/multirangetypes.sql [new file with mode: 0644] blob
src/test/regress/sql/opr_sanity.sql diff | blob | blame | history
src/test/regress/sql/polymorphism.sql diff | blob | blame | history
src/test/regress/sql/rangetypes.sql diff | blob | blame | history
src/test/regress/sql/type_sanity.sql diff | blob | blame | history
src/tools/pgindent/typedefs.list diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /