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
Add SETNE #4258
base: unstable
Are you sure you want to change the base?
Add SETNE #4258
Conversation
what's the progress of this PR? |
Any update regarding this PR? |
+1 Really want this. |
Hi, I quickly wrote an implementation of this command as a module. If you don't know / care about Zig, just download a pre-compiled dynamic library from the Releases section. |
What is the status of this PR? Thanks in advance. |
I could rebase it on master if there was a chance of it being merged. Buf after more thant 2 years I doubt it will be. |
The pros here are mostly performance related since there's an easy solution using scripting. |
I think if this is added, instead of a new string command, I don't think we should add a new flag though. If a |
Another interesting case that comes to mind is client side caching, it would be an optimization to not invalidate a key if the value didn't change. Idk though, LUA seems like the right approach here to me, this seems close to CAS which we've also been hesitant to implement. I suppose I would vote to close this, but don't feel strongly. |
The problem with treating this as just a
@madolson I'm marking to be closed, as I think this can be treated as a special case of |
Wouldn't that be even slower than just adding a new command that does that all by itself? |
|
Add command to only set a value when it's different than the current value. This is useful when listening for changes and you don't want to be notified when a value doesn't change.
This native command is about 3 times faster than using a lua script and is only a few new lines.
See: https://www.reddit.com/r/redis/comments/6vry8x/proposed_new_command_setne_set_if_not_equal/