vgram
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
vgram | 1.0 | FTS | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 2130 | vgram | No | Yes | No | Yes | No | Yes | - |
Collect corpus-specific q-gram statistics before creating the GIN index; upstream supports PostgreSQL 13+.
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.0 | 1817161514 | vgram | - |
| RPM | PIGSTY | 1.0 | 1817161514 | vgram_$v | - |
| DEB | PIGSTY | 1.0 | 1817161514 | postgresql-$v-vgram | - |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.0 el8.x86_64.pg18 : vgram_18 vgram_18-1.0-1PGSTY.el8.x86_64.rpm
| PIGSTY 1.0 el8.x86_64.pg17 : vgram_17 vgram_17-1.0-1PGSTY.el8.x86_64.rpm
| PIGSTY 1.0 el8.x86_64.pg16 : vgram_16 vgram_16-1.0-1PGSTY.el8.x86_64.rpm
| PIGSTY 1.0 el8.x86_64.pg15 : vgram_15 vgram_15-1.0-1PGSTY.el8.x86_64.rpm
| PIGSTY 1.0 el8.x86_64.pg14 : vgram_14 vgram_14-1.0-1PGSTY.el8.x86_64.rpm
|
| el8.aarch64 | PIGSTY 1.0 el8.aarch64.pg18 : vgram_18 vgram_18-1.0-1PGSTY.el8.aarch64.rpm
| PIGSTY 1.0 el8.aarch64.pg17 : vgram_17 vgram_17-1.0-1PGSTY.el8.aarch64.rpm
| PIGSTY 1.0 el8.aarch64.pg16 : vgram_16 vgram_16-1.0-1PGSTY.el8.aarch64.rpm
| PIGSTY 1.0 el8.aarch64.pg15 : vgram_15 vgram_15-1.0-1PGSTY.el8.aarch64.rpm
| PIGSTY 1.0 el8.aarch64.pg14 : vgram_14 vgram_14-1.0-1PGSTY.el8.aarch64.rpm
|
| el9.x86_64 | PIGSTY 1.0 el9.x86_64.pg18 : vgram_18 vgram_18-1.0-1PGSTY.el9.x86_64.rpm
| PIGSTY 1.0 el9.x86_64.pg17 : vgram_17 vgram_17-1.0-1PGSTY.el9.x86_64.rpm
| PIGSTY 1.0 el9.x86_64.pg16 : vgram_16 vgram_16-1.0-1PGSTY.el9.x86_64.rpm
| PIGSTY 1.0 el9.x86_64.pg15 : vgram_15 vgram_15-1.0-1PGSTY.el9.x86_64.rpm
| PIGSTY 1.0 el9.x86_64.pg14 : vgram_14 vgram_14-1.0-1PGSTY.el9.x86_64.rpm
|
| el9.aarch64 | PIGSTY 1.0 el9.aarch64.pg18 : vgram_18 vgram_18-1.0-1PGSTY.el9.aarch64.rpm
| PIGSTY 1.0 el9.aarch64.pg17 : vgram_17 vgram_17-1.0-1PGSTY.el9.aarch64.rpm
| PIGSTY 1.0 el9.aarch64.pg16 : vgram_16 vgram_16-1.0-1PGSTY.el9.aarch64.rpm
| PIGSTY 1.0 el9.aarch64.pg15 : vgram_15 vgram_15-1.0-1PGSTY.el9.aarch64.rpm
| PIGSTY 1.0 el9.aarch64.pg14 : vgram_14 vgram_14-1.0-1PGSTY.el9.aarch64.rpm
|
| el10.x86_64 | PIGSTY 1.0 el10.x86_64.pg18 : vgram_18 vgram_18-1.0-1PGSTY.el10.x86_64.rpm
| PIGSTY 1.0 el10.x86_64.pg17 : vgram_17 vgram_17-1.0-1PGSTY.el10.x86_64.rpm
| PIGSTY 1.0 el10.x86_64.pg16 : vgram_16 vgram_16-1.0-1PGSTY.el10.x86_64.rpm
| PIGSTY 1.0 el10.x86_64.pg15 : vgram_15 vgram_15-1.0-1PGSTY.el10.x86_64.rpm
| PIGSTY 1.0 el10.x86_64.pg14 : vgram_14 vgram_14-1.0-1PGSTY.el10.x86_64.rpm
|
| el10.aarch64 | PIGSTY 1.0 el10.aarch64.pg18 : vgram_18 vgram_18-1.0-1PGSTY.el10.aarch64.rpm
| PIGSTY 1.0 el10.aarch64.pg17 : vgram_17 vgram_17-1.0-1PGSTY.el10.aarch64.rpm
| PIGSTY 1.0 el10.aarch64.pg16 : vgram_16 vgram_16-1.0-1PGSTY.el10.aarch64.rpm
| PIGSTY 1.0 el10.aarch64.pg15 : vgram_15 vgram_15-1.0-1PGSTY.el10.aarch64.rpm
| PIGSTY 1.0 el10.aarch64.pg14 : vgram_14 vgram_14-1.0-1PGSTY.el10.aarch64.rpm
|
| d12.x86_64 | PIGSTY 1.0 d12.x86_64.pg18 : postgresql-18-vgram postgresql-18-vgram_1.0-1PGSTY~bookworm_amd64.deb
| PIGSTY 1.0 d12.x86_64.pg17 : postgresql-17-vgram postgresql-17-vgram_1.0-1PGSTY~bookworm_amd64.deb
| PIGSTY 1.0 d12.x86_64.pg16 : postgresql-16-vgram postgresql-16-vgram_1.0-1PGSTY~bookworm_amd64.deb
| PIGSTY 1.0 d12.x86_64.pg15 : postgresql-15-vgram postgresql-15-vgram_1.0-1PGSTY~bookworm_amd64.deb
| PIGSTY 1.0 d12.x86_64.pg14 : postgresql-14-vgram postgresql-14-vgram_1.0-1PGSTY~bookworm_amd64.deb
|
| d12.aarch64 | PIGSTY 1.0 d12.aarch64.pg18 : postgresql-18-vgram postgresql-18-vgram_1.0-1PGSTY~bookworm_arm64.deb
| PIGSTY 1.0 d12.aarch64.pg17 : postgresql-17-vgram postgresql-17-vgram_1.0-1PGSTY~bookworm_arm64.deb
| PIGSTY 1.0 d12.aarch64.pg16 : postgresql-16-vgram postgresql-16-vgram_1.0-1PGSTY~bookworm_arm64.deb
| PIGSTY 1.0 d12.aarch64.pg15 : postgresql-15-vgram postgresql-15-vgram_1.0-1PGSTY~bookworm_arm64.deb
| PIGSTY 1.0 d12.aarch64.pg14 : postgresql-14-vgram postgresql-14-vgram_1.0-1PGSTY~bookworm_arm64.deb
|
| d13.x86_64 | PIGSTY 1.0 d13.x86_64.pg18 : postgresql-18-vgram postgresql-18-vgram_1.0-1PGSTY~trixie_amd64.deb
| PIGSTY 1.0 d13.x86_64.pg17 : postgresql-17-vgram postgresql-17-vgram_1.0-1PGSTY~trixie_amd64.deb
| PIGSTY 1.0 d13.x86_64.pg16 : postgresql-16-vgram postgresql-16-vgram_1.0-1PGSTY~trixie_amd64.deb
| PIGSTY 1.0 d13.x86_64.pg15 : postgresql-15-vgram postgresql-15-vgram_1.0-1PGSTY~trixie_amd64.deb
| PIGSTY 1.0 d13.x86_64.pg14 : postgresql-14-vgram postgresql-14-vgram_1.0-1PGSTY~trixie_amd64.deb
|
| d13.aarch64 | PIGSTY 1.0 d13.aarch64.pg18 : postgresql-18-vgram postgresql-18-vgram_1.0-1PGSTY~trixie_arm64.deb
| PIGSTY 1.0 d13.aarch64.pg17 : postgresql-17-vgram postgresql-17-vgram_1.0-1PGSTY~trixie_arm64.deb
| PIGSTY 1.0 d13.aarch64.pg16 : postgresql-16-vgram postgresql-16-vgram_1.0-1PGSTY~trixie_arm64.deb
| PIGSTY 1.0 d13.aarch64.pg15 : postgresql-15-vgram postgresql-15-vgram_1.0-1PGSTY~trixie_arm64.deb
| PIGSTY 1.0 d13.aarch64.pg14 : postgresql-14-vgram postgresql-14-vgram_1.0-1PGSTY~trixie_arm64.deb
|
| u22.x86_64 | PIGSTY 1.0 u22.x86_64.pg18 : postgresql-18-vgram postgresql-18-vgram_1.0-1PGSTY~jammy_amd64.deb
| PIGSTY 1.0 u22.x86_64.pg17 : postgresql-17-vgram postgresql-17-vgram_1.0-1PGSTY~jammy_amd64.deb
| PIGSTY 1.0 u22.x86_64.pg16 : postgresql-16-vgram postgresql-16-vgram_1.0-1PGSTY~jammy_amd64.deb
| PIGSTY 1.0 u22.x86_64.pg15 : postgresql-15-vgram postgresql-15-vgram_1.0-1PGSTY~jammy_amd64.deb
| PIGSTY 1.0 u22.x86_64.pg14 : postgresql-14-vgram postgresql-14-vgram_1.0-1PGSTY~jammy_amd64.deb
|
| u22.aarch64 | PIGSTY 1.0 u22.aarch64.pg18 : postgresql-18-vgram postgresql-18-vgram_1.0-1PGSTY~jammy_arm64.deb
| PIGSTY 1.0 u22.aarch64.pg17 : postgresql-17-vgram postgresql-17-vgram_1.0-1PGSTY~jammy_arm64.deb
| PIGSTY 1.0 u22.aarch64.pg16 : postgresql-16-vgram postgresql-16-vgram_1.0-1PGSTY~jammy_arm64.deb
| PIGSTY 1.0 u22.aarch64.pg15 : postgresql-15-vgram postgresql-15-vgram_1.0-1PGSTY~jammy_arm64.deb
| PIGSTY 1.0 u22.aarch64.pg14 : postgresql-14-vgram postgresql-14-vgram_1.0-1PGSTY~jammy_arm64.deb
|
| u24.x86_64 | PIGSTY 1.0 u24.x86_64.pg18 : postgresql-18-vgram postgresql-18-vgram_1.0-1PGSTY~noble_amd64.deb
| PIGSTY 1.0 u24.x86_64.pg17 : postgresql-17-vgram postgresql-17-vgram_1.0-1PGSTY~noble_amd64.deb
| PIGSTY 1.0 u24.x86_64.pg16 : postgresql-16-vgram postgresql-16-vgram_1.0-1PGSTY~noble_amd64.deb
| PIGSTY 1.0 u24.x86_64.pg15 : postgresql-15-vgram postgresql-15-vgram_1.0-1PGSTY~noble_amd64.deb
| PIGSTY 1.0 u24.x86_64.pg14 : postgresql-14-vgram postgresql-14-vgram_1.0-1PGSTY~noble_amd64.deb
|
| u24.aarch64 | PIGSTY 1.0 u24.aarch64.pg18 : postgresql-18-vgram postgresql-18-vgram_1.0-1PGSTY~noble_arm64.deb
| PIGSTY 1.0 u24.aarch64.pg17 : postgresql-17-vgram postgresql-17-vgram_1.0-1PGSTY~noble_arm64.deb
| PIGSTY 1.0 u24.aarch64.pg16 : postgresql-16-vgram postgresql-16-vgram_1.0-1PGSTY~noble_arm64.deb
| PIGSTY 1.0 u24.aarch64.pg15 : postgresql-15-vgram postgresql-15-vgram_1.0-1PGSTY~noble_arm64.deb
| PIGSTY 1.0 u24.aarch64.pg14 : postgresql-14-vgram postgresql-14-vgram_1.0-1PGSTY~noble_arm64.deb
|
| u26.x86_64 | PIGSTY 1.0 u26.x86_64.pg18 : postgresql-18-vgram postgresql-18-vgram_1.0-1PGSTY~resolute_amd64.deb
| PIGSTY 1.0 u26.x86_64.pg17 : postgresql-17-vgram postgresql-17-vgram_1.0-1PGSTY~resolute_amd64.deb
| PIGSTY 1.0 u26.x86_64.pg16 : postgresql-16-vgram postgresql-16-vgram_1.0-1PGSTY~resolute_amd64.deb
| PIGSTY 1.0 u26.x86_64.pg15 : postgresql-15-vgram postgresql-15-vgram_1.0-1PGSTY~resolute_amd64.deb
| PIGSTY 1.0 u26.x86_64.pg14 : postgresql-14-vgram postgresql-14-vgram_1.0-1PGSTY~resolute_amd64.deb
|
| u26.aarch64 | PIGSTY 1.0 u26.aarch64.pg18 : postgresql-18-vgram postgresql-18-vgram_1.0-1PGSTY~resolute_arm64.deb
| PIGSTY 1.0 u26.aarch64.pg17 : postgresql-17-vgram postgresql-17-vgram_1.0-1PGSTY~resolute_arm64.deb
| PIGSTY 1.0 u26.aarch64.pg16 : postgresql-16-vgram postgresql-16-vgram_1.0-1PGSTY~resolute_arm64.deb
| PIGSTY 1.0 u26.aarch64.pg15 : postgresql-15-vgram postgresql-15-vgram_1.0-1PGSTY~resolute_arm64.deb
| PIGSTY 1.0 u26.aarch64.pg14 : postgresql-14-vgram postgresql-14-vgram_1.0-1PGSTY~resolute_arm64.deb
|
Build
You can build the RPM / DEB packages for vgram using pig build:
Install
You can install vgram directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Create Extension:
Usage
Sources:
vgram accelerates LIKE and ILIKE substring searches with GIN indexes built from variable-length q-grams. Unlike fixed trigrams, it learns frequent short grams from the target corpus and indexes longer or rarer grams, which can improve selectivity for a particular data distribution.
Build a Corpus-Specific Index
Version 1.0 requires PostgreSQL 13 or later. In psql, collect frequent grams, save the result, and pass it to the vgram_gin_ops options:
minq and maxq bound extracted gram lengths. The threshold passed to qgram_stat() marks grams at or above that corpus frequency as too common to index. Use get_vgrams() to inspect extraction for a candidate value and learned gram array.
Objects and Advanced Statistics
qgram_stat(text, int, int, float8)aggregates frequent q-grams.get_vgrams(text, int, int, text[])shows the grams selected for text.vgram_gin_opsindexes ordinarytextforLIKEandILIKE.vgram_textis text-compatible but installs custom frequency statistics and selectivity estimation.vgram_gin_ops2is the GIN operator class forvgram_text.
Maintenance Boundaries
The learned option array is embedded in the index definition and can be very large. It reflects the sample at build time; major language or distribution changes require new statistics, comparison of recall/plans, and usually REINDEX or a replacement index. GIN candidates are rechecked, but overly common or too-short patterns may still fall back to broad scans. Benchmark build time, index size, write amplification, pending-list behavior, VACUUM, collation, multibyte text, case folding, and planner estimates. Keep the training query and parameters reproducible so replicas and rebuilt environments use the same operator-class options.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)