jsonbd
jsonbd · Compression method for JSONB type
Overview
Usage
Sources:
- Official jsonbd README
- Version 0.1 extension SQL
- Compression implementation and preload settings
- PostgreSQL column-compression patch proposal
jsonbd is an unfinished experiment that compresses repeated JSONB object keys through a shared dictionary. It does not work with an unpatched stock PostgreSQL server: the extension depends on an abandoned column-compression access-method proposal and its non-core SQL syntax.
Experimental setup
After building a compatible PostgreSQL source tree with the referenced patch, preload the module and restart the server:
Then install the extension and select its compression access method for a JSONB column:
The extension creates the jsonbd compression access method and a jsonbd_dictionary table keyed by compression-object OID, dictionary ID, and JSON key. Background workers coordinate dictionary lookups through shared memory queues. JSON scalar values are not compressed by this scheme.
Settings and limitations
jsonbd.workers_countcontrols the background-worker count;0disables workers and the source default is1.jsonbd.queue_sizeconfigures each shared-memory queue in kilobytes, from1KiB to1024KiB; the source default is1KiB.
Both shared-memory sizing and worker registration happen during preload, so configuration changes require a server restart. Loading the library outside shared_preload_libraries raises an error.
The upstream project explicitly says it is unfinished. Its drop callback has no cleanup behavior, so dictionary lifecycle and orphaned rows are unresolved. There is no supported stock-PostgreSQL compatibility target, stable on-disk contract, or production migration path. Use jsonbd only to study the historical patch on a disposable cluster, and test restart, crash, backup, restore, and object-drop behavior before trusting any data to it.