Extend CTE patch to support recursive UNION (ie, without ALL). The
Tom Lane <tgl@sss.pgh.pa.us>
Extend CTE patch to support recursive UNION (ie, without ALL). The implementation uses an in-memory hash table, so it will poop out for very large recursive results ... but the performance characteristics of a sort-based implementation would be pretty unpleasant too.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/queries.sgml | modified | +20 −13 |
| doc/src/sgml/ref/select.sgml | modified | +4 −4 |
| src/backend/executor/nodeRecursiveunion.c | modified | +150 −24 |
| src/backend/nodes/copyfuncs.c | modified | +8 −1 |
| src/backend/nodes/outfuncs.c | modified | +14 −1 |
| src/backend/optimizer/plan/createplan.c | modified | +36 −2 |
| src/backend/optimizer/prep/prepunion.c | modified | +40 −5 |
| src/backend/parser/parse_cte.c | modified | +5 −5 |
| src/include/nodes/execnodes.h | modified | +7 −1 |
| src/include/nodes/plannodes.h | modified | +7 −1 |
| src/include/optimizer/planmain.h | modified | +3 −2 |
| src/test/regress/expected/with.out | modified | +37 −11 |
| src/test/regress/sql/with.sql | modified | +14 −4 |