Skip to content

Modification of Bit Manipulation in Bloom Filter #1217

Open
@khobaib529

Description

@khobaib529

File: util/bloom.cc
Line: 50: array[bitpos / 8] |= (1 << (bitpos % 8));
This line sets the bit at position n by shifting 1 left by the remainder of n divided by 8. However, it does not set the nth bit directly; instead, it sets the bit at position (n / 8) * 8 + (8 - n % 8).
According to standard Bloom filter logic, we should set the nth bit (where n is calculated by hashing the key). While the current implementation functions correctly, aligning with traditional Bloom filter logic could enhance clarity. However, if this is changed to align with the original implementation of Bloom filters, existing databases may encounter issues such as data loss or incorrect results.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions