aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeodor Sigaev <teodor@sigaev.ru>2018-04-08 19:58:15 +0300
committerTeodor Sigaev <teodor@sigaev.ru>2018-04-08 19:58:15 +0300
commit02f3e558f21c0fbec9f94d5de9ad34f321eb0e57 (patch)
treeaca8a537e359ab834c5fa3253af1a6fd6ecd0ce5
parent34602b0a1dfd41400d376e73e41ad868ad2d3ce8 (diff)
downloadpostgresql-02f3e558f21c0fbec9f94d5de9ad34f321eb0e57.tar.gz
postgresql-02f3e558f21c0fbec9f94d5de9ad34f321eb0e57.zip
match_clause_to_index should check only key columns
Alexander Korotkov per gripe from Tom Lane noticed on valgrind-enabled buildfarm members
-rw-r--r--src/backend/optimizer/path/indxpath.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c
index cc607dcdfaa..bf42b54970c 100644
--- a/src/backend/optimizer/path/indxpath.c
+++ b/src/backend/optimizer/path/indxpath.c
@@ -2244,8 +2244,8 @@ match_clause_to_index(IndexOptInfo *index,
if (!restriction_is_securely_promotable(rinfo, index->rel))
return;
- /* OK, check each index column for a match */
- for (indexcol = 0; indexcol < index->ncolumns; indexcol++)
+ /* OK, check each index key column for a match */
+ for (indexcol = 0; indexcol < index->nkeycolumns; indexcol++)
{
if (match_clause_to_indexcol(index,
indexcol,