Closed GoogleCodeExporter closed 9 years ago
Hashes are inherently unordered, nor does Redis keep multiple versions of a
single value (e.g. to keep around an old version you are iterating over when it
is modified or deleted) so it is unfortunately not possible to iterate over the
fields/value pairs in a hash. This also means that even if we are able to
iterate over a hash that it can not be consistent without introducing a
versioning scheme.
If you do not require a consistent view, you can try to use an extra set per
hash storing its fields in combination with SRANDMEMBER to eventually sample
all fields in the hash. Otherwise you could try and find a way to split the
hash into multiple smaller hashes such that HVALS doesn't take too long.
For the sake of argument: HVALS against a 100k field hash where every field
equals "value" takes about ~35ms on my 2010 i7 MBP, from a Ruby script, where
the time taken to parse the protocol is included.
Original comment by pcnoordh...@gmail.com
on 22 Aug 2011 at 2:38
Original issue reported on code.google.com by
sonal...@gmail.com
on 22 Aug 2011 at 11:02