postgresql/src/include/commands
Alvaro Herrera 7b504eb282 Implement multivariate n-distinct coefficients
Add support for explicitly declared statistic objects (CREATE
STATISTICS), allowing collection of statistics on more complex
combinations that individual table columns.  Companion commands DROP
STATISTICS and ALTER STATISTICS ... OWNER TO / SET SCHEMA / RENAME are
added too.  All this DDL has been designed so that more statistic types
can be added later on, such as multivariate most-common-values and
multivariate histograms between columns of a single table, leaving room
for permitting columns on multiple tables, too, as well as expressions.

This commit only adds support for collection of n-distinct coefficient
on user-specified sets of columns in a single table.  This is useful to
estimate number of distinct groups in GROUP BY and DISTINCT clauses;
estimation errors there can cause over-allocation of memory in hashed
aggregates, for instance, so it's a worthwhile problem to solve.  A new
special pseudo-type pg_ndistinct is used.

(num-distinct estimation was deemed sufficiently useful by itself that
this is worthwhile even if no further statistic types are added
immediately; so much so that another version of essentially the same
functionality was submitted by Kyotaro Horiguchi:
https://postgr.es/m/20150828.173334.114731693.horiguchi.kyotaro@lab.ntt.co.jp
though this commit does not use that code.)

Author: Tomas Vondra.  Some code rework by Álvaro.
Reviewed-by: Dean Rasheed, David Rowley, Kyotaro Horiguchi, Jeff Janes,
    Ideriha Takeshi
Discussion: https://postgr.es/m/543AFA15.4080608@fuzzy.cz
    https://postgr.es/m/20170320190220.ixlaueanxegqd5gr@alvherre.pgsql
2017-03-24 14:06:10 -03:00
..
alter.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
async.h Generate fmgr prototypes automatically 2017-01-17 14:06:07 -05:00
cluster.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
collationcmds.h ICU support 2017-03-23 15:28:48 -04:00
comment.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
conversioncmds.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
copy.h Logical replication support for initial data copy 2017-03-23 08:55:37 -04:00
createas.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
dbcommands.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
dbcommands_xlog.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
defrem.h Implement multivariate n-distinct coefficients 2017-03-24 14:06:10 -03:00
discard.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
event_trigger.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
explain.h Change representation of statement lists, and add statement location info. 2017-01-14 16:02:35 -05:00
extension.h Remove objname/objargs split for referring to objects 2017-03-06 13:31:47 -05:00
lockcmds.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
matview.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
policy.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
portalcmds.h Change representation of statement lists, and add statement location info. 2017-01-14 16:02:35 -05:00
prepare.h Change representation of statement lists, and add statement location info. 2017-01-14 16:02:35 -05:00
proclang.h Change many routines to return ObjectAddress rather than OID 2015-03-03 14:10:50 -03:00
progress.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
publicationcmds.h Update copyright years in some recently added files 2017-01-25 12:32:05 -05:00
schemacmds.h Change representation of statement lists, and add statement location info. 2017-01-14 16:02:35 -05:00
seclabel.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
sequence.h Add WAL consistency checking facility. 2017-02-08 15:45:30 -05:00
subscriptioncmds.h Disallow CREATE/DROP SUBSCRIPTION in transaction block 2017-03-03 23:29:13 -05:00
tablecmds.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
tablespace.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
trigger.h Generate fmgr prototypes automatically 2017-01-17 14:06:07 -05:00
typecmds.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
user.h Replace isMD5() with a more future-proof way to check if pw is encrypted. 2017-02-01 13:11:37 +02:00
vacuum.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
variable.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
view.h Change representation of statement lists, and add statement location info. 2017-01-14 16:02:35 -05:00