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

Commitaca467b

Browse files
committed
Save another little bit of planner overhead on simple queries, by having
clauselist_selectivity skip some analysis that's useless when there's onlyone clause in the given list. Actually this can win even for not-so-simplequeries, because we also apply clauselist_selectivity to sublists such as thequals matching an index; which are likely to have only a single entry evenwhen the total query is quite complicated.
1 parent7ebbc81 commitaca467b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
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.87 2007/08/31 23:35:22 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/optimizer/path/clausesel.c,v 1.88 2007/11/24 19:08:51 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -100,6 +100,14 @@ clauselist_selectivity(PlannerInfo *root,
100100
RangeQueryClause*rqlist=NULL;
101101
ListCell*l;
102102

103+
/*
104+
* If there's exactly one clause, then no use in trying to match up
105+
* pairs, so just go directly to clause_selectivity().
106+
*/
107+
if (list_length(clauses)==1)
108+
returnclause_selectivity(root, (Node*)linitial(clauses),
109+
varRelid,jointype);
110+
103111
/*
104112
* Initial scan over clauses. Anything that doesn't look like a potential
105113
* rangequery clause gets multiplied into s1 and forgotten. Anything that

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp