1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-08 11:42:09 +03:00

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.
This commit is contained in:
Tom Lane
2003-01-09 20:50:53 +00:00
parent 59779c81ba
commit 6bc61fc046
11 changed files with 111 additions and 56 deletions

View File

@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.233 2002/12/14 00:17:50 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.234 2003/01/09 20:50:50 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -809,7 +809,8 @@ _copySubLink(SubLink *from)
SubLink *newnode = makeNode(SubLink);
COPY_SCALAR_FIELD(subLinkType);
COPY_SCALAR_FIELD(useor);
COPY_SCALAR_FIELD(operIsEquals);
COPY_SCALAR_FIELD(useOr);
COPY_NODE_FIELD(lefthand);
COPY_NODE_FIELD(oper);
COPY_NODE_FIELD(subselect);
@ -826,7 +827,7 @@ _copySubPlan(SubPlan *from)
SubPlan *newnode = makeNode(SubPlan);
COPY_SCALAR_FIELD(subLinkType);
COPY_SCALAR_FIELD(useor);
COPY_SCALAR_FIELD(useOr);
COPY_NODE_FIELD(oper);
COPY_NODE_FIELD(plan);
COPY_SCALAR_FIELD(plan_id);