Repository navigation
Text index: add cursor support for the phrase search - #118885
Conversation
|
Workflow [PR], commit [e655413] Summary: ✅
AI ReviewSummaryThe PR streams Missing context / blind spots
Final VerdictStatus: ✅ Approve. No new inline findings or thread changes are needed. |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes8 object files changed (+76.27 KiB total), 1 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 units30 translation units recompiled, 278 s compile time in total, 29 of them have a recent master baseline. Median compile-time ratio to the baselines is ×0.94 (machine-speed difference or a change affecting every TU); per-TU deltas below are relative to that ratio. Translation units without a recent master baseline:
Symbol sizes
|
81a6034 to
f44bb9f
Compare
Add rank cursors for postings and positions.
ad6aeb0 to
a91fdc8
Compare
59a9282 to
59aa411
Compare
| M(TextIndexPhraseSearches, "Number of phrase searches executed over a text index, one per reader of a granule. Readers served entirely from the cache are not counted.", ValueType::Number) \ | ||
| M(TextIndexPhraseCursorSearches, "Number of phrase searches that found their candidate rows with posting list cursors instead of intersecting bitmaps.", ValueType::Number) \ |
There was a problem hiding this comment.
It looks like 2 profile events are redundant now. We can keep only TextIndexPhraseSearches.
…-intersect-per-container Master builds `range_posting` lazily in `buildPostingsForMark` and skips columns answered by the analyzer's folded postings (ClickHouse#122896); the per-container path only runs when postings must still be read, so it is disjoint from the folded one. `setIndexGranule` keeps only the reset of `intersection_steps`: master moved the per-granule phrase results into `phrase_streams` (ClickHouse#118885) and dropped `blocked_positions_scratch`. Co-Authored-By: Claude Opus 5.5 <[email protected]>

Previously, phrase search used to find candidate rows by reading every token's whole posting list and intersecting them as bitmaps. For a phrase with one rare token, that meant decoding the frequent tokens' whole lists to find a few rows.
This PR adds a
leapfrogover posting list cursors: the rarest token drives the walk, the others seek to it and skip whole blocks, and each candidate comes out with its rank in every list, which addresses its positions directly.No layout change. In follow-up PRs, I'll try to improve by changing the layout (e.g. suggestion).
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Improve phrase search performance when one of the phrase's terms is rare, because it skips the parts of the frequent terms' posting lists that cannot match.
Workflow [PR]
Sync PR [sync-upstream/pr/118885]
Version info
26.11.1.498-master(included in26.11and later)