lsm-tree-0.1.0.0: Log-structured merge-trees
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.BloomFilter.Blocked.Calc

Description

Various formulas for working with bloomfilters.

Synopsis

Documentation

data BloomSize Source #

Parameters for constructing a Bloom filter.

Constructors

BloomSize 

Fields

  • sizeBits :: !Int

    The requested number of bits in filter. The actual size will be rounded up to the nearest 512.

  • sizeHashes :: !Int

    The number of hash functions to use.

Instances

Instances details
Show BloomSize Source # 
Instance details

Defined in Data.BloomFilter.Classic.Calc

data BloomPolicy Source #

A policy on intended bloom filter size -- independent of the number of elements.

We can decide a policy based on:

  1. a target false positive rate (FPR) using policyForFPR
  2. a number of bits per entry using policyForBits

A policy can be turned into a BloomSize given a target NumEntries using sizeForPolicy.

Either way we define the policy, we can inspect the result to see:

  1. The bits per entry policyBits. This will determine the size of the bloom filter in bits. In general the bits per entry can be fractional. The final bloom filter size in will be rounded to a whole number of bits.
  2. The number of hashes policyHashes.
  3. The expected FPR for the policy using policyFPR.

Constructors

BloomPolicy 

Instances

Instances details
Show BloomPolicy Source # 
Instance details

Defined in Data.BloomFilter.Classic.Calc