• Viktor Söderqvist's avatar
    Listpack encoding for sets (#11290) · 4e472a1a
    Viktor Söderqvist authored
    Small sets with not only integer elements are listpack encoded, by default
    up to 128 elements, max 64 bytes per element, new config `set-max-listpack-entries`
    and `set-max-listpack-value`. This saves memory for small sets compared to using a hashtable.
    
    Sets with only integers, even very small sets, are still intset encoded (up to 1G
    limit, etc.). Larger sets are hashtable encoded.
    
    This PR increments the RDB version, and has an effect on OBJECT ENCODING
    
    Possible conversions when elements are added:
    
        intset -> listpack
        listpack -> hashtable
        intset -> hashtable
    
    Note: No conversion happens when elements are deleted. If all elements are
    deleted and then added again, the set is deleted and recreated, thus implicitly
    converted to a smaller encoding.
    4e472a1a
t_set.c 57.6 KB