Try
↑ ↓ move↵ openesc close
In this lesson · topic 7 of 7
  1. 1. Finding one row without reading them all
  2. 2. Secondary indexes and Bloom filters
  3. 3. Tune a filter and add indexes
  4. 4. Each index is a tax on every write
  5. 5. Bits per key against false positives
  6. 6. Where filters help and where they do not
  7. 7. False positives, hashes and index cost

Topic 7

False positives, hashes and index cost

4 min read

Predict first

A Bloom filter says a key is not present. What does that tell you?

Predict first

You use ten bits per key and keep adding hash functions. What happens to the false positive rate?

Predict first

Why does adding a secondary index slow inserts?

Take away

  • A secondary index turns a full scan into a few page reads, and costs every insert an extra write.
  • A covering index answers from the index alone, at the price of a wider index.
  • A Bloom filter says no with certainty and yes with a known chance of being wrong.
  • Bits per key set the false positive rate. Returns fall quickly. The best hash count is about 0.69 times the bits per key.
  • In an LSM tree, filters turn misses from many reads into almost none. They do not help ranges.
  • Keep only the indexes that queries use.

Sources

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms