-
Notifications
You must be signed in to change notification settings - Fork 752
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
feat(query): speed up fetching redis data from dictionaries via mget. #16766
Merged
sundy-li
merged 7 commits into
databendlabs:main
from
Dragonliu2018:dragonliu/dictionary_redis_opt
Nov 22, 2024
Merged
feat(query): speed up fetching redis data from dictionaries via mget. #16766
sundy-li
merged 7 commits into
databendlabs:main
from
Dragonliu2018:dragonliu/dictionary_redis_opt
Nov 22, 2024
Conversation
This file contains 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
github-actions
bot
added
the
pr-feature
this PR introduces a new feature to the codebase
label
Nov 5, 2024
Dragonliu2018
force-pushed
the
dragonliu/dictionary_redis_opt
branch
4 times, most recently
from
November 11, 2024 15:48
c0b6010
to
c0d02dd
Compare
Dragonliu2018
force-pushed
the
dragonliu/dictionary_redis_opt
branch
6 times, most recently
from
November 20, 2024 03:37
8e46370
to
a95bc22
Compare
Dragonliu2018
changed the title
feat(query): Support access Redis data from dictionaries via the
feat(query): speed up fetching redis data from dictionaries via mget.
Nov 20, 2024
dict_get_batch
function.
Dragonliu2018
force-pushed
the
dragonliu/dictionary_redis_opt
branch
from
November 20, 2024 07:15
02e01bd
to
8cac396
Compare
11 tasks
Dragonliu2018
force-pushed
the
dragonliu/dictionary_redis_opt
branch
from
November 20, 2024 08:02
8cac396
to
bbf2370
Compare
Dragonliu2018
force-pushed
the
dragonliu/dictionary_redis_opt
branch
from
November 20, 2024 08:13
bbf2370
to
63f13fc
Compare
This PR reminds me the possibility of adding |
sundy-li
reviewed
Nov 20, 2024
src/query/service/src/pipelines/processors/transforms/transform_dictionary.rs
Outdated
Show resolved
Hide resolved
sundy-li
reviewed
Nov 20, 2024
src/query/service/src/pipelines/processors/transforms/transform_dictionary.rs
Outdated
Show resolved
Hide resolved
sundy-li
reviewed
Nov 20, 2024
src/query/service/src/pipelines/processors/transforms/transform_dictionary.rs
Show resolved
Hide resolved
b41sh
reviewed
Nov 20, 2024
src/query/service/src/pipelines/processors/transforms/transform_dictionary.rs
Outdated
Show resolved
Hide resolved
src/query/service/src/pipelines/processors/transforms/transform_dictionary.rs
Outdated
Show resolved
Hide resolved
src/query/service/src/pipelines/processors/transforms/transform_dictionary.rs
Outdated
Show resolved
Hide resolved
src/query/service/src/pipelines/processors/transforms/transform_dictionary.rs
Outdated
Show resolved
Hide resolved
src/query/service/src/pipelines/processors/transforms/transform_dictionary.rs
Outdated
Show resolved
Hide resolved
src/query/service/src/pipelines/processors/transforms/transform_dictionary.rs
Outdated
Show resolved
Hide resolved
src/query/service/src/pipelines/processors/transforms/transform_dictionary.rs
Outdated
Show resolved
Hide resolved
@Xuanwo Can OpenDAL consider adding |
Not in the near future. We can revisit this part later ❤️ |
Dragonliu2018
force-pushed
the
dragonliu/dictionary_redis_opt
branch
from
November 21, 2024 10:57
a7c02c7
to
9d83356
Compare
b41sh
approved these changes
Nov 21, 2024
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Nov 21, 2024
sundy-li
approved these changes
Nov 22, 2024
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Nov 22, 2024
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Nov 22, 2024
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
Previous Impl: For the Column type, loop through the Column and get the values from Redis one by one via OpenDAL.
Current Impl: OpenDAL only supports fetching one value at a time, so we use redis client to fetch the data in batches (via
mget
).We also try to add a cache for performance optimization. The LRU cache is used first, and the performance is shown in the table below. However, the performance is not stable. Performance is good if the required data is cached, but poor if it is not or if the cache is full. In addition, we need to handle stale data in the cache to avoid wasting memory. So the TTL cache is tried, but the performance is worse than the LRU cache. So we temporarily give up on using cache for optimization. Related code: #16882
Reproduce:
part of #16550
Tests
Type of change
This change is