hn.today

Tin: A Text INdex for Postgres

planetscale.com15 points0 comments
Screenshot of Tin: A Text INdex for Postgres

PlanetScale introduces TIN, a Postgres extension that implements a full-featured, transactional full-text index designed to support boolean, phrase and span queries; fuzzy, wildcard and regex term matching; case and accent folding; BM25 top-k ranking and exact COUNTs. It’s built to integrate with Postgres semantics - joins, complex WHERE clauses, MVCC visibility, continuous updates, replication and backups - claiming to fill gaps left by existing Postgres text indexes while remaining production-safe and immediately usable via CREATE INDEX ... USING tin(...).

Benchmarks used multiple corpora (Stack Exchange export for the published numbers, plus Wikipedia, Reddit and a “pile” mix) on Postgres 18.6 in an 8-vCPU/32 GB RAM container on an AWS i7i.8xlarge. Index build for the 85 GB Stack Exchange export took 8m10s and produced a 50.7 GB index with 32 GB RAM; comparable engines required more time or memory (ParadeDB 19m20s/52.1 GB/64 GB, pg_textsearch 26m49s/41.5 GB/128 GB, GIN 2h9m/28 GB/64 GB). In query benchmarks TIN massively outperformed competitors: for mixed top-10 workloads it delivered ~25× the QPS and ~26× lower p99 latency than ParadeDB; for conjunction/phrase queries ~10× better than ParadeDB and ~541× than GIN (p99s 6× and 1,356× lower); and under disjunction with concurrent writes it handled 36×-57× more queries than pg_textsearch/ParadeDB with far lower p99s, while reading far fewer MB/query - explaining much of its throughput and cache-friendliness.

Read on planetscale.com0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Web

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.