Home / Companies / GitLab / Blog / Post Details
Content Deep Dive

Fast Search Using PostgreSQL Trigram Text Indexes

Blog post from GitLab

Post Details
Company
Date Published
Author
Yorick Peterse
Word Count
1,439
Company Posts That Month
17
Language
English
Hacker News Points
-
Post removed?
No
Summary

GitLab 8.6 introduces improved search performance for PostgreSQL by utilizing trigram indexes, which break text into sequences of three letters and can be used with LIKE and ILIKE conditions without altering existing queries. This enhancement significantly speeds up search queries, such as reducing execution time from 160 milliseconds to 0.2 milliseconds by creating a GIN index with the appropriate operator class gin_trgm_ops. The article also compares the limitations of traditional LIKE queries and full-text search methods in PostgreSQL and MySQL, explaining how trigram indexes offer a more efficient alternative without the complexity of full-text search systems. GitLab has implemented specific changes to ensure compatibility with MySQL, which does not support GIN indexes, by modifying schema handling and query syntax to optimize for PostgreSQL's capabilities. This update underscores the substantial improvements in search query performance and the strategic adaptations made to maintain cross-database compatibility.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.