mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +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:
@@ -20,7 +20,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.84 2000/12/12 23:33:33 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.85 2000/12/14 22:30:42 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -515,8 +515,9 @@ _equalRestrictInfo(RestrictInfo *a, RestrictInfo *b)
|
||||
if (!equal(a->clause, b->clause))
|
||||
return false;
|
||||
/*
|
||||
* ignore eval_cost, since it may not be set yet, and should be
|
||||
* derivable from the clause anyway
|
||||
* ignore eval_cost, left/right_pathkey, and left/right_dispersion,
|
||||
* since they may not be set yet, and should be derivable from the
|
||||
* clause anyway
|
||||
*/
|
||||
if (a->ispusheddown != b->ispusheddown)
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user