SupabasevictorBenchmark
Postgres Full Text Search vs the rest
Summary
The post compares PostgreSQL Full Text Search with dedicated search engines including MeiliSearch, OpenSearch, SQLite FTS, and Typesense, asking whether a separate system is justified for common application search. It presents a PostgreSQL setup using a generated stored column built with to_tsvector('english', ...) and a GIN index, queried with websearch_to_tsquery. The benchmark loads a movie dataset and focuses on query speed after data ingestion, using comparable scripts and default configurations with limited tuning. PostgreSQL was close in performance to several alternatives; in-memory SQLite was fastest, while Typesense and MeiliSearch handled misspellings correctly and OpenSearch ingested data quickly. The conclusion is that PostgreSQL can provide good-enough search quality and speed for basic cases without adding another system, although dedicated engines offer capabilities PostgreSQL does not.
Context
The comparison asks whether applications that already use PostgreSQL should add a dedicated search engine such as MeiliSearch, OpenSearch, SQLite FTS, or Typesense. It focuses on the trade-off between PostgreSQL's simpler integration and the search capabilities and performance of specialized systems, using minimal setup and tuning.
Approach / What changed
The post reviews PostgreSQL's basic LIKE matching and built-in Full Text Search, then configures a generated stored tsvector column over movie title and overview fields with a GIN index. It converts a movie dataset to newline-delimited JSON, loads comparable documents into each system, and measures end-user query speed after ingestion, largely using default configurations. It also compares result behavior, including misspelling handling.
Takeaways
PostgreSQL Full Text Search can combine fields into a generated tsvector column and use a GIN index for faster searches; queries can be issued with websearch_to_tsquery.
In the reported small movie dataset, in-memory SQLite was fastest and PostgreSQL was not far behind, while PostgreSQL was generally close in performance to several other systems in their default configurations.
Typesense and MeiliSearch handled the misspelled “suprman” query, whereas OpenSearch’s default configuration did not index misspellings; Typesense’s match strictness is configurable.
Source and freshness
- Source
- supabase.com
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.