Hello Anibal,
you can find the proposal already in the TODO list indeed.
It's *very* useful indeed (imagine to set an EXPIRE on this just to
use as a cache when real-time sorting is not important) but I think
I'll use the syntax proposed in the TODO list, that is:
SORT ... BY ... STORE <keyname>
I think it should really not do any difference.
Cheers,
Salvatore
--
Salvatore 'antirez' Sanfilippo
http://invece.org
"Once you have something that grows faster than education grows,
you’re always going to get a pop culture.", Alan Kay
Sorry no TODO in the Wiki, it changes a bit too often ;) It's in the
Git repository and in the tar.gz (but the only up-to-date version is
on Git).
Hello again,
ok "STORE" option implemented in Redis git.
Tested it a bit, should work. Will write tests and docs later...
Hello Ericson,
maybe there is already a solution suitable for you if you don't need
real-timeness.
Basically it's like this:
SINTERSTORE myintersection set1 set2 set2 ... setN
EXPIRE myintersection <time to live>
SORT myintersection BY none LIMIT ...
Of course you have to deal with myintersection expiring, and call
again SINTERSTORE in order to rebuild it.
But with our current Sets this problem is really without good
solutions, because to perform the *full* intersection is needed every
time even if we only need to get the top 10 items. Instead with sorted
sets there are algorithms to make this much more faster.