From: Teodor Sigaev Date: Sun, 8 Apr 2018 16:58:15 +0000 (+0300) Subject: match_clause_to_index should check only key columns X-Git-Url: http://git.postgresql.org/gitweb/-?a=commitdiff_plain;h=02f3e558f21c0fbec9f94d5de9ad34f321eb0e57;p=users%2Frhaas%2Fpostgres.git match_clause_to_index should check only key columns Alexander Korotkov per gripe from Tom Lane noticed on valgrind-enabled buildfarm members --- diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c index cc607dcdfa..bf42b54970 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,