O'Reilly logo

Getting Started with LevelDB by Andy Dent

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding how Bloom filters help guesses

Failing to find something is usually slower than finding it—when do you give up? In most applications, you will not have every possible key value stored in the database. One of the biggest optimizations in LevelDB is the use of a filter policy to decide if a given key is present in a level.

We know from the manifest file which level file contains a key range for our key. If you are using a filter, the filter data is cached for each open file so it provides a quick answer as to the key presence in that table, without reading the index and scanning blocks. The default filter provided for you to use is a Bloom filter.

A Bloom filter in operation from Jason Davies' online demonstrator

The preceding figure ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required