• antirez's avatar
    Added dictGetRandomKeys() to dict.c: mass get random entries. · 5317f5e9
    antirez authored
    This new function is useful to get a number of random entries from an
    hash table when we just need to do some sampling without particularly
    good distribution.
    
    It just jumps at a random place of the hash table and returns the first
    N items encountered by scanning linearly.
    
    The main usefulness of this function is to speedup Redis internal
    sampling of the key space, for example for key eviction or expiry.
    5317f5e9
dict.h 6.59 KB