Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit07e6f93

Browse files
committed
Fix oversight in 8.0 modification of RestrictInfo data structures.
A RestrictInfo representing an OR clause now contains two versions ofthe contained expression, one with sub-RestrictInfos and one without.clause_selectivity() should descend to the version with sub-RestrictInfosso that it has a chance of caching its results for the OR's sub-clauses.Failing to do so resulted in redundant planner effort.
1 parentc6b9924 commit07e6f93

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

‎src/backend/optimizer/path/clausesel.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/optimizer/path/clausesel.c,v 1.73 2005/06/05 22:32:55 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/optimizer/path/clausesel.c,v 1.74 2005/10/11 16:44:40 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -461,8 +461,15 @@ clause_selectivity(PlannerInfo *root,
461461
}
462462
}
463463

464-
/* Proceed with examination of contained clause */
465-
clause= (Node*)rinfo->clause;
464+
/*
465+
* Proceed with examination of contained clause. If the clause is an
466+
* OR-clause, we want to look at the variant with sub-RestrictInfos,
467+
* so that per-subclause selectivities can be cached.
468+
*/
469+
if (rinfo->orclause)
470+
clause= (Node*)rinfo->orclause;
471+
else
472+
clause= (Node*)rinfo->clause;
466473
}
467474

468475
if (IsA(clause,Var))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp