diff options
author | Teodor Sigaev <teodor@sigaev.ru> | 2018-04-08 19:58:15 +0300 |
---|---|---|
committer | Teodor Sigaev <teodor@sigaev.ru> | 2018-04-08 19:58:15 +0300 |
commit | 02f3e558f21c0fbec9f94d5de9ad34f321eb0e57 (patch) | |
tree | aca8a537e359ab834c5fa3253af1a6fd6ecd0ce5 | |
parent | 34602b0a1dfd41400d376e73e41ad868ad2d3ce8 (diff) | |
download | postgresql-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.c | 4 |
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, |