diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-01-20 20:45:41 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-01-20 20:45:41 +0000 |
commit | f41803bb39bc2949db200116a609fd242d0ec221 (patch) | |
tree | 2c81bcf712ab8b46133c2f50bbee34b2b3ea7129 /src/backend/utils/adt | |
parent | 2b7334d4877ba445003f96b0bb7eed4e7078a39b (diff) | |
download | postgresql-f41803bb39bc2949db200116a609fd242d0ec221.tar.gz postgresql-f41803bb39bc2949db200116a609fd242d0ec221.zip |
Refactor planner's pathkeys data structure to create a separate, explicit
representation of equivalence classes of variables. This is an extensive
rewrite, but it brings a number of benefits:
* planner no longer fails in the presence of "incomplete" operator families
that don't offer operators for every possible combination of datatypes.
* avoid generating and then discarding redundant equality clauses.
* remove bogus assumption that derived equalities always use operators
named "=".
* mergejoins can work with a variety of sort orders (e.g., descending) now,
instead of tying each mergejoinable operator to exactly one sort order.
* better recognition of redundant sort columns.
* can make use of equalities appearing underneath an outer join.
Diffstat (limited to 'src/backend/utils/adt')
-rw-r--r-- | src/backend/utils/adt/selfuncs.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index 875c7c524af..493df17b6c2 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -15,7 +15,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.219 2007/01/09 02:14:14 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.220 2007/01/20 20:45:40 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -2345,7 +2345,7 @@ add_unique_group_var(PlannerInfo *root, List *varinfos, * expressional index for which we have statistics, then we treat the * whole expression as though it were just a Var. * 2. If the list contains Vars of different relations that are known equal - * due to equijoin clauses, then drop all but one of the Vars from each + * due to equivalence classes, then drop all but one of the Vars from each * known-equal set, keeping the one with smallest estimated # of values * (since the extra values of the others can't appear in joined rows). * Note the reason we only consider Vars of different relations is that @@ -2365,10 +2365,9 @@ add_unique_group_var(PlannerInfo *root, List *varinfos, * 4. If there are Vars from multiple rels, we repeat step 3 for each such * rel, and multiply the results together. * Note that rels not containing grouped Vars are ignored completely, as are - * join clauses other than the equijoin clauses used in step 2. Such rels - * cannot increase the number of groups, and we assume such clauses do not - * reduce the number either (somewhat bogus, but we don't have the info to - * do better). + * join clauses. Such rels cannot increase the number of groups, and we + * assume such clauses do not reduce the number either (somewhat bogus, + * but we don't have the info to do better). */ double estimate_num_groups(PlannerInfo *root, List *groupExprs, double input_rows) |