-
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
Conversation
ba2213e
to
8aabb9e
Compare
tests/sqllogictests/suites/ee/04_ee_inverted_index/04_0000_inverted_index_base.test
Outdated
Show resolved
Hide resolved
8aabb9e
to
c88200b
Compare
tests/sqllogictests/suites/base/09_fuse_engine/09_0006_func_fuse_history.test
Outdated
Show resolved
Hide resolved
c88200b
to
69d798f
Compare
28f2ae4
to
af65547
Compare
Signed-off-by: Kould <[email protected]>
Signed-off-by: Kould <[email protected]>
Signed-off-by: Kould <[email protected]>
Signed-off-by: Kould <[email protected]>
Signed-off-by: Kould <[email protected]>
af65547
to
67e6f07
Compare
Signed-off-by: Kould <[email protected]>
ef734e0
to
762d575
Compare
Updated to Readme |
Signed-off-by: Kould <[email protected]>
762d575
to
ef24126
Compare
Signed-off-by: Kould <[email protected]>
Signed-off-by: Kould <[email protected]>
6c72b5c
to
88f3cd4
Compare
Signed-off-by: Kould <[email protected]>
88f3cd4
to
9d37617
Compare
Signed-off-by: Kould <[email protected]>
src/query/storages/common/index/src/filters/xor8/bloom_filter.rs
Outdated
Show resolved
Hide resolved
b806534
to
1d304e8
Compare
Signed-off-by: Kould <[email protected]>
1d304e8
to
07623b4
Compare
…byte Signed-off-by: Kould <[email protected]>
LGTM. One concern to consider for future optimization work:
|
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