Provides high-performance, space-efficient probabilistic data structures—including quotient, XOR, and binary fuse filters—for fast approximate set membership testing with no false negatives and configurable false positive rates.
Maintainer(s):
rustyconover
Installing and Loading
INSTALL bitfilters FROM community;
LOAD bitfilters;
About bitfilters
For more information regarding usage, see the documentation.
Added Functions
| function_name | function_type | description | comment | examples |
|---|---|---|---|---|
| binary_fuse16_filter | aggregate | Creates a Binary Fuse 16-bit filter with ~0.0015% false positive rate. | NULL | [SELECT binary_fuse16_filter(hash(column)) FROM table] |
| binary_fuse16_filter_contains | scalar | Tests if a BinaryFuse16 filter may contain a value. Returns true if the value might be in the set (with possible false positives), or false if the value is definitely not in the set (no false negatives). | NULL | [SELECT binary_fuse16_filter_contains(filter, 42) FROM table] |
| binary_fuse8_filter | aggregate | Creates a Binary Fuse 8-bit filter with ~0.4% false positive rate. | NULL | [SELECT binary_fuse8_filter(hash(column)) FROM table] |
| binary_fuse8_filter_contains | scalar | Tests if a BinaryFuse8 filter may contain a value. Returns true if the value might be in the set (with possible false positives), or false if the value is definitely not in the set (no false negatives). | NULL | [SELECT binary_fuse8_filter_contains(filter, 42) FROM table] |
| bitfilters_duckdb_bloom_filter_create | aggregate | Creates a DuckDB-compatible bloom filter by aggregating pre-hashed UBIGINT values. Use bitfilters_duckdb_hash() to hash values first. The version and num_sectors (power of 2) are constants. Returns a BLOB that can be probed with bitfilters_duckdb_bloom_filter_probe. | NULL | [SELECT bitfilters_duckdb_bloom_filter_create('v1.5.1', 16384, bitfilters_duckdb_hash('v1.5.1', key)) FROM tbl] |
| bitfilters_duckdb_bloom_filter_probe | scalar | Probes a DuckDB-internal bloom filter (serialized as BLOB) for a value. The version parameter specifies which DuckDB hash algorithm to use. The filter blob and version are constant-folded at bind time. Multiple value arguments are combined for multi-key bloom filter probes. | NULL | [SELECT bitfilters_duckdb_bloom_filter_probe('v1.5.1', filter_blob, key_col) FROM tbl, SELECT bitfilters_duckdb_bloom_filter_probe('v1.5.1', filter_blob, col1, col2) FROM tbl] |
| bitfilters_duckdb_hash | scalar | Computes the DuckDB-internal hash value for the given DuckDB version. The hash matches DuckDB's built-in hash() function for that version. Multiple values are combined using the version's CombineHash algorithm. | NULL | [SELECT bitfilters_duckdb_hash('v1.5.1', 42), SELECT bitfilters_duckdb_hash('v1.5.1', col1, col2) FROM tbl] |
| quotient_filter | aggregate | Creates a Quotient filter by aggregating values or by merging other Quotient filters. Takes q and r as number of bits. | NULL | [SELECT quotient_filter(16, 8, column) FROM table] |
| quotient_filter_contains | scalar | Tests if a Quotient filter may contain a value. Returns true if the value might be in the set (with possible false positives), or false if the value is definitely not in the set (no false negatives). | NULL | [SELECT quotient_filter_contains(filter, 42) FROM table] |
| xor16_filter | aggregate | Creates a Xor16 filter with ~0.0015% false positive rate. | NULL | [SELECT xor16_filter(hash(column)) FROM table] |
| xor16_filter_contains | scalar | Tests if a Xor16 filter may contain a value. Returns true if the value might be in the set (with possible false positives), or false if the value is definitely not in the set (no false negatives). | NULL | [SELECT xor16_filter_contains(filter, 42) FROM table] |
| xor8_filter | aggregate | Creates a Xor8 filter with ~0.4% false positive rate. | NULL | [SELECT xor8_filter(hash(column)) FROM table] |
| xor8_filter_contains | scalar | Tests if a Xor8 filter may contain a value. Returns true if the value might be in the set (with possible false positives), or false if the value is definitely not in the set (no false negatives). | NULL | [SELECT xor8_filter_contains(filter, 42) FROM table] |
Overloaded Functions
This extension does not add any function overloads.
Added Types
This extension does not add any types.
Added Settings
This extension does not add any settings.