diff --git a/src/jrd/optimizer/Retrieval.cpp b/src/jrd/optimizer/Retrieval.cpp index 7a4f0d5f56..10fde4d413 100644 --- a/src/jrd/optimizer/Retrieval.cpp +++ b/src/jrd/optimizer/Retrieval.cpp @@ -2264,7 +2264,10 @@ InversionCandidate* Retrieval::matchOnIndexes(IndexScratchList& inputIndexScratc matches.add(match); for (const auto match : invCandidate2->matches) - matches.add(match); + { + if (matches.exist(match)) + invCandidate->matches.add(match); + } } return invCandidate;