Replace HGETALL and SMEMBERS with Scan alternatives for large keys#232
Merged
Replace HGETALL and SMEMBERS with Scan alternatives for large keys#232
Conversation
|
|
||
| const [collectionSize] = await Promise.all([ | ||
| client.customCommand([commands.sizeCmd, keyInfo.name]), | ||
| (async () => { |
Collaborator
There was a problem hiding this comment.
leave a comment explaining what this promise.all does, how come we have value-promise and a side-effect promise — it's 50+ loc to read to understand without a comment
apps/server/src/keys-browser.ts
Outdated
| if (commands.sizeCmd) { | ||
| promises.push(client.customCommand([commands.sizeCmd, keyInfo.name])) | ||
| } | ||
| promises.push(client.customCommand(commands.elementsCmd)) |
Collaborator
There was a problem hiding this comment.
I guess, you could initialize with it?
const promises = [client.customCommand(commands.elementsCmd)]
if (commands.sizeCmd) {
promises.push(client.customCommand([commands.sizeCmd, keyInfo.name]))
}
Signed-off-by: Argus Li <contactme@chunkeili.com>
Signed-off-by: Argus Li <contactme@chunkeili.com>
Signed-off-by: nassery318 <nassery318@gmail.com> Signed-off-by: Argus Li <contactme@chunkeili.com>
Signed-off-by: Argus Li <contactme@chunkeili.com>
Signed-off-by: nassery318 <nassery318@gmail.com> Signed-off-by: Argus Li <contactme@chunkeili.com>
Signed-off-by: nassery318 <nassery318@gmail.com> Signed-off-by: Argus Li <contactme@chunkeili.com>
Signed-off-by: nassery318 <nassery318@gmail.com> Signed-off-by: Argus Li <contactme@chunkeili.com>
1774936 to
7a9859e
Compare
Signed-off-by: Argus Li <43020525+ArgusLi@users.noreply.github.com>
arseny-kostenko
approved these changes
Mar 6, 2026
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.
Description
In response to #196, this pr replaces the performance inhibiting HGETALL and SMEMBERS with HSCAN and SSCAN respectively. This reduces the burden on the Valkey server and the Valkey Admin client.