From 221162987d846ff13f22d905587c01f550163bab Mon Sep 17 00:00:00 2001 From: Zaid Humayun Date: Fri, 23 Feb 2024 11:17:11 +0530 Subject: [PATCH] Update week1-07-sst-optimizations.md The description has been changed to: 1. Display two separate has functions results as `hash1` and `hash2`. 2. Correctly state the bloom filter has 7 bits 3. Add a link to a post explaining bloom filters --- mini-lsm-book/src/week1-07-sst-optimizations.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mini-lsm-book/src/week1-07-sst-optimizations.md b/mini-lsm-book/src/week1-07-sst-optimizations.md index 6bab55de..7abdd797 100644 --- a/mini-lsm-book/src/week1-07-sst-optimizations.md +++ b/mini-lsm-book/src/week1-07-sst-optimizations.md @@ -23,9 +23,11 @@ Bloom filters are probabilistic data structures that maintains a set of keys. Yo You usually need to have a hash function in order to construct a bloom filter, and a key can have multiple hashes. Let us take a look at the below example. Assume that we already have hashes of some keys and the bloom filter has 7 bits. +[Note: If you want to understand bloom filters better, look [here](https://samwho.dev/bloom-filters/)] + ```plaintext hash1 = ((character - a) * 13) % 7 -hash1 = ((character - a) * 11) % 7 +hash2 = ((character - a) * 11) % 7 b -> 6 4 c -> 5 1 d -> 4 5 @@ -34,7 +36,7 @@ g -> 1 3 h -> 0 0 ``` -If we insert b, c, d into the 6-bit bloom filter, we will get: +If we insert b, c, d into the 7-bit bloom filter, we will get: ``` bit 0123456