mirror of
https://github.com/postgres/postgres.git
synced 2025-11-22 12:22:45 +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:
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: relation.h,v 1.51 2000/12/12 23:33:32 tgl Exp $
|
||||
* $Id: relation.h,v 1.52 2000/12/14 22:30:44 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -504,8 +504,16 @@ typedef struct RestrictInfo
|
||||
Oid left_sortop; /* leftside sortop needed for mergejoin */
|
||||
Oid right_sortop; /* rightside sortop needed for mergejoin */
|
||||
|
||||
/* cache space for mergeclause processing; NIL if not yet set */
|
||||
List *left_pathkey; /* canonical pathkey for left side */
|
||||
List *right_pathkey; /* canonical pathkey for right side */
|
||||
|
||||
/* valid if clause is hashjoinable, else InvalidOid: */
|
||||
Oid hashjoinoperator; /* copy of clause operator */
|
||||
|
||||
/* cache space for hashclause processing; -1 if not yet set */
|
||||
Selectivity left_dispersion; /* dispersion of left side */
|
||||
Selectivity right_dispersion; /* dispersion of right side */
|
||||
} RestrictInfo;
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user