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
zdiffstore #446
Comments
How about using zinterstore? zunionstore - zinterstore = list that you want I think that implement server side in a similar way. |
Sure, it's similar! But it is slow than zdiffstore! zdiffstore: 1 command I use zrange & zrem to solve this problem, but it is very slow |
Just noticed this. I implemented it in #448 |
I have the same problems. When user A unfollows user B, or user B deletes, all there post have to be deleted from user A feed |
Would love to see this functionality merged in. I have the same situation (updating elements in a feed, and need a quick way to sync to an in-memory copy. I only use the sortedSet to keep the entries in-order. The scores are immutable. |
too bad we still have this inconsistency between normal and ordered sets... |
I agree that zdiffstore would be a valuable tool. In my case it would reduce memory usage by 50%. |
We have been using zdiffstore for years, but it's becoming a pain to patch and maintain every release our selves so perhaps I'm missing something why zdiffstore is not getting added. Our use case is a photo popular suggestion subsection of our site. A per user set of daily viewed photos is maintained. We want to show to any users a set of popular/good photos that they have not seen yet. The idea is the most popular photos seen by a users friends, but NOT seen by the users would make a good suggestions.
This very quickly gives as a popular sorted set of photos that were seen by my friends but have not been seen by my. This seems like a really nice and efficient way to solve this problem. It's fast enough to be realtime and has been running production for years. Am I missing something how this can be done without zdiffstore in an efficient way? |
Also in need of this... |
Tagging @yossigo @natoscott so they get notified. |
I'm currently working on getting a pull request ready for this. I took @parrish 's PR as reference to reimplement this in the current codebase, should be ready soon. But I have a couple questions for now (later we can move the discussion to the PR):
|
@felipou thank you. from what i can tell the AGGREGATE and WEIGHTS options have no meaning for a DIFF operation, but maybe i'm missing some interesting use case. @itamarhaber are you aware of some use case or request for such? |
No, I didn't see anything, it just came up while I analysed the code. Since the ZINTER and ZUNION are implemented together, and the pull request I used as reference also added ZDIFF to the same function, I'll have to actively ignore these options in the case of ZDIFF (as the reference PR did). But no worries, that's quite simple. I'll finish up the pull request without these options then. |
I'm not aware of any previous discussions on the matter, excluding one that I had several years ago with a certain Dr. Defining the meaning of these options in the context of ZDIFF, afaicr, is tricky and the value is debatable. I also motion for not supporting these, at least in the initial release of the command. |
Just created the PR: #7961 |
Hello,
I use sorted set to store my photo list.When A follow B, A's follow photo list and B's photo list will be zunionstore to A's follow list. But when A unfollow B, there is no zdiffstore command to handle this.Will Redis add zdiffstore command?
Felix
The text was updated successfully, but these errors were encountered: