mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
Teach the system how to use hashing for UNION. (INTERSECT/EXCEPT will follow,
but seem like a separate patch since most of the remaining work is on the executor side.) I took the opportunity to push selection of the grouping operators for set operations into the parser where it belongs. Otherwise this is just a small exercise in making prepunion.c consider both alternatives. As with the recent DISTINCT patch, this means we can UNION on datatypes that can hash but not sort, and it means that UNION without ORDER BY is no longer certain to produce sorted output.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.260 2008/08/02 21:32:00 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.261 2008/08/07 01:11:50 tgl Exp $
|
||||
*
|
||||
* HISTORY
|
||||
* AUTHOR DATE MAJOR EVENT
|
||||
@@ -3933,6 +3933,8 @@ expression_tree_walker(Node *node,
|
||||
return true;
|
||||
if (walker(setop->rarg, context))
|
||||
return true;
|
||||
|
||||
/* groupClauses are deemed uninteresting */
|
||||
}
|
||||
break;
|
||||
case T_InClauseInfo:
|
||||
@@ -4535,6 +4537,7 @@ expression_tree_mutator(Node *node,
|
||||
FLATCOPY(newnode, setop, SetOperationStmt);
|
||||
MUTATE(newnode->larg, setop->larg, Node *);
|
||||
MUTATE(newnode->rarg, setop->rarg, Node *);
|
||||
/* We do not mutate groupClauses by default */
|
||||
return (Node *) newnode;
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user