Closed GoogleCodeExporter closed 8 years ago
Hello Jon,
added to the TODO list. This is a useful primitive that's worth adding.
Original comment by anti...@gmail.com
on 4 May 2009 at 9:44
implemented in Redis-git in the form of vararg DEL.
Original comment by anti...@gmail.com
on 9 May 2009 at 7:05
Hi,
I tried this out but noticed you could not wildcard keys:
SET group:one:1 3
foo
SET group:one:2 3
bar
DEL group:one:*
This would be equivalent to saying KEY group:one:* and then issuing a multiple
DEL in
a loop but that was the initial issue we were hoping this would solve (to avoid
2
calls), MDEL (multiple delete) ... we are basically trying to "group" keys and
simulate a current setup w/ Redis ...
Original comment by jonb...@gmail.com
on 9 May 2009 at 8:30
Hello!
this is not going to be a good idea. KEYS <pattern> is an O(N) operation. With
your
design you are going to severely reduce the good things a KV store gives to
you, that
is: scalability and easy partitioning.
We have a single operating doing pattern matching that is KEYS, since sometimes
it's
not a matter of speed, but, for instance, of reconstructing data and keys after
a DB
schema switch. But it's not suggested to use pattern matching for actual work.
What you want to do is trivially accomplished adding the sub-keys you have for
every
group into a set with "SADD group:one:fields 1" and so on. Then when you need to
remove the whole group just perform a SMEMBERS to get all the members of the set
followed by a multi-argument delete. This appears to be slower since takes two
steps
and two commands, but actually this is an O(1) operation so this is going to
scale
very well.
Regards,
Salvatore
Original comment by anti...@gmail.com
on 9 May 2009 at 9:21
Original issue reported on code.google.com by
jonb...@gmail.com
on 4 May 2009 at 6:28