diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-02-25 03:30:38 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-02-25 03:30:38 +0000 |
| commit | e549722a8b2fcc5b2ad9a9bd53948466ea5dae26 (patch) | |
| tree | a55ae57bb515b353f70a8321a0751ed5aca40044 /src/backend/optimizer/util/clauses.c | |
| parent | 7380b6384b5a0b25fa7dfa7447dbf95ff1c4b8da (diff) | |
| download | postgresql-e549722a8b2fcc5b2ad9a9bd53948466ea5dae26.tar.gz | |
Get rid of the rather fuzzily defined FlattenedSubLink node type in favor of
making pull_up_sublinks() construct a full-blown JoinExpr tree representation
of IN/EXISTS SubLinks that it is able to convert to semi or anti joins.
This makes pull_up_sublinks() a shade more complex, but the gain in semantic
clarity is worth it. I still have more to do in this area to address the
previously-discussed problems, but this commit in itself fixes at least one
bug in HEAD, as shown by added regression test case.
Diffstat (limited to 'src/backend/optimizer/util/clauses.c')
| -rw-r--r-- | src/backend/optimizer/util/clauses.c | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c index 65c9b61458..c9c7270d2b 100644 --- a/src/backend/optimizer/util/clauses.c +++ b/src/backend/optimizer/util/clauses.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.275 2009/01/09 15:46:10 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.276 2009/02/25 03:30:37 tgl Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -1300,15 +1300,6 @@ find_nonnullable_rels_walker(Node *node, bool top_level) expr->booltesttype == IS_NOT_UNKNOWN)) result = find_nonnullable_rels_walker((Node *) expr->arg, false); } - else if (IsA(node, FlattenedSubLink)) - { - /* JOIN_SEMI sublinks preserve strictness, but JOIN_ANTI ones don't */ - FlattenedSubLink *expr = (FlattenedSubLink *) node; - - if (expr->jointype == JOIN_SEMI) - result = find_nonnullable_rels_walker((Node *) expr->quals, - top_level); - } else if (IsA(node, PlaceHolderVar)) { PlaceHolderVar *phv = (PlaceHolderVar *) node; @@ -1511,15 +1502,6 @@ find_nonnullable_vars_walker(Node *node, bool top_level) expr->booltesttype == IS_NOT_UNKNOWN)) result = find_nonnullable_vars_walker((Node *) expr->arg, false); } - else if (IsA(node, FlattenedSubLink)) - { - /* JOIN_SEMI sublinks preserve strictness, but JOIN_ANTI ones don't */ - FlattenedSubLink *expr = (FlattenedSubLink *) node; - - if (expr->jointype == JOIN_SEMI) - result = find_nonnullable_vars_walker((Node *) expr->quals, - top_level); - } else if (IsA(node, PlaceHolderVar)) { PlaceHolderVar *phv = (PlaceHolderVar *) node; @@ -2943,24 +2925,6 @@ eval_const_expressions_mutator(Node *node, newbtest->booltesttype = btest->booltesttype; return (Node *) newbtest; } - if (IsA(node, FlattenedSubLink)) - { - FlattenedSubLink *fslink = (FlattenedSubLink *) node; - FlattenedSubLink *newfslink; - Expr *quals; - - /* Simplify and also canonicalize the arguments */ - quals = (Expr *) eval_const_expressions_mutator((Node *) fslink->quals, - context); - quals = canonicalize_qual(quals); - - newfslink = makeNode(FlattenedSubLink); - newfslink->jointype = fslink->jointype; - newfslink->lefthand = fslink->lefthand; - newfslink->righthand = fslink->righthand; - newfslink->quals = quals; - return (Node *) newfslink; - } if (IsA(node, PlaceHolderVar) && context->estimate) { /* |
