1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-25 20:23:07 +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:
Tom Lane
2000-12-12 23:33:34 +00:00
parent 77c443f8cd
commit 17b843d677
7 changed files with 54 additions and 24 deletions

View File

@@ -14,7 +14,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.56 2000/11/12 00:36:59 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.57 2000/12/12 23:33:34 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -652,7 +652,7 @@ adjust_inherited_attrs_mutator(Node *node,
/*
* We have to process RestrictInfo nodes specially: we do NOT want to
* copy the original subclauseindices list, since the new rel may have
* different indices. The list will be rebuilt during planning anyway.
* different indices. The list will be rebuilt during later planning.
*/
if (IsA(node, RestrictInfo))
{
@@ -666,6 +666,7 @@ adjust_inherited_attrs_mutator(Node *node,
adjust_inherited_attrs_mutator((Node *) oldinfo->clause, context);
newinfo->subclauseindices = NIL;
newinfo->eval_cost = -1; /* reset this too */
return (Node *) newinfo;
}