Repository navigation
Text index: fix read mode of LIKE/ILIKE with an index built on a container - #114544
Conversation
…ainer Evaluating `LIKE`/`ILIKE` by scanning the text index dictionary always used an exact direct read, which removes the original condition from the query plan. That is only valid when a matching dictionary token proves the predicate, which is not the case when the index is built on a container while the predicate reads a single element out of it: with an index on `mapValues(m)`, `m['a'] LIKE '%foobar%'` also returned rows whose match is under another key. However, it may produce correct result due to the data, but it's not guaranteed. To ensure for producing correct results, we need to use `HINT` mode when a text index built on a container (Map or JSON). It is better to be safe than sorry.
|
Workflow [PR], commit [c1e6b38] Summary: ✅
AI ReviewSummaryThis PR changes Final Verdict✅ No actionable findings. LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 29/32 (90.62%) · Uncovered code |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Compile time of recompiled translation units263 translation units recompiled, 3257 s compile time in total, 263 of them have a recent master baseline. |
…h an index built on a container
…/ILIKE with an index built on a container
Evaluating
LIKE/ILIKEby scanning the text index dictionary always used an exact direct read, which removes the original condition from the query plan. That is only valid when a matching dictionary token proves the predicate, which is not the case when the index is built on a container while the predicate reads a single element out of it: with an index onmapValues(m),m['a'] LIKE '%foobar%'also returned rows whose match is under another key. However, it may produce correct result due to the data, but it's not guaranteed.To ensure for producing correct results, we need to use
HINTmode when a text index built on a container (Map or JSON).It is better to be safe than sorry.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix text index evaluation of
LIKE/ILIKEoperator built on Map or JSON containers.Version info
26.8.1.1313(included in26.8and later)