mirror of
https://github.com/postgres/postgres.git
synced 2025-11-22 12:22:45 +03:00
Cache eval cost of qualification expressions in RestrictInfo nodes to
avoid repeated evaluations in cost_qual_eval(). This turns out to save a useful fraction of planning time. No change to external representation of RestrictInfo --- although that node type doesn't appear in stored rules anyway.
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.50 2000/11/12 00:37:01 tgl Exp $
|
||||
* $Id: relation.h,v 1.51 2000/12/12 23:33:32 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -373,9 +373,9 @@ typedef JoinPath NestPath;
|
||||
* A mergejoin path has these fields.
|
||||
*
|
||||
* path_mergeclauses lists the clauses (in the form of RestrictInfos)
|
||||
* that will be used in the merge. (Before 7.0, this was a list of
|
||||
* bare clause expressions, but we can save on list memory by leaving
|
||||
* it in the form of a RestrictInfo list.)
|
||||
* that will be used in the merge. (Before 7.0, this was a list of bare
|
||||
* clause expressions, but we can save on list memory and cost_qual_eval
|
||||
* work by leaving it in the form of a RestrictInfo list.)
|
||||
*
|
||||
* Note that the mergeclauses are a subset of the parent relation's
|
||||
* restriction-clause list. Any join clauses that are not mergejoinable
|
||||
@@ -491,6 +491,8 @@ typedef struct RestrictInfo
|
||||
|
||||
Expr *clause; /* the represented clause of WHERE or JOIN */
|
||||
|
||||
Cost eval_cost; /* eval cost of clause; -1 if not yet set */
|
||||
|
||||
bool ispusheddown; /* TRUE if clause was pushed down in level */
|
||||
|
||||
/* only used if clause is an OR clause: */
|
||||
|
||||
Reference in New Issue
Block a user