Curriculum · Module 07, Storage Engines
Indexes and Bloom filters
Secondary indexes make reads cheap and writes dear. A Bloom filter spends a few bits per key to skip files that cannot hold the key.
What each topic covers
- Without an index, a query by any column but the key scans the whole table. With one, it reads a few pages.
- How an index points back at rows, and how a bit array answers "maybe" or "no" about a key.
- Fill a Bloom filter and compare measured false positives with the formula, then add secondary indexes and watch insert cost.
- An index makes reads cheap by making every insert touch another tree, and the cost grows with the number of indexes.
- More bits buy fewer false positives with sharply falling returns, and the hash count has a best value.
- A filter guards one-key lookups, helps most on misses, and cannot answer ranges or deletes.
- Three quick checks on filter errors, the hash count and the write cost of an index, with the sources behind the lesson.
Topics
Practise this lesson
8 interview questions on indexes and filters, with worked answers and sources.
Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms