Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Supabase 11 min read Research mediumAdept

Postgres Full Text Search vs the rest

Postgres built-in full text search, using a generated tsvector column with a GIN index and websearch_to_tsquery, performs close to dedicated engines like Typesense, MeiliSearch, OpenSearch and SQLite FTS5 in default configurations on a small movie dataset. Most queries return in a few milliseconds on Postgres. In-memory SQLite was fastest. Only Typesense and MeiliSearch handled misspellings such as "suprman". For basic search needs, Postgres FTS is good enough and adds no new systems to the stack, while dedicated engines offer typo tolerance, prefix search and richer relevancy tuning.

Related posts

  • Comparing Native Postgres, ElasticSearch, and pg_search for Full-Text Search

    Neon mediumAdept

    Native Postgres full-text search (tsvector/tsquery with GIN indexes) breaks down at scale because ranking by ts_rank must score every matching row and lacks BM25, fuzzy matching and per-field relevance. ElasticSearch fixes search quality and speed but adds a second source of truth, a sync pipeline, eventual consistency and heavy cluster operations. pg_search, a Rust extension built on Tantivy, embeds a BM25 inverted index inside Postgres with transactional updates, fuzzy and phrase queries, snippets and aggregations. On a 10-million-row benchmark it beat native FTS by 20-1000x (e.g. top-N ranked results in 81ms vs 38.8s), and it is pitched for datasets that fit on a single Postgres instance.

  • TIN v1.0.6: 2-3x faster, with support for stemming

    PlanetScale mediumAdept

    TIN v1.0.6, PlanetScale's Postgres full-text search index, adds Snowball-based stemming for 18 languages via the rust_stemmers crate and extends its block-max top-k plan to queries with heap-attribute tiebreakers in ORDER BY. On a 150M-document Stack Exchange benchmark, default TIN delivers 3.1-5.0x higher throughput and 2.7-4.4x lower p99 latency than ParadeDB 0.26.0 on x86-64, and still wins when scoring all terms via tin.full_score. Default scoring skips terms appearing in over 10% of documents, which is tunable per query with dense_ratio. x86-64 with AVX-512 is notably faster than Graviton4 for text search, and stemming requires an index rebuild while the speedups do not.

  • pg_search is Available on Neon

    Neon mediumAdept

    ParadeDB's pg_search extension, now available on Neon in AWS regions, adds a Tantivy-powered BM25 inverted index to Postgres, bringing relevance ranking, fuzzy matching, faceting, highlighting and JSON-aware search that native tsvector/GIN full-text search lacks. The BM25 index is a covering index across multiple columns, so filters and aggregations are pushed into a single index scan, and it is MVCC-integrated so new data is searchable on commit without ETL. On a 10-million-row log dataset, it built faster than a GIN index (1.63 vs 2.60 min) but was larger (647 vs 176 MB). It beat a GIN/B-tree-tuned Postgres on every query tested, with the largest gains on ranked top-N, count and filtered queries, e.g. 81 ms vs 38.8 s for BM25-ranked top-10.

  • Build Your Own Full-Text Search CMS with Neon and pg_search

    Neon mediumAdept

    A minimal CMS built on Postgres with Next.js, Prisma and Zod, using the pg_search extension's BM25 index for full-text search instead of a hosted CMS. Search runs as a three-stage cascade: BM25 keyword search with title/body score boosts (2x title, 2.5x both), then phrase search with slop for multi-word queries, then fuzzy Levenshtein matching whose edit distance scales with query length (1–3). Raw SQL goes through Neon's serverless driver because Prisma can't express pg_search operators, and paradedb.snippet supplies highlighted excerpts. Neon has since deprecated pg_search for new projects.

  • 20x faster than pgvector: introducing pg_embedding extension for vector search in Postgres and LangChain

    Neon mediumAdept

    pg_embedding brought HNSW graph-based approximate nearest neighbor indexing to Postgres. On the GIST-960 dataset (1M 960-dim vectors, k=100, 4 vCPU/16 GB), it ran 5–30x faster than pgvector's IVFFlat at equal recall. IVFFlat needs more probes to raise recall and drifts toward a sequential scan, while HNSW's layered graph gives roughly logarithmic search. HNSW trades higher memory use, slower index builds (driven by efConstruction) and L2-only distance for that speed. Neon has since deprecated pg_embedding in favor of pgvector, which now supports HNSW natively.

The quest for software engineering knowledge.

Look:
Layout: