mant1988 / redis

Automatically exported from code.google.com/p/redis
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

[FEATURE REQUEST] Add support for nested operations for sets/sortedsets #496

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When using Redis as a database complex querying often requires SINTERSTORE to 
temporary key (see 
http://playnice.ly/blog/2010/05/24/redis-multi-field-searching-and-filtering/ 
as an example), which has a big drawback of temporary keys management. It would 
be nice to have SINTER command that can take results of nested SUNION commands 
as arguments. For example:

SINTER my_items (SUNION new_items open_items)

While this is pretty simple to implement using one more set, there are cases 
like this:

ZINTER (ZRANGE items_by_x 5 10) (ZRANGE items_by_y 3 4)

It's just like the syntax sugar for existing commands.

Thanks

Original issue reported on code.google.com by v.st...@gmail.com on 24 Mar 2011 at 5:45

GoogleCodeExporter commented 8 years ago
I don't think temporary key management is a pain: these commands do not require 
feedback from the client, you know upfront which commands you're going to 
execute. Therefore, you can just use something like "tmp" for the temporary 
key, put all commands in a MULTI/EXEC and append "DEL tmp". Something like you 
suggest adds too much complexity for its gain.

Original comment by pcnoordh...@gmail.com on 24 Mar 2011 at 8:42