Repository navigation
Answer m['key'] IN (...) from a keyValuePairs text index - #120010
Conversation
|
Workflow [PR], commit [9fec73c] Summary: ✅
AI ReviewSummaryThis PR teaches the Findings
Final VerdictNeeds one more fix before merge: the local LLVM Coverage ReportMeasured on commit 9fec73c.
Changed lines: Changed C/C++ lines covered: 49/53 (92.45%) · Uncovered code |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes28 object files changed (+66.96 KiB total), 0 added.
719 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units31 translation units recompiled, 310 s compile time in total, 31 of them have a recent master baseline. |
| /// The generic path below tokenizes elements as strings, which never yields a pair token. | ||
| if (tokenizer->getType() == ITokenizer::Type::KeyValuePairs) | ||
| return traverseMapElementKeyValueSetNode(lhs, rhs, function_name, out); |
There was a problem hiding this comment.
It would be nice to support that optimization for the array tokenizer as well. Maybe in a follow-up PR.
Related: #115579
Follow-up to #115579
INon a map element is the same lookuprepeated: every value of the list becomes one
(key, value)token, and the unionof their posting lists is exactly the set of matching rows, so the predicate is
answered by the index alone (exact direct read) instead of by a brute-force scan.
An
ORchain ofequalsbenefits too, since the analyzer folds it intoIN.Implemented as a hard partition in
tryPrepareSetForTextSearch, so the genericper-element path — which tokenizes set elements as strings and cannot produce a
pair token — is unreachable for this tokenizer.
These cases keep the predicate and fall back to a scan, because a token union
cannot answer them or the tokens would not match what execution compares:
m['key'] = ''also holds for rows thatlack the key and therefore have no token;
(m['key'], id) IN (('error', 1));FixedStringelement, whose zero paddingINcompares as part of the value;NOT INandnullIn(the form produced withtransform_null_in = 1), as forevery other tokenizer.
A set from a subquery still skips granules, but gets no direct read: a non-literal
set has no AST representation for the default expression of a part where the index
is not materialized.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
A text index with the
keyValuePairstokenizer now answersmap['key'] IN ('value1', 'value2')directly from the index, as it already did formap['key'] = 'value'. AnINlist containing the empty string, a tuple left-hand side or aFixedStringelement still falls back to a brute-force scan.Workflow [PR]
Sync PR [sync-upstream/pr/120010]
Version info
26.10.1.2101-master(included in26.10and later)