cql3: statement_restrictions: replace find_needs_filtering with predicate op check

In the clustering prefix construction loop, replace the
find_needs_filtering() call (which walks the merged predicate's
expression tree looking for needs-filtering binary operators) with a
check on the individual predicate vector. This uses the per-predicate
op field directly instead of searching the expression tree.
This commit is contained in:
Avi Kivity
2026-05-12 18:49:47 +03:00
parent 556262a165
commit ae7eb860a5

View File

@@ -1092,7 +1092,8 @@ statement_restrictions::statement_restrictions(private_tag,
if (found == sc_ck_preds.end()) {
break;
}
if (find_needs_filtering(found->second.filter)) {
const auto& preds = sc_ck_pred_vectors[&col];
if (std::ranges::any_of(preds, [](const predicate& p) { return p.op && needs_filtering(*p.op); })) {
break;
}
prefix.push_back(found->second);