On Sun, Dec 13, 2009 at 12:27 AM, Simon Willison
<
si...@simonwillison.net> wrote:
> Would it be appropriate for Redis to add a SADDMULTI command which can
> take an arbitrary number of values and add them to a set all in one
> atomic unit? It would have made a few tasks for the mps-expenses2
> project more convenient. As it was, I had to build up temporary sets
> and then RENAME them to ensure atomicity.
Hello Simon!
yes, it's planned, will probably be called MSADD, and will work in the
following way:
MSADD <num keys> <num values> <key1> <key2> ... <keyN> <val1> <val2> ... <valN>
So it will be a bit more general, for example allowing to add the same
two elements to multiple sets at once:
MSADD 3 2 set1 set2 set3 foo bar
Not sure if I can add this for 1.4, probably yes as it should not be
too complex to implement, but at the same time I need a refactoring of
the Sets code as I want to implement specialized sets representations
for sets composed of small (< signed 64bit) integers in a
memory-efficient way.
But at some time this command will surely get inside.
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