HOW TO Change the Index Bit Count of HLL Bins

HOW TO Change the Index Bit Count of HLL Bins

Context

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.

Methods

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 Index Bits

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.

Decreasing Index Bits

Removing information is much easier, and can be done with the fold() operator. Note that you can only invoke fold() on an HLL that has n_minhash_bits set to 0.

Keywords

HLL HYPERLOGLOG FOLD INDEX BITS SIZE

Timestamp

July 2021

© 2021 Copyright Aerospike, Inc. | All rights reserved. Creators of the Aerospike Database.