|
ZunionstoreCommand
We moved to Redis.io!Redis home moved to http://redis.io, please visit our new home. |
► Sign in to add a comment
|
Search
|
|
ZunionstoreCommand
We moved to Redis.io!Redis home moved to http://redis.io, please visit our new home. |
ZINTERBYSCORE seems like a good addition to me :)
This will enable ZSETs to be used as a multi-dimensional data set, where you could use 2 ZSET to store 2 weights for every item, then when you need to find them using 2 ranges, just do a ZINTERBYSCORE (or ZINTERSTOREBYSCORE) from both sets and specifying the min and max score for each set.
For example, I could store geographical data by using two ZSET for each point. One for latitudes and another for longitudes. Then when I want to display them on a map, I can do a ZINTERBYSCORE from the latitude set and longitude set supplying the min/max of each respectively to get the results inside the bounds I want.
It'd be useful for operations which requires sorting by multiple axes.
I know this might be better done on the client side, but since you already have ZINTERSTORE....
Will there ever be a zdiffstore? Please please?
Wish there was a combination of this and ZRANGE/ZREVRANGE so that you could compute, say, the union/intersection of the first 50 items of set1 with the last 30 items of set2, etc.
ZDIFFSTORE patch http://groups.google.com/group/redis-db/browse_thread/thread/f17f696761088655?fwc=2
+1 to implement ZDIFFSTORE in main branch
+1 also for ZDIFF or ZDIFF store.