diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-01-09 20:50:53 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-01-09 20:50:53 +0000 |
commit | 6bc61fc046961cfc2b3901ab38ac74b45f8c6cd3 (patch) | |
tree | a29a0825d52ba55e9971b8df6c4a530cc90a5bff /src/backend/optimizer/plan/subselect.c | |
parent | 59779c81ba9e6ea29cec1a59d0cfdbe76fa016ff (diff) | |
download | postgresql-6bc61fc046961cfc2b3901ab38ac74b45f8c6cd3.tar.gz postgresql-6bc61fc046961cfc2b3901ab38ac74b45f8c6cd3.zip |
Adjust parser so that 'x NOT IN (subselect)' is converted to
'NOT (x IN (subselect))', that is 'NOT (x = ANY (subselect))',
rather than 'x <> ALL (subselect)' as we formerly did. This
opens the door to optimizing NOT IN the same way as IN, whereas
there's no hope of optimizing the expression using <>. Also,
convert 'x <> ALL (subselect)' to the NOT(IN) style, so that
the optimization will be available when processing rules dumped
by older Postgres versions.
initdb forced due to small change in SubLink node representation.
Diffstat (limited to 'src/backend/optimizer/plan/subselect.c')
-rw-r--r-- | src/backend/optimizer/plan/subselect.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/optimizer/plan/subselect.c b/src/backend/optimizer/plan/subselect.c index 840ba975a34..f8086d9ab6e 100644 --- a/src/backend/optimizer/plan/subselect.c +++ b/src/backend/optimizer/plan/subselect.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/subselect.c,v 1.61 2002/12/14 00:17:55 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/subselect.c,v 1.62 2003/01/09 20:50:51 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -225,7 +225,7 @@ make_subplan(SubLink *slink, List *lefthand) * Fill in other fields of the SubPlan node. */ node->subLinkType = slink->subLinkType; - node->useor = slink->useor; + node->useOr = slink->useOr; node->oper = NIL; node->setParam = NIL; node->parParam = NIL; @@ -283,7 +283,7 @@ make_subplan(SubLink *slink, List *lefthand) &node->setParam); PlannerInitPlan = lappend(PlannerInitPlan, node); if (length(oper) > 1) - result = (Node *) (node->useor ? make_orclause(oper) : + result = (Node *) (node->useOr ? make_orclause(oper) : make_andclause(oper)); else result = (Node *) lfirst(oper); |