Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update week1-07-sst-optimizations.md #49

Merged
merged 1 commit into from
Feb 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions mini-lsm-book/src/week1-07-sst-optimizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down