Search Tiers
Understand the LITE, STANDARD, ADVANCED, and VECTOR search tiers in pg-smart-search and how they scale with your data.
Search Tiers
Search performance heavily depends on how your database is indexed. pg-smart-search categorizes search capabilities into four tiers based on dataset size and required indices.
Tier Overview
| Tier | Dataset Size | Engine Features | Indices Required |
|---|---|---|---|
| LITE | < 100k rows | Basic ILIKE | None |
| STANDARD | 100k - 1M rows | Hedged FTS + ILIKE/trigram | GIN (FTS) + GiST/GIN (trigram) |
| ADVANCED | > 1M rows | word_similarity ranking | GiST/GIN pg_trgm (not RUM) |
| VECTOR | Semantic | OpenAI/Gemini + pgvector (HNSW) | pgvector HNSW |
The CLI's ADVANCED-tier setup still generates a CREATE EXTENSION rum / USING RUM
index, and it's tempting to assume ADVANCED is "GIN/GiST but faster via RUM." In
practice AdvancedStrategy's query computes word_similarity() per candidate row and
sorts in memory (ORDER BY ... DESC) — no index type, RUM included, can serve that
ordering directly. What actually accelerates this tier is the <% trigram operator's
index pre-filter, which needs a standard GiST/GIN gist_trgm_ops/gin_trgm_ops index,
not RUM. RUM also isn't a standard Postgres contrib module and may not be installable on
your instance. See CLI & Migrations.
Choosing a Tier
- LITE: Best for admin panels, small internal tools, or early-stage MVPs. Requires zero database migrations.
- STANDARD: The sweet spot for most web applications. Hedges a Turbo-Mode FTS query against a combined ILIKE/trigram query and returns whichever finds results first.
- ADVANCED: For datasets where STANDARD's pre-filter still lets too many candidate rows through — trades a wider trigram-indexed pre-filter for an in-memory
word_similarity()sort (see callout above; it is not an index-served sort). - VECTOR: Semantic ("meaning of the query") search via embeddings — this tier is exclusive, not layered on top of FTS/trigram; it doesn't run alongside another tier for the same call.
You can generate (not fully automate — see CLI & Migrations) the required indices for your tier using the interactive CLI.
Architecture & Parallel Fast-Track
Deep dive into how pg-smart-search executes queries concurrently and cancels zombie queries. Actual latency depends on your hardware and dataset — see Benchmarks.
Smart Hybrid Fallback
Learn how pg-smart-search gracefully degrades from FTS to ILIKE, Trigram Fuzzy, and Keyboard Layout Correction.