Repository navigation
Optimize full text search with multiple tokens and predicates - #98226
Conversation
|
Workflow [PR], commit [d7fc0ab] Summary: ❌
AI ReviewSummaryThis PR refactors text-index granule analysis through Missing context / blind spots
Findings
|
# Conflicts: # src/Storages/MergeTree/MergeTreeIndexText.cpp # src/Storages/MergeTree/MergeTreeIndexText.h # src/Storages/MergeTree/MergeTreeReaderTextIndex.cpp
- Fix iterator invalidation in `processTokenOperation`: copy the `queries_by_token` set before iterating, since erasing a failed query may mutate the same set when `query_token == token`. - Implement `memoryUsageBytes` for `TextIndexAnalyzer` and use it in the granule to restore proper memory accounting for cache eviction. - Validate per-column fallback expression existence in `analyzeTokensCardinality` to avoid UB in release builds when `evaluateMissingDefaults` returned null for a pattern virtual column. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Strengthen `04092_text_index_like_large_postings` and `04093_text_index_like_overflow_fallback` so they force the text-index reader path and assert a profile-event signal, instead of comparing two queries that could both silently fall back to a full scan. - 04092: force the direct read (`use_skip_indexes`, `use_skip_indexes_on_data_read`, `query_plan_direct_read_from_text_index`) and assert `TextIndexReadPostings` > 0 for the matching query, proving the multi-block posting list is actually read. The regression was that large-posting reading streams were never initialized, so the index returned no rows. - 04093: force the path, set `text_index_like_min_pattern_length` = 1 (the short `%pa%` / `%p%` needles were otherwise rejected before the dictionary scan, so the test exercised nothing), and assert `TextIndexDiscardPatternScan` > 0 for the overflowing queries. `NOT LIKE` is relabeled honestly because it never uses the text index. Addresses review comments on PR ClickHouse#98226: ClickHouse#98226 (comment) ClickHouse#98226 (comment) Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 646/708 (91.24%) | Lost baseline coverage (was covered on master, now uncovered in this PR): 26 line(s) · Uncovered code |
a242690
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Improved performance of text index analysis in multi-token searches by optimizing handling of rare tokens.
Version info
26.6.1.324