From ea166f11462c863d91378fcbb15d4d3140002413 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 14 Dec 2000 22:30:45 +0000 Subject: Planner speedup hacking. Avoid saving useless pathkeys, so that path comparison does not consider paths different when they differ only in uninteresting aspects of sort order. (We had a special case of this consideration for indexscans already, but generalize it to apply to ordered join paths too.) Be stricter about what is a canonical pathkey to allow faster pathkey comparison. Cache canonical pathkeys and dispersion stats for left and right sides of a RestrictInfo's clause, to avoid repeated computation. Total speedup will depend on number of tables in a query, but I see about 4x speedup of planning phase for a sample seven-table query. --- src/backend/nodes/copyfuncs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/backend/nodes/copyfuncs.c') diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c index 3e4a6d91dd1..62ce708f0bb 100644 --- a/src/backend/nodes/copyfuncs.c +++ b/src/backend/nodes/copyfuncs.c @@ -15,7 +15,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.134 2000/12/12 23:33:32 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.135 2000/12/14 22:30:42 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1424,7 +1424,12 @@ _copyRestrictInfo(RestrictInfo *from) newnode->mergejoinoperator = from->mergejoinoperator; newnode->left_sortop = from->left_sortop; newnode->right_sortop = from->right_sortop; + /* Do not copy pathkeys, since they'd not be canonical in a copied query */ + newnode->left_pathkey = NIL; + newnode->right_pathkey = NIL; newnode->hashjoinoperator = from->hashjoinoperator; + newnode->left_dispersion = from->left_dispersion; + newnode->right_dispersion = from->right_dispersion; return newnode; } -- cgit v1.2.3