aboutsummaryrefslogtreecommitdiff
path: root/src/backend/optimizer/util/orclauses.c
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2017-04-05 18:00:42 -0400
committerSimon Riggs <simon@2ndQuadrant.com>2017-04-05 18:00:42 -0400
commit2686ee1b7ccfb9214064d4d2a98ea77382880306 (patch)
tree32095d935e240b93ed30b1e86c2efa161cffa4dd /src/backend/optimizer/util/orclauses.c
parent00b6b6feb12cef53737287b67ecef6aff1f1d8ab (diff)
downloadpostgresql-2686ee1b7ccfb9214064d4d2a98ea77382880306.tar.gz
postgresql-2686ee1b7ccfb9214064d4d2a98ea77382880306.zip
Collect and use multi-column dependency stats
Follow on patch in the multi-variate statistics patch series. CREATE STATISTICS s1 WITH (dependencies) ON (a, b) FROM t; ANALYZE; will collect dependency stats on (a, b) and then use the measured dependency in subsequent query planning. Commit 7b504eb282ca2f5104b5c00b4f05a3ef6bb1385b added CREATE STATISTICS with n-distinct coefficients. These are now specified using the mutually exclusive option WITH (ndistinct). Author: Tomas Vondra, David Rowley Reviewed-by: Kyotaro HORIGUCHI, Álvaro Herrera, Dean Rasheed, Robert Haas and many other comments and contributions Discussion: https://postgr.es/m/56f40b20-c464-fad2-ff39-06b668fac47c@2ndquadrant.com
Diffstat (limited to 'src/backend/optimizer/util/orclauses.c')
-rw-r--r--src/backend/optimizer/util/orclauses.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/optimizer/util/orclauses.c b/src/backend/optimizer/util/orclauses.c
index 9cbcaedb75d..735697d2f36 100644
--- a/src/backend/optimizer/util/orclauses.c
+++ b/src/backend/optimizer/util/orclauses.c
@@ -280,7 +280,7 @@ consider_new_or_clause(PlannerInfo *root, RelOptInfo *rel,
* saving work later.)
*/
or_selec = clause_selectivity(root, (Node *) or_rinfo,
- 0, JOIN_INNER, NULL);
+ 0, JOIN_INNER, NULL, rel);
/*
* The clause is only worth adding to the query if it rejects a useful
@@ -344,7 +344,7 @@ consider_new_or_clause(PlannerInfo *root, RelOptInfo *rel,
/* Compute inner-join size */
orig_selec = clause_selectivity(root, (Node *) join_or_rinfo,
- 0, JOIN_INNER, &sjinfo);
+ 0, JOIN_INNER, &sjinfo, NULL);
/* And hack cached selectivity so join size remains the same */
join_or_rinfo->norm_selec = orig_selec / or_selec;