mirror of
https://github.com/postgres/postgres.git
synced 2025-11-07 19:06:32 +03:00
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.
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/optimizer/prep/prepjointree.c,v 1.45 2007/01/05 22:19:32 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/optimizer/prep/prepjointree.c,v 1.46 2007/01/20 20:45:39 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -292,6 +292,7 @@ pull_up_simple_subquery(PlannerInfo *root, Node *jtnode, RangeTblEntry *rte,
|
||||
*/
|
||||
subroot = makeNode(PlannerInfo);
|
||||
subroot->parse = subquery;
|
||||
subroot->planner_cxt = CurrentMemoryContext;
|
||||
subroot->in_info_list = NIL;
|
||||
subroot->append_rel_list = NIL;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/optimizer/prep/prepunion.c,v 1.135 2007/01/05 22:19:32 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/optimizer/prep/prepunion.c,v 1.136 2007/01/20 20:45:39 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1195,10 +1195,8 @@ adjust_appendrel_attrs_mutator(Node *node, AppendRelInfo *context)
|
||||
*/
|
||||
newinfo->eval_cost.startup = -1;
|
||||
newinfo->this_selec = -1;
|
||||
newinfo->left_pathkey = NIL;
|
||||
newinfo->right_pathkey = NIL;
|
||||
newinfo->left_mergescansel = -1;
|
||||
newinfo->right_mergescansel = -1;
|
||||
newinfo->left_ec = NULL;
|
||||
newinfo->right_ec = NULL;
|
||||
newinfo->left_bucketsize = -1;
|
||||
newinfo->right_bucketsize = -1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user