]> granicus.if.org Git - postgresql/commit
Add support for multivariate MCV lists
authorTomas Vondra <tomas.vondra@postgresql.org>
Wed, 27 Mar 2019 17:32:18 +0000 (18:32 +0100)
committerTomas Vondra <tomas.vondra@postgresql.org>
Wed, 27 Mar 2019 17:32:18 +0000 (18:32 +0100)
commit7300a699502fe5432b05fbc75baca534b080bebb
tree2fa5740b9cf8363068e8a575ae569ca172ffb66a
parent333ed246c6f351c4e8fe22c764b97793c4101b00
Add support for multivariate MCV lists

Introduce a third extended statistic type, supported by the CREATE
STATISTICS command - MCV lists, a generalization of the statistic
already built and used for individual columns.

Compared to the already supported types (n-distinct coefficients and
functional dependencies), MCV lists are more complex, include column
values and allow estimation of much wider range of common clauses
(equality and inequality conditions, IS NULL, IS NOT NULL etc.).
Similarly to the other types, a new pseudo-type (pg_mcv_list) is used.

Author: Tomas Vondra
Reviewed-by: Dean Rasheed, David Rowley, Mark Dilger, Alvaro Herrera
Discussion: https://postgr.es/m/dfdac334-9cf2-2597-fb27-f0fb3753f435@2ndquadrant.com
32 files changed:
doc/src/sgml/catalogs.sgml
doc/src/sgml/func.sgml
doc/src/sgml/perform.sgml
doc/src/sgml/planstats.sgml
doc/src/sgml/ref/create_statistics.sgml
src/backend/commands/statscmds.c
src/backend/nodes/bitmapset.c
src/backend/optimizer/path/clausesel.c
src/backend/optimizer/util/plancat.c
src/backend/parser/parse_utilcmd.c
src/backend/statistics/Makefile
src/backend/statistics/README
src/backend/statistics/README.mcv [new file with mode: 0644]
src/backend/statistics/dependencies.c
src/backend/statistics/extended_stats.c
src/backend/statistics/mcv.c [new file with mode: 0644]
src/backend/utils/adt/ruleutils.c
src/bin/psql/describe.c
src/bin/psql/tab-complete.c
src/include/catalog/pg_cast.dat
src/include/catalog/pg_proc.dat
src/include/catalog/pg_statistic_ext.h
src/include/catalog/pg_type.dat
src/include/nodes/bitmapset.h
src/include/optimizer/optimizer.h
src/include/statistics/extended_stats_internal.h
src/include/statistics/statistics.h
src/test/regress/expected/create_table_like.out
src/test/regress/expected/opr_sanity.out
src/test/regress/expected/stats_ext.out
src/test/regress/expected/type_sanity.out
src/test/regress/sql/stats_ext.sql