HeadlinesBriefing favicon HeadlinesBriefing.com

Introducing TIN: Full-Text Search for Postgres GA Release

Hacker News •
×

One of the Postgres features our customers ask us for the most is full-text search. Today, we are excited to announce TIN: a fast, full-featured, reliable full-text search extension for Postgres. TIN stands for "Text INdex," and that is what it does.

TIN is available immediately as a GA release for all Postgres and Neki databases. Check it out: CREATE INDEX an_index_name ON table_name USING tin(text_column_name); SELECT * FROM table_name WHERE text_column_name ==> 'some words'. We built TIN because we believe a good text index should support: Boolean expressions, phrase queries, and span queries.

Fuzzy, wildcard, and regular-expression matching for terms. Case and accent folding. COUNT(*) queries and BM25-scored top-k queries.

A good text index in Postgres must support all of those requirements while also handling joins, complicated WHERE clauses across full-text and other column types, continuous updates, replication, backups, and correct transaction visibility. Although there are at least three existing text-search indexes for Postgres already, none of them met all of those requirements. TIN does.

TIN is also really, mind-blowingly fast. We ran benchmarks to assess performance for all the above use cases and more. We tried workloads with conjunction, disjunction, and phrase queries and a mix of all three.

That count documents or that ask for the top k by BM25 score. With and without clients writing new data to the index concurrently with the benchmark query workload. We have measured TIN against a variety of text corpora: all of Wikipedia, a collection of Reddit comments totaling 2.3 TB, and a mixed workload we call simply "pile" with 797 GB of open-access research papers, legal documents, public domain books, and Enron emails.

The benchmark results we share in this article are from an export of questions and answers from Stack Exchange: an 85 GB corpus with 150 million documents.