Fast Full-Text Search in PostgreSQL

Progress isn’t made by early risers. It’s made by lazy men trying to find easier ways to do something.

– Robert A. Heinlein

This is especially true when discussing databases. Often when discussing text search, the first thing that comes to mind is ElasticSearch – indeed it’s a great product, works well, but can often be a pain to setup and maintain. PostgreSQL in contrast dead simple to set up, runs anywhere, is easy to maintain and probably is “good enough”.

Why Full-Text Search in PostgreSQL

It’s easy to setup, maintain, and there’s already an effective deployment pattern in companies.

I run a company called MetaCortex, where all of our products are focused on understanding how people think. Almost exclusively, our processed data[1] is stored in PostgreSQL databases. Our website, for instance, uses it exclusively – even though daily we process tens of thousands of comments, with millions of database inserts & reads.

It’s often said, that there are better options for full-text search and technically, that’s true! However, pragmatism is often an engineers best friend and PostgreSQL is easy for us – as the option is almost always available.