bloom
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
bloom | 1.0 | FEAT | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 2990 | bloom | No | Yes | No | Yes | No | No | - |
Version
| PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|
| 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
Install
Note: This is a built-in contrib extension of PostgreSQL
Usage
The bloom extension provides an index access method based on Bloom filters. A Bloom filter is a space-efficient data structure that tests whether an element is a member of a set, with possible false positives but no false negatives.
Bloom indexes are particularly useful for tables with many columns where queries test arbitrary combinations of columns. A single bloom index can replace multiple btree indexes while using significantly less space.
Create Bloom Index
With custom parameters:
Parameters
| Parameter | Default | Max | Description |
|---|---|---|---|
length | 80 | 4096 | Length of each signature in bits (rounded to nearest 16) |
col1 - col32 | 2 | 4095 | Number of bits generated for each index column |
Operator Class Support
Bloom indexes only support the equality operator (=). Built-in operator classes exist for int4 and text. You can define custom operator classes for other types that have a hash function:
Example
Limitations
- Only equality (
=) queries are supported (no range queries) - Does not support
UNIQUEindexes - Does not support searching for
NULLvalues - Results require recheck against heap due to false positives
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)