mirror of
https://github.com/postgres/postgres.git
synced 2025-08-31 17:02:12 +03:00
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.
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.407 2008/10/06 17:39:25 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.408 2008/10/07 19:27:04 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -193,6 +193,13 @@ _copyRecursiveUnion(RecursiveUnion *from)
|
||||
* copy remainder of node
|
||||
*/
|
||||
COPY_SCALAR_FIELD(wtParam);
|
||||
COPY_SCALAR_FIELD(numCols);
|
||||
if (from->numCols > 0)
|
||||
{
|
||||
COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
|
||||
COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
|
||||
}
|
||||
COPY_SCALAR_FIELD(numGroups);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
Reference in New Issue
Block a user