In this lesson · topic 3 of 7
Topic 3
Tune a filter and add indexes
8 min read
Two experiments in one lab
The top half fills a Bloom filter with keys. After each tick it asks the filter about 10,000 keys that were never added and counts the ones that pass. That is the measured false positive rate. Next to it is the formula’s value. The chart shows the formula’s rate at full load for every bits-per-key setting.
The bottom half is a table with secondary indexes. Each insert adds a row and an entry in every index. It counts the pages that must be written, and compares a scan with an index lookup.
Predict before you press play
Things to try
- Leave 10 bits and 7 hashes and compare the measured rate with the formula.
- Drop to 4 bits per key and 3 hashes.
- Keep 10 bits and use one hash, then twelve.
- Set secondary indexes to 0 and read page writes per insert.
- Set it to 5 and read it again.
The full-page lab has guided experiments for each of these.