From 5167c588a418d0f8f6627c752cf20812a30f2d25 Mon Sep 17 00:00:00 2001 From: Dmitry Yemanov Date: Thu, 9 Jan 2025 14:59:05 +0300 Subject: [PATCH] Revert "Better (methinks) inversion choice when the OR condition includes a node which is also matched directly" This reverts commit ebcd4dde644fbf886dcf191b61eeadf72bec74dd. --- src/jrd/optimizer/Retrieval.cpp | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/src/jrd/optimizer/Retrieval.cpp b/src/jrd/optimizer/Retrieval.cpp index c1923928c1..e909182359 100644 --- a/src/jrd/optimizer/Retrieval.cpp +++ b/src/jrd/optimizer/Retrieval.cpp @@ -1496,35 +1496,19 @@ InversionCandidate* Retrieval::makeInversion(InversionCandidateList& inversions) // Look if a match is already used by previous matches. bool anyMatchAlreadyUsed = false, matchUsedByNavigation = false; - if (currentInv->boolean) + for (const auto currentMatch : currentInv->matches) { - if (matches.exist(currentInv->boolean)) + if (matches.exist(currentMatch)) { anyMatchAlreadyUsed = true; if (navigationCandidate && - navigationCandidate->matches.exist(currentInv->boolean)) + navigationCandidate->matches.exist(currentMatch)) { matchUsedByNavigation = true; } - } - } - else - { - for (const auto currentMatch : currentInv->matches) - { - if (matches.exist(currentMatch)) - { - anyMatchAlreadyUsed = true; - if (navigationCandidate && - navigationCandidate->matches.exist(currentMatch)) - { - matchUsedByNavigation = true; - } - - break; - } + break; } }