-
Notifications
You must be signed in to change notification settings - Fork 770
feat: impl NgramIndex
for FuseTable
, improve like query performance
#17852
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
KKould
wants to merge
13
commits into
databendlabs:main
Choose a base branch
from
KKould:feat/ngram_index
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,742
−316
Conversation
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
ba2213e
to
8aabb9e
Compare
KKould
commented
Apr 25, 2025
tests/sqllogictests/suites/ee/04_ee_inverted_index/04_0000_inverted_index_base.test
Outdated
Show resolved
Hide resolved
8aabb9e
to
c88200b
Compare
KKould
commented
Apr 25, 2025
tests/sqllogictests/suites/base/09_fuse_engine/09_0006_func_fuse_history.test
Outdated
Show resolved
Hide resolved
c88200b
to
69d798f
Compare
b41sh
reviewed
Apr 25, 2025
28f2ae4
to
af65547
Compare
Signed-off-by: Kould <kould2333@gmail.com>
Signed-off-by: Kould <kould2333@gmail.com>
Signed-off-by: Kould <kould2333@gmail.com>
Signed-off-by: Kould <kould2333@gmail.com>
Signed-off-by: Kould <kould2333@gmail.com>
af65547
to
67e6f07
Compare
sundy-li
reviewed
Apr 27, 2025
sundy-li
reviewed
Apr 27, 2025
Signed-off-by: Kould <kould2333@gmail.com>
ef734e0
to
762d575
Compare
Updated to Readme |
Signed-off-by: Kould <kould2333@gmail.com>
762d575
to
ef24126
Compare
Signed-off-by: Kould <kould2333@gmail.com>
b41sh
reviewed
Apr 29, 2025
Signed-off-by: Kould <kould2333@gmail.com>
6c72b5c
to
88f3cd4
Compare
Signed-off-by: Kould <kould2333@gmail.com>
88f3cd4
to
9d37617
Compare
Signed-off-by: Kould <kould2333@gmail.com>
b41sh
reviewed
Apr 30, 2025
src/query/storages/common/index/src/filters/xor8/bloom_filter.rs
Outdated
Show resolved
Hide resolved
b806534
to
1d304e8
Compare
Signed-off-by: Kould <kould2333@gmail.com>
1d304e8
to
07623b4
Compare
sundy-li
reviewed
Apr 30, 2025
…byte Signed-off-by: Kould <kould2333@gmail.com>
sundy-li
approved these changes
Apr 30, 2025
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.
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
part of: #17724
Implement Ngram Index to improve the retrieval speed of Like query
Its working principle is to insert String type data into multiple substrings in the form of ngram and insert them into BloomFilter. When querying Like, it determines whether there is a substring after ngram that does not exist in BloomFilter to filter out the Block that must not have data in Like in advance.
Therefore, when using Ngram Index, the insertion time will be longer due to ngram (depending on the length of each line of string and the total number of data lines).
Storage
Ngram Index is essentially a data segmentation method based on Bloom Index using Ngram. Therefore, Ngram Index shares Meta with Bloom Index and uses the same storage file.
Benchmark
Using amazon_reviews as the benchmark, the total data size is 39.2 GB, and review_body is 17 GB
Using this SQL to test Ngram, the total file size of BloomFilter is 1.5 GB
Query:
Ngram:
Without Ngram:
Insert:
Ngram:
Without Ngram:
Tips: The factors that affect the insertion time are as follows:
Therefore, this benchmark is the parameter I chose for query purposes. In actual applications, users need to weigh the insertion speed and filtering effect.
Tests
Type of change
This change is