pg_bigmr
pg_bigmr · text similarity measurement and index searching based on bigrams
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100816 | pg_bigmr | pg_bigmr | 0.1.0 | FTS | PostgreSQL | Rust |
PostgreSQL · 12, 13, 14, 15, 16, 17
Usage
Sources:
- Official extension control file
- Official upstream documentation
- Official SQL definition
- Official Rust implementation
pg_bigmr 0.1.0 is an experimental Rust and pgrx reimplementation of pg_bigm. It provides bigram-based text similarity and a GIN operator class for accelerating LIKE and similarity searches, but upstream explicitly labels it work in progress.
Core Workflow
Add the module to shared_preload_libraries, restart PostgreSQL, create the extension, and build a GIN index with gin_bigm_ops.
show_bigm(text) displays extracted bigrams, likequery(text) escapes a literal for contains-style LIKE, and pg_gin_pending_stats(oid) reports pending-list pages and tuples for a GIN index. The =% operator applies the similarity threshold.
Settings and Caveats
pg_bigmr.similarity_limit defaults to 0.3, pg_bigmr.gin_key_limit defaults to no limit, and pg_bigmr.enable_recheck defaults to on. Changing limits or disabling heap rechecks can trade correctness or selectivity for speed. This is not a drop-in assurance of pg_bigm compatibility; benchmark representative text, verify Unicode and wildcard behavior, and avoid production use without workload-specific validation.