summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-09-23 23:50:47 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-09-23 23:50:47 +0000
commit730e2ffebc98977366ec717a0f89345425e02eb1 (patch)
tree7ac97764d3e565d7e9a67969d1e742dde6c8856f /src/include
parent783af51cb1fc27218bec7137c7a138eefb1d76e4 (diff)
Back-patch code to deduce implied equalities from transitivity of
mergejoin clauses, and add these equalities to the given WHERE clauses. This is necessary to ensure that sort keys we think are equivalent really are equivalent as soon as their rels have been joined. Without this, 7.0 may create an incorrect mergejoin plan.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/optimizer/paths.h3
-rw-r--r--src/include/optimizer/planmain.h4
2 files changed, 5 insertions, 2 deletions
diff --git a/src/include/optimizer/paths.h b/src/include/optimizer/paths.h
index 0a2f56db63a..0c45fc897f1 100644
--- a/src/include/optimizer/paths.h
+++ b/src/include/optimizer/paths.h
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: paths.h,v 1.44 2000/04/12 17:16:42 momjian Exp $
+ * $Id: paths.h,v 1.44.2.1 2000/09/23 23:50:46 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -90,6 +90,7 @@ typedef enum
} PathKeysComparison;
extern void add_equijoined_keys(Query *root, RestrictInfo *restrictinfo);
+extern void generate_implied_equalities(Query *root);
extern List *canonicalize_pathkeys(Query *root, List *pathkeys);
extern PathKeysComparison compare_pathkeys(List *keys1, List *keys2);
extern bool pathkeys_contained_in(List *keys1, List *keys2);
diff --git a/src/include/optimizer/planmain.h b/src/include/optimizer/planmain.h
index e0a0d84bc8a..12e9d119578 100644
--- a/src/include/optimizer/planmain.h
+++ b/src/include/optimizer/planmain.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: planmain.h,v 1.39 2000/04/12 17:16:42 momjian Exp $
+ * $Id: planmain.h,v 1.39.2.1 2000/09/23 23:50:46 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -43,6 +43,8 @@ extern Result *make_result(List *tlist, Node *resconstantqual, Plan *subplan);
extern void make_var_only_tlist(Query *root, List *tlist);
extern void add_restrict_and_join_to_rels(Query *root, List *clauses);
extern void add_missing_rels_to_query(Query *root);
+extern void process_implied_equality(Query *root, Node *item1, Node *item2,
+ Oid sortop1, Oid sortop2);
/*
* prototypes for plan/setrefs.c