1
0
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:
Bruce Momjian
1999-02-09 03:51:42 +00:00
parent be948af2e8
commit fe35ffe7e0
21 changed files with 277 additions and 139 deletions

View File

@ -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);