All posts
Data Platform

Search in Postgres Without Elasticsearch: Full-Text, Trigram and ILIKE, Measured

By

November 9, 2026

7 min read

A trigram index took an address search on 5 million rows from 2.7 s to 95 ms. On a million documents of common words, the same kind of index made a phrase search slower than no index at all (1.8 s against 1.2 s), while full-text search answered in 263 ms. When each one works, with build times and sizes.

Benchmark
Postgres Performance
Search
Address substring, 5M rows2.7 s95 msn/aCommon-word phrase, 1M docs1.2 s1.8 s263 ms

ILIKE, no index

Trigram index

Full-text (tsvector + GIN)

Median search time (log scale). Left: a distinctive substring in 5 million addresses. Right: three common words in 1 million documents. Our measurements, November 2026.

The data
ILIKE, no indexTrigram indexFull-text (tsvector + GIN)
Address substring, 5M rows2.7 s95 ms—
Common-word phrase, 1M docs1.2 s1.8 s263 ms

Same index type, opposite results. The full report explains why, with index build times, sizes and the cost of adding a generated tsvector column to a million rows.

Deciding whether you need a search service?

We'll test your actual queries against Postgres with you. 30 minutes, free.

hoolco Monthly Review

Once a month: what changed in tech that month and what it means for you, from cloud and AI to security and the tools you build with. Every item links to its source. No sales pitch, unsubscribe in one click.

As of November 9, 2026. Provided as is, for general information, and accurate to the best of our knowledge on the date shown. Not legal, compliance, tax, financial or other professional advice. Prices, limits and vendor services change; check current vendor documentation before relying on anything here. Terms of use.