[improvement](match) add SIMD-accelerated TokenSearcher fast path for match_any/match_all#60874
Open
airborne12 wants to merge 1 commit intoapache:masterfrom
Open
[improvement](match) add SIMD-accelerated TokenSearcher fast path for match_any/match_all#60874airborne12 wants to merge 1 commit intoapache:masterfrom
airborne12 wants to merge 1 commit intoapache:masterfrom
Conversation
… match_any/match_all Add a fast path for match_any and match_all functions that bypasses per-row Lucene tokenization by using SIMD-accelerated TokenSearcher (ported from ClickHouse's hasToken pattern). This significantly improves performance for no-index match queries on PARSER_STANDARD columns. The fast path uses SSE4.1 SIMD instructions for substring search combined with token boundary verification (non-alphanumeric ASCII characters are separators). It activates only when: - analyzer_ctx is present with PARSER_STANDARD - no array offsets (non-array columns) - no char_filter_map transformations - all query tokens are single terms Case-insensitive search is supported via dual-pattern SIMD matching when the index has lower_case=true.
Member
Author
|
run buildall |
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
TPC-H: Total hot run time: 28730 ms |
TPC-DS: Total hot run time: 183935 ms |
Contributor
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Problem Summary:
When
enable_match_without_inverted_index=true,match_anyandmatch_allfunctions fall back to per-row Lucene tokenization which is expensive. This PR adds a SIMD-accelerated fast path using TokenSearcher (ported from ClickHouse'shasTokenpattern) that eliminates per-row tokenization overhead for PARSER_STANDARD columns.The fast path uses SSE4.1 SIMD instructions for substring search combined with token boundary verification. It activates only for PARSER_STANDARD with no char_filter_map and single-term query tokens, falling back to the original Lucene path otherwise.
Key changes:
is_lowercasefield toInvertedIndexAnalyzerCtxfor case-sensitivity dispatchcan_use_token_searchguard with strict conditions (PARSER_STANDARD only, no char_filter_map, no array offsets)match_any(OR semantics) andmatch_all(AND semantics)Release note
Improve match_any/match_all performance for no-index queries on PARSER_STANDARD columns using SIMD-accelerated token search.
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)