Teach the system how to use hashing for UNION. (INTERSECT/EXCEPT will follow,
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 7 Aug 2008 01:11:52 +0000 (01:11 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 7 Aug 2008 01:11:52 +0000 (01:11 +0000)
commitdcac1c8d2d391e31aedf7d000c84dfe5e88b4e63
tree8b69c5a1baa2e474f3ff0a9395512c6e03724d95
parent808c935bf2a92a6363c31f3d0f2a8e5a00ac41d8
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.
20 files changed:
src/backend/catalog/dependency.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/backend/nodes/outfuncs.c
src/backend/nodes/readfuncs.c
src/backend/optimizer/plan/planner.c
src/backend/optimizer/prep/prepunion.c
src/backend/optimizer/util/clauses.c
src/backend/optimizer/util/pathnode.c
src/backend/optimizer/util/tlist.c
src/backend/parser/analyze.c
src/backend/parser/parse_clause.c
src/include/catalog/catversion.h
src/include/nodes/parsenodes.h
src/include/optimizer/tlist.h
src/include/parser/parse_clause.h
src/test/regress/expected/copyselect.out
src/test/regress/expected/union.out
src/test/regress/sql/copyselect.sql
src/test/regress/sql/union.sql