biscuit
pg_biscuit : IAM-LIKE pattern matching with bitmap indexing
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 2170 | biscuit
|
pg_biscuit
|
2.4.1 |
FTS
|
MIT
|
C
|
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
--s-d--
|
No
|
Yes
|
No
|
Yes
|
no
|
no
|
| Relationships | |
|---|---|
| Schemas | public |
| Requires | plpgsql
|
| See Also | hll
rum
pg_textsearch
|
rename from pg_biscuit to biscuit to keep up with PGDG RPM name
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY
|
2.4.1 |
18
17
16
15
14
|
pg_biscuit |
plpgsql |
| RPM | PIGSTY
|
2.4.1 |
18
17
16
15
14
|
biscuit_$v |
- |
| DEB | PIGSTY
|
2.4.1 |
18
17
16
15
14
|
postgresql-$v-biscuit |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
el8.x86_64
|
PIGSTY 2.4.1
|
PIGSTY 2.4.1
|
PIGSTY 2.4.1
|
MISS
|
MISS
|
el8.aarch64
|
PIGSTY 2.4.1
|
PIGSTY 2.4.1
|
PIGSTY 2.4.1
|
MISS
|
MISS
|
el9.x86_64
|
PIGSTY 2.4.1
|
PIGSTY 2.4.1
|
PIGSTY 2.4.1
|
MISS
|
MISS
|
el9.aarch64
|
PIGSTY 2.4.1
|
PIGSTY 2.4.1
|
PIGSTY 2.4.1
|
MISS
|
MISS
|
el10.x86_64
|
PIGSTY 2.4.1
|
PIGSTY 2.4.1
|
PIGSTY 2.4.1
|
MISS
|
MISS
|
el10.aarch64
|
PIGSTY 2.4.1
|
PIGSTY 2.4.1
|
PIGSTY 2.4.1
|
MISS
|
MISS
|
d12.x86_64
|
PIGSTY 2.4.0
|
PIGSTY 2.4.0
|
PIGSTY 2.4.0
|
MISS
|
MISS
|
d12.aarch64
|
PIGSTY 2.4.0
|
PIGSTY 2.4.0
|
PIGSTY 2.4.0
|
MISS
|
MISS
|
d13.x86_64
|
PIGSTY 2.4.0
|
PIGSTY 2.4.0
|
PIGSTY 2.4.0
|
MISS
|
MISS
|
d13.aarch64
|
PIGSTY 2.4.0
|
PIGSTY 2.4.0
|
PIGSTY 2.4.0
|
MISS
|
MISS
|
u22.x86_64
|
PIGSTY 2.4.0
|
PIGSTY 2.4.0
|
PIGSTY 2.4.0
|
MISS
|
MISS
|
u22.aarch64
|
PIGSTY 2.4.0
|
PIGSTY 2.4.0
|
PIGSTY 2.4.0
|
MISS
|
MISS
|
u24.x86_64
|
PIGSTY 2.4.0
|
PIGSTY 2.4.0
|
PIGSTY 2.4.0
|
MISS
|
MISS
|
u24.aarch64
|
PIGSTY 2.4.0
|
PIGSTY 2.4.0
|
PIGSTY 2.4.0
|
MISS
|
MISS
|
u26.x86_64
|
PIGSTY 2.4.0
|
PIGSTY 2.4.0
|
PIGSTY 2.4.0
|
MISS
|
MISS
|
u26.aarch64
|
PIGSTY 2.4.0
|
PIGSTY 2.4.0
|
PIGSTY 2.4.0
|
MISS
|
MISS
|
Source
pig build pkg pg_biscuit; # build rpm/debInstall
Make sure PGDG and PIGSTY repo available:
pig repo add pgsql -u # add both repo and update cacheInstall this extension with pig:
pig install pg_biscuit; # install via package name, for the active PG version
pig install biscuit; # install by extension name, for the current active PG version
pig install biscuit -v 18; # install for PG 18
pig install biscuit -v 17; # install for PG 17
pig install biscuit -v 16; # install for PG 16Create this extension with:
CREATE EXTENSION biscuit CASCADE; -- requires plpgsqlUsage
Sources:
biscuit is a PostgreSQL index access method for accelerating LIKE, NOT LIKE, ILIKE, and NOT ILIKE pattern matching on text. It uses bitmap-style position indexes to avoid the heap recheck overhead common in trigram searches and supports multi-column indexes for wildcard-heavy workloads.
PGXN package 2.4.1 ships the SQL/control version 2.4.0; the extension’s visible default_version is therefore still 2.4.0. The local Pigsty extension name is biscuit, while older package metadata may mention pg_biscuit.
Warning
Upstream marks Biscuit as actively developed and recommends thorough staging validation before production use. Test representative datasets, query patterns, upgrades, backup/restore, and performance behavior before relying on it for critical workloads.
Quick Start
CREATE EXTENSION IF NOT EXISTS biscuit;
CREATE TABLE users (
id bigserial PRIMARY KEY,
name text,
email text,
bio text
);
CREATE INDEX users_name_biscuit
ON users USING biscuit (name);
SELECT *
FROM users
WHERE name LIKE '%john%';biscuit supports ordinary wildcard patterns with % and _:
SELECT * FROM users WHERE name LIKE 'john%';
SELECT * FROM users WHERE name LIKE '%smith';
SELECT * FROM users WHERE name LIKE '%oh_';
SELECT * FROM users WHERE name ILIKE '%john%';
SELECT * FROM users WHERE name NOT LIKE '%test%';Multi-Column Indexes
CREATE INDEX users_search_biscuit
ON users USING biscuit (name, email, bio);
SELECT *
FROM users
WHERE name ILIKE '%john%'
AND email LIKE '%example.com'
AND bio NOT LIKE '%inactive%';Biscuit can combine bitmap matches from multiple indexed columns and may reorder predicates by estimated selectivity.
Expression Indexes
Version 2.4.0 adds expression-index support:
CREATE INDEX users_lower_name_biscuit
ON users USING biscuit (lower(name));
SELECT *
FROM users
WHERE lower(name) LIKE '%john%';For char(n) / bpchar columns, upstream recommends expression indexes that cast to text, because native bpchar operator classes are not yet available:
CREATE INDEX legacy_code_biscuit
ON legacy_table USING biscuit ((code::text));Introspection
SELECT *
FROM biscuit_operators;
SELECT *
FROM biscuit_version_history;The biscuit_operators view lists the operators registered for the Biscuit access method. In 2.4.0, the view was fixed to remain correct if additional operator classes or families are added.
Operational Notes
Biscuit’s design is optimized for:
- prefix, suffix, substring, and mixed wildcard
LIKE/ILIKEpatterns - multi-column predicates where bitmap intersections can reduce candidate sets
- exact pattern matching without trigram false-positive rechecks
- workloads where text-pattern search dominates query latency
It is not a general full-text search engine and does not replace ranking, stemming, tokenization, or phrase search. Use PostgreSQL full text search, trigram indexes, or dedicated search extensions when those semantics are required.
Caveats
- Upstream requires PostgreSQL 16 or newer and standard build tools. Pigsty local metadata currently packages Biscuit for PostgreSQL 16-18.
- PGXN package version 2.4.1 carries SQL/control
default_version = '2.4.0'; this is expected for the current source package. - Biscuit only targets
LIKE/ILIKE-style wildcard matching. Regular expressions are not the supported search surface. - Non-text columns should be indexed through explicit text expressions when needed.
- Benchmark against
pg_trgmand your actual data distribution before replacing existing production indexes.