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/nodes/equalfuncs.c | |
parent | 59779c81ba9e6ea29cec1a59d0cfdbe76fa016ff (diff) |
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/nodes/equalfuncs.c')
-rw-r--r-- | src/backend/nodes/equalfuncs.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c index 5fc333df3de..affa7f48a88 100644 --- a/src/backend/nodes/equalfuncs.c +++ b/src/backend/nodes/equalfuncs.c @@ -18,7 +18,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.177 2002/12/14 00:17:51 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.178 2003/01/09 20:50:50 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -287,7 +287,8 @@ static bool _equalSubLink(SubLink *a, SubLink *b) { COMPARE_SCALAR_FIELD(subLinkType); - COMPARE_SCALAR_FIELD(useor); + COMPARE_SCALAR_FIELD(operIsEquals); + COMPARE_SCALAR_FIELD(useOr); COMPARE_NODE_FIELD(lefthand); COMPARE_NODE_FIELD(oper); COMPARE_NODE_FIELD(subselect); @@ -299,7 +300,7 @@ static bool _equalSubPlan(SubPlan *a, SubPlan *b) { COMPARE_SCALAR_FIELD(subLinkType); - COMPARE_SCALAR_FIELD(useor); + COMPARE_SCALAR_FIELD(useOr); COMPARE_NODE_FIELD(oper); /* should compare plans, but have to settle for comparing plan IDs */ COMPARE_SCALAR_FIELD(plan_id); |