diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-01-24 03:58:44 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-01-24 03:58:44 +0000 |
commit | f5e83662d06a40f90ceb3516fc88674eb6c1e4f9 (patch) | |
tree | 5b682c9bcbc9dd88b7bcc19f1ca1bf43c8335a83 /src/include/optimizer/planmain.h | |
parent | ef7422510e93266e5aa9bb926d6747d5f2ae21f4 (diff) |
Modify planner's implied-equality-deduction code so that when a set
of known-equal expressions includes any constant expressions (including
Params from outer queries), we actively suppress any 'var = var'
clauses that are or could be deduced from the set, generating only the
deducible 'var = const' clauses instead. The idea here is to push down
the restrictions implied by the equality set to base relations whenever
possible. Once we have applied the 'var = const' clauses, the 'var = var'
clauses are redundant, and should be suppressed both to save work at
execution and to avoid double-counting restrictivity.
Diffstat (limited to 'src/include/optimizer/planmain.h')
-rw-r--r-- | src/include/optimizer/planmain.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/include/optimizer/planmain.h b/src/include/optimizer/planmain.h index cf9c2ddeb64..399b3bb1310 100644 --- a/src/include/optimizer/planmain.h +++ b/src/include/optimizer/planmain.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: planmain.h,v 1.67 2003/01/20 18:55:05 tgl Exp $ + * $Id: planmain.h,v 1.68 2003/01/24 03:58:44 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -57,9 +57,11 @@ extern Result *make_result(List *tlist, Node *resconstantqual, Plan *subplan); extern void add_base_rels_to_query(Query *root, Node *jtnode); extern void build_base_rel_tlists(Query *root, List *tlist); extern Relids distribute_quals_to_rels(Query *root, Node *jtnode); -extern void process_implied_equality(Query *root, Node *item1, Node *item2, - Oid sortop1, Oid sortop2); -extern bool exprs_known_equal(Query *root, Node *item1, Node *item2); +extern void process_implied_equality(Query *root, + Node *item1, Node *item2, + Oid sortop1, Oid sortop2, + Relids item1_relids, Relids item2_relids, + bool delete_it); /* * prototypes for plan/setrefs.c |