diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-09-11 14:48:55 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-09-11 14:48:55 +0000 |
commit | 6fdc44be71e7732b4a9550d04befcc9144ef188f (patch) | |
tree | 31f001c17376b228922d1424c6b70e477318e2ad /src/include | |
parent | d634a5903f615a45cb463155c04d3df904e1b91a (diff) |
Tweak querytree-dependency-extraction code so that columns of tables
that are explicitly JOINed are not considered dependencies unless they
are actually used in the query: mere presence in the joinaliasvars
list of a JOIN RTE doesn't count as being used. The patch touches
a number of files because I needed to generalize the API of
query_tree_walker to support an additional flag bit, but the changes
are otherwise quite small.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/optimizer/clauses.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/include/optimizer/clauses.h b/src/include/optimizer/clauses.h index 7c36586a34c..844e7d94902 100644 --- a/src/include/optimizer/clauses.h +++ b/src/include/optimizer/clauses.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: clauses.h,v 1.53 2002/06/20 20:29:51 momjian Exp $ + * $Id: clauses.h,v 1.54 2002/09/11 14:48:55 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -66,10 +66,15 @@ extern bool expression_tree_walker(Node *node, bool (*walker) (), void *context); extern Node *expression_tree_mutator(Node *node, Node *(*mutator) (), void *context); + +/* flags bits for query_tree_walker and query_tree_mutator */ +#define QTW_IGNORE_SUBQUERIES 0x01 /* subqueries in rtable */ +#define QTW_IGNORE_JOINALIASES 0x02 /* JOIN alias var lists */ + extern bool query_tree_walker(Query *query, bool (*walker) (), - void *context, bool visitQueryRTEs); + void *context, int flags); extern void query_tree_mutator(Query *query, Node *(*mutator) (), - void *context, bool visitQueryRTEs); + void *context, int flags); #define is_subplan(clause) ((clause) != NULL && \ IsA(clause, Expr) && \ |