Skip to download

hesela.dev

Storage glossary · datasets · llms.txt · hesela.com

Computed examples / not database measurements

Bloom filter allocation: equal memory, different lookup cost

Fourteen deterministic cases compare equal bits per entry with optimized allocation across three invented runs. Expected probes, not measured latency.

Download CSV42 rows / 10 columns

JSON and provenance / Evaluator code / Research explanation

Method

Assume every absent point lookup considers every run, all filter/index metadata is resident, and each false positive costs one equally weighted probe. Use p=exp(-b*ln(2)^2). Minimize sum(p_i) subject to sum(n_i*b_i)=budget and b_i>=0 using KKT conditions and 100-step bounded bisection. Run sizes: 10000, 100000, 1000000 entries. Average budgets: 0, 1, 2, 4, 8, 10, 12 bits per stored entry. No random sample or device I/O.

Three assumed runs: 10,000, 100,000 and 1,000,000 entries. One row per case here; three rows per case in CSV.
Budget, bits/entryPolicyTotal filter bitsExpected probes / absent query
0equal03.000000
0optimized03.000000
1equal1,110,0001.855509
1optimized1,110,0000.880588
2equal2,220,0001.147638
2optimized2,220,0000.544647
4equal4,440,0000.439025
4optimized4,440,0000.208352
8equal8,880,0000.064248
8optimized8,880,0000.030491
10equal11,100,0000.024578
10optimized11,100,0000.011664
12equal13,320,0000.009402
12optimized13,320,0000.004462

Interpretation

Expected probes can be below one or above one. They are a sum of probabilities, not the probability of at least one false positive, and not milliseconds. The three copies of expectedProbes in each CSV case must not be added together.

Reproduce

The standalone module requires Node.js and no packages. The command performs no storage benchmark. The API accepts 1-64 positive-integer run sizes and an average budget of zero or 0.000001-64 bits per entry. JSON records code and CSV SHA-256 hashes; regeneration updates the generation timestamp, not the computed rows.

node --input-type=module -e 'import { toCsv } from "./bloom-allocation.mjs"; process.stdout.write(toCsv())'

Limits

Column definitions

policy
equal: identical bits per entry; optimized: minimum sum of model false-positive probabilities.
budgetBitsPerEntry
Total filter budget / total stored entries, bits per entry; not bytes.
totalEntries
Sum of entries across the three invented runs, not distinct live database keys.
budgetBits
Total ideal filter bit budget, excluding headers, indexes and caches.
run
Run number, ascending by entry count; not a RocksDB level identifier.
entries
Assumed stored entry count in this run.
bitsPerEntry
Continuous ideal filter bits / this run's entries; not rounded hash counts.
filterBits
Continuous allocated bits for this run; need not be an integer.
falsePositiveProbability
Probability for a key absent from this run under exp(-bitsPerEntry * ln(2)^2); 1 means no filter.
expectedProbes
Sum of run false-positive probabilities for one absent point lookup, repeated for each case's three rows.

Sources and license

CC0-1.0 for Hesela's original implementation and computed rows; cited papers and documentation retain their own rights.

  1. Burton H. Bloom. Space/time trade-offs in hash coding with allowable errors. Communications of the ACM 13(7), 422-426 (1970), method 2. DOI: 10.1145/362686.362692.
  2. Niv Dayan, Manos Athanassoulis and Stratos Idreos. Monkey: Optimal Navigable Key-Value Store. SIGMOD 2017, 79-94; sections 2, 4.1 and 5. DOI: 10.1145/3035918.3064054.
  3. RocksDB project. RocksDB Bloom Filter: statistics, full filters and implementation trade-offs. Documentation reviewed 12 October 2026.

Corpus: Bloom filter, LSM-tree, SSTable.