After creating records with bins that contain HLL data with a certain number of index bits, it may turn out that the number of bits needs to be increased, to improve accuracy, or decreased, to save storage space or improve performance.
As with any change that needs to be applied to all records, these can be applied to each record at the time it is interacted with by the client application until all (or enough) records are updated, or all at once using a scan.
Increasing the number of index bits is adding information to the HLL bin, which can’t be done without the original data, so every bin will need to be recreated. The maximum number of index bits allowed is 16.
Removing information is much easier, and can be done with the fold() operator. Note that you can only
fold() on an HLL that has
n_minhash_bits set to 0.
HLL HYPERLOGLOG FOLD INDEX BITS SIZE