Skip to content
biscuit

biscuit

pg_biscuit : IAM-LIKE pattern matching with bitmap indexing

Overview

ID Extension Package Version Category License Language
2170
biscuit
pg_biscuit
2.3.0
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.3.0
18
17
16
15
14
pg_biscuit plpgsql
RPM
PIGSTY
2.3.0
18
17
16
15
14
biscuit_$v -
DEB
PIGSTY
2.3.0
18
17
16
15
14
postgresql-$v-biscuit -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64
PIGSTY 2.3.0
PIGSTY 2.3.0
PIGSTY 2.3.0
MISS
MISS
el8.aarch64
PIGSTY 2.3.0
PIGSTY 2.3.0
PIGSTY 2.3.0
MISS
MISS
el9.x86_64
PIGSTY 2.3.0
PIGSTY 2.3.0
PIGSTY 2.3.0
MISS
MISS
el9.aarch64
PIGSTY 2.3.0
PIGSTY 2.3.0
PIGSTY 2.3.0
MISS
MISS
el10.x86_64
PIGSTY 2.3.0
PIGSTY 2.3.0
PIGSTY 2.3.0
MISS
MISS
el10.aarch64
PIGSTY 2.3.0
PIGSTY 2.3.0
PIGSTY 2.3.0
MISS
MISS
d12.x86_64
PIGSTY 2.3.0
PIGSTY 2.3.0
PIGSTY 2.3.0
MISS
MISS
d12.aarch64
PIGSTY 2.3.0
PIGSTY 2.3.0
PIGSTY 2.3.0
MISS
MISS
d13.x86_64
PIGSTY 2.3.0
PIGSTY 2.3.0
PIGSTY 2.3.0
MISS
MISS
d13.aarch64
PIGSTY 2.3.0
PIGSTY 2.3.0
PIGSTY 2.3.0
MISS
MISS
u22.x86_64
PIGSTY 2.3.0
PIGSTY 2.3.0
PIGSTY 2.3.0
MISS
MISS
u22.aarch64
PIGSTY 2.3.0
PIGSTY 2.3.0
PIGSTY 2.3.0
MISS
MISS
u24.x86_64
PIGSTY 2.3.0
PIGSTY 2.3.0
PIGSTY 2.3.0
MISS
MISS
u24.aarch64
PIGSTY 2.3.0
PIGSTY 2.3.0
PIGSTY 2.3.0
MISS
MISS
u26.x86_64
PIGSTY 2.3.0
PIGSTY 2.3.0
PIGSTY 2.3.0
MISS
MISS
u26.aarch64
PIGSTY 2.3.0
PIGSTY 2.3.0
PIGSTY 2.3.0
MISS
MISS
Package Version OS ORG SIZE File URL
biscuit_18 2.3.0 el8.x86_64 pigsty 62.7 KiB biscuit_18-2.3.0-1PIGSTY.el8.x86_64.rpm
biscuit_18 2.2.2 el8.x86_64 pigsty 65.5 KiB biscuit_18-2.2.2-2PIGSTY.el8.x86_64.rpm
biscuit_18 2.2.2 el8.x86_64 pgdg 63.6 KiB biscuit_18-2.2.2-1PGDG.rhel8.10.x86_64.rpm
biscuit_18 2.3.0 el8.aarch64 pigsty 59.8 KiB biscuit_18-2.3.0-1PIGSTY.el8.aarch64.rpm
biscuit_18 2.2.2 el8.aarch64 pigsty 61.1 KiB biscuit_18-2.2.2-2PIGSTY.el8.aarch64.rpm
biscuit_18 2.2.2 el8.aarch64 pgdg 59.1 KiB biscuit_18-2.2.2-1PGDG.rhel8.10.aarch64.rpm
biscuit_18 2.3.0 el9.x86_64 pigsty 61.7 KiB biscuit_18-2.3.0-1PIGSTY.el9.x86_64.rpm
biscuit_18 2.2.2 el9.x86_64 pigsty 65.9 KiB biscuit_18-2.2.2-2PIGSTY.el9.x86_64.rpm
biscuit_18 2.2.2 el9.x86_64 pgdg 65.2 KiB biscuit_18-2.2.2-1PGDG.rhel9.8.x86_64.rpm
biscuit_18 2.3.0 el9.aarch64 pigsty 60.4 KiB biscuit_18-2.3.0-1PIGSTY.el9.aarch64.rpm
biscuit_18 2.2.2 el9.aarch64 pigsty 63.7 KiB biscuit_18-2.2.2-2PIGSTY.el9.aarch64.rpm
biscuit_18 2.2.2 el9.aarch64 pgdg 62.6 KiB biscuit_18-2.2.2-1PGDG.rhel9.8.aarch64.rpm
biscuit_18 2.3.0 el10.x86_64 pigsty 63.2 KiB biscuit_18-2.3.0-1PIGSTY.el10.x86_64.rpm
biscuit_18 2.2.2 el10.x86_64 pigsty 68.7 KiB biscuit_18-2.2.2-2PIGSTY.el10.x86_64.rpm
biscuit_18 2.2.2 el10.x86_64 pgdg 67.9 KiB biscuit_18-2.2.2-1PGDG.rhel10.2.x86_64.rpm
biscuit_18 2.3.0 el10.aarch64 pigsty 62.3 KiB biscuit_18-2.3.0-1PIGSTY.el10.aarch64.rpm
biscuit_18 2.2.2 el10.aarch64 pigsty 65.8 KiB biscuit_18-2.2.2-2PIGSTY.el10.aarch64.rpm
biscuit_18 2.2.2 el10.aarch64 pgdg 64.8 KiB biscuit_18-2.2.2-1PGDG.rhel10.2.aarch64.rpm
postgresql-18-biscuit 2.3.0 d12.x86_64 pigsty 140.3 KiB postgresql-18-biscuit_2.3.0-1PIGSTY~bookworm_amd64.deb
postgresql-18-biscuit 2.3.0 d12.aarch64 pigsty 135.0 KiB postgresql-18-biscuit_2.3.0-1PIGSTY~bookworm_arm64.deb
postgresql-18-biscuit 2.3.0 d13.x86_64 pigsty 140.4 KiB postgresql-18-biscuit_2.3.0-1PIGSTY~trixie_amd64.deb
postgresql-18-biscuit 2.3.0 d13.aarch64 pigsty 135.9 KiB postgresql-18-biscuit_2.3.0-1PIGSTY~trixie_arm64.deb
postgresql-18-biscuit 2.3.0 u22.x86_64 pigsty 143.3 KiB postgresql-18-biscuit_2.3.0-1PIGSTY~jammy_amd64.deb
postgresql-18-biscuit 2.3.0 u22.aarch64 pigsty 140.5 KiB postgresql-18-biscuit_2.3.0-1PIGSTY~jammy_arm64.deb
postgresql-18-biscuit 2.3.0 u24.x86_64 pigsty 139.4 KiB postgresql-18-biscuit_2.3.0-1PIGSTY~noble_amd64.deb
postgresql-18-biscuit 2.3.0 u24.aarch64 pigsty 138.0 KiB postgresql-18-biscuit_2.3.0-1PIGSTY~noble_arm64.deb
postgresql-18-biscuit 2.3.0 u26.x86_64 pigsty 139.5 KiB postgresql-18-biscuit_2.3.0-1PIGSTY~resolute_amd64.deb
postgresql-18-biscuit 2.3.0 u26.aarch64 pigsty 136.4 KiB postgresql-18-biscuit_2.3.0-1PIGSTY~resolute_arm64.deb

Source

pig build pkg pg_biscuit;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install 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 16

Create this extension with:

CREATE EXTENSION biscuit CASCADE; -- requires plpgsql

Usage

Syntax:

CREATE EXTENSION biscuit;
CREATE INDEX idx_users_name ON users USING biscuit(name);
SELECT * FROM users WHERE name LIKE '%john%';

Sources: README, Docs

biscuit is a PostgreSQL index access method for fast LIKE and ILIKE pattern matching, including multi-column searches. The upstream project positions it as a deterministic bitmap index that avoids the false-positive recheck overhead common in trigram-based searches.

Quick Start

Create the extension and build a Biscuit index on one or more text columns:

CREATE EXTENSION biscuit;

CREATE INDEX idx_users_name ON users USING biscuit(name);

CREATE INDEX idx_products_search
ON products USING biscuit(name, description, category);

Basic wildcard queries work with the index:

SELECT * FROM users WHERE name LIKE '%john%';
SELECT * FROM users WHERE name NOT LIKE 'a%b%c';
SELECT COUNT(*) FROM users WHERE name LIKE '%test%';

SELECT *
FROM products
WHERE name LIKE '%widget%'
  AND description LIKE '%blue%'
  AND category LIKE 'electronics%'
LIMIT 10;

Index Behavior

Biscuit stores bitmap position indexes for each string and can match both forward and backward character positions. The upstream design highlights:

  • positive indexes for characters at exact positions
  • negative indexes for characters counted from the string end
  • case-insensitive variants for ILIKE
  • exact-length and minimum-length bitmaps for fast length filtering

For a pattern such as LIKE 'abc%def', Biscuit can intersect prefix and suffix bitmaps plus a minimum-length filter, producing exact matches without a heap recheck phase.

Pattern Cases

The implementation documents optimized paths for common pattern types:

  • exact matches such as 'abc'
  • prefix patterns such as 'abc%'
  • suffix patterns such as '%xyz'
  • substring patterns such as '%abc%'
  • multi-column predicates, where Biscuit reorders predicates by estimated selectivity

Performance Notes

The upstream README emphasizes bitmap-only evaluation and several execution optimizations, including:

  • early termination when an intermediate bitmap becomes empty
  • direct use of roaring bitmaps for sparse and dense cases
  • negative-position lookups for suffix predicates
  • sorted TID output to improve heap access locality
  • special handling for aggregate queries and LIMIT

The project README also includes a benchmark setup comparing Biscuit indexes with trigram-based approaches on a 1M-row table.

Requirements

The current upstream README lists these requirements for source builds:

  • PostgreSQL 16 or newer
  • standard build tools such as gcc, make, and pg_config
  • optional CRoaring for improved performance

The project publishes packages on PGXN and maintains a dedicated documentation site on Read the Docs.

Last updated on