mirror of
https://github.com/postgres/postgres.git
synced 2025-07-09 22:41:56 +03:00
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.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.101 2000/12/12 23:33:33 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.102 2000/12/14 22:30:42 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Most of the read functions for plan nodes are tested. (In fact, they
|
||||
@ -1848,6 +1848,11 @@ _readRestrictInfo(void)
|
||||
|
||||
/* eval_cost is not part of saved representation; compute on first use */
|
||||
local_node->eval_cost = -1;
|
||||
/* ditto for cached pathkeys and dispersion */
|
||||
local_node->left_pathkey = NIL;
|
||||
local_node->right_pathkey = NIL;
|
||||
local_node->left_dispersion = -1;
|
||||
local_node->right_dispersion = -1;
|
||||
|
||||
return local_node;
|
||||
}
|
||||
|
Reference in New Issue
Block a user