Peter Elm Wood

Software Developer & Technology Enthusiast

Database Query Assessment Tool

Explore Text Search Strategies

This interactive demo allows you to compare different PostgreSQL text search strategies in real-time. Each strategy has different performance characteristics and use cases. Try searching with different terms to see how they behave!

About the Search Strategies

LIKE contains (ILIKE %q%)

Baseline substring search. Uses sequential scan unless trigram index helps. Good for simple contains queries.

LIKE prefix (ILIKE q%)

Prefix search that can use btree index with text_pattern_ops. Efficient for "starts with" queries.

Startswith via left(text, n)

Teaching moment: Using functions on columns often defeats index usage. Usually slower than direct LIKE prefix.

Trigram similarity

Uses pg_trgm extension for fuzzy matching. Great for typo tolerance and similarity-based ranking.

Full-text search

Token-based search using PostgreSQL's built-in full-text search. Excellent for word-based queries, supports stemming and ranking.