mirror of
https://github.com/postgres/postgres.git
synced 2025-07-11 10:01:57 +03:00
Major optimizer improvement for joining a large number of tables.
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.63 1999/02/08 04:29:03 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.64 1999/02/09 03:51:12 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -1093,25 +1093,26 @@ CopyPathFields(Path *from, Path *newnode)
|
||||
|
||||
newnode->path_cost = from->path_cost;
|
||||
|
||||
newnode->path_order.ordtype = from->path_order.ordtype;
|
||||
if (from->path_order.ordtype == SORTOP_ORDER)
|
||||
newnode->path_order = makeNode(PathOrder);
|
||||
newnode->path_order->ordtype = from->path_order->ordtype;
|
||||
if (from->path_order->ordtype == SORTOP_ORDER)
|
||||
{
|
||||
int len,
|
||||
i;
|
||||
Oid *ordering = from->path_order.ord.sortop;
|
||||
Oid *ordering = from->path_order->ord.sortop;
|
||||
|
||||
if (ordering)
|
||||
{
|
||||
for (len = 0; ordering[len] != 0; len++)
|
||||
;
|
||||
newnode->path_order.ord.sortop = (Oid *) palloc(sizeof(Oid) * (len + 1));
|
||||
newnode->path_order->ord.sortop = (Oid *) palloc(sizeof(Oid) * (len + 1));
|
||||
for (i = 0; i < len; i++)
|
||||
newnode->path_order.ord.sortop[i] = ordering[i];
|
||||
newnode->path_order.ord.sortop[len] = 0;
|
||||
newnode->path_order->ord.sortop[i] = ordering[i];
|
||||
newnode->path_order->ord.sortop[len] = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
Node_Copy(from, newnode, path_order.ord.merge);
|
||||
Node_Copy(from, newnode, path_order->ord.merge);
|
||||
|
||||
Node_Copy(from, newnode, keys);
|
||||
|
||||
|
Reference in New Issue
Block a user