In this lesson · topic 7 of 7
Topic 7
False positives, hashes and index cost
4 min read
Predict first
Predict first
Predict first
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
- Burton H. Bloom, Space/time trade-offs in hash coding with allowable errors, Communications of the ACM, 1970.
- Andrei Broder and Michael Mitzenmacher, Network Applications of Bloom Filters: A Survey, Internet Mathematics, 2004.
- Adam Kirsch and Michael Mitzenmacher, Less hashing, same performance: Building a better Bloom filter, Random Structures and Algorithms, 2008.
- Niv Dayan, Manos Athanassoulis and Stratos Idreos, Monkey: Optimal Navigable Key-Value Store, SIGMOD, 2017.
- Goetz Graefe, Modern B-Tree Techniques, Foundations and Trends in Databases, 2011.