---
title: "Going deep into trigram-based text search"
publication: "Postgres Weekly"
issue: 443
published_at: "2022-02-23"
canonical_url: "https://postgresweekly.com/issues/443"
---

Plus a new zero-downtime schema changing approach. |        

#​443 — February 23, 2022 

[Web Version](https://postgresweekly.com/issues/443)   

Postgres Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/cmaqkkk8kwruyhmux7bp.jpg)](https://alexklibisz.com/2022/02/18/optimizing-postgres-trigram-search.html)  

⭐️ [Optimizing Postgres Text Search with Trigrams](https://alexklibisz.com/2022/02/18/optimizing-postgres-trigram-search.html) — A particularly thorough tutorial on using Postgres’s core [pg_trgm module](https://www.postgresql.org/docs/14/pgtrgm.html) for both precise and fuzzy textual searching (as opposed to FTS). So much depth here I think few would fail to learn something useful – I didn’t know you could customize the precision of GiST indexes, for example. I hope Alex writes more in future! 

Alex Klibisz   [![\](https://copm.s3.amazonaws.com/8686982a.png)](https://crunchybridge.com/start?utm_source=cp-pg&utm_medium=em) 

[🐘 The Developer Experience You Always Wanted for Postgres](https://crunchybridge.com/start?utm_source=cp-pg&utm_medium=em) — Database as a service for Postgres as it should be. Cloud agnostic, superuser access, performance tuned instances, and packed with all the extensions you need. From the Crunchy Data team that’s 100% focused on Postgres at any scale. Try it today. 

Crunchy Bridge sponsor   

[The Queries in PostgreSQL Series: Query Execution Stages](https://postgrespro.com/blog/pgsql/5969262) — Well known for their extensive articles on Postgres index types (like [this one on Btree](https://postgrespro.com/blog/pgsql/4161516)), Egor is back with a new series digging into the execution of queries. Lots to learn here. 

Egor Rogov   

[Timescale Raises $110M in Series C Funding Round](https://www.timescale.com/blog/year-of-the-tiger-110-million-to-build-the-future-of-data-for-developers-worldwide/) — [TimescaleDB](https://github.com/timescale/timescaledb) is an open source (but backed by a company offering commercial services) time series oriented extension for Postgres that has become popular in recent years. The company behind it (and, disclosure, occasional sponsor of this newsletter) has announced a major fundraising round and shares some of its plans here, including contributions to the Postgres project overall, so hopefully the entire ecosystem wins. 

Timescale Blog   

[Monitoring Google Cloud PostgreSQL with `pgwatch2`](https://www.cybertec-postgresql.com/en/monitoring-google-cloud-postgresql-with-pgwatch2/) — [pgwatch2](https://pgwatch2.readthedocs.io/en/latest/README.html) is a Postgres monitoring tool and while it can be tricky to make external tools work against managed cloud services, it’s totally possible here. 

Kaarel Moppel   

[eBook: Best-Practices for Speeding Up Postgres Queries](https://pganalyze.com/ebooks/optimizing-postgres-query-performance?utm_source=PostgresWeeklySecondary02232022) 

pganalyze sponsor   

[Table Size in YugabyteDB, PostgreSQL and Oracle](https://dev.to/yugabyte/table-size-in-yugabytedb-postgresql-and-oracle-19m) — [YugabyteDB](https://www.yugabyte.com/) is one of those (many) databases that isn’t Postgres but _speaks the language_. Since it takes a different approach in various areas, the amount of disk space it uses for equivalent data can be different too, and Franck shows by just how much in this test. 

Franck Pachot   

[pg-osc: Zero Downtime Schema Changes in Postgres](https://www.shayon.dev/post/2022/47/pg-osc-zero-downtime-schema-changes-in-postgresql/) — pg-osc is a tool (written in Ruby) for making non-blocking, zero downtime schema changes by way of ‘shadow tables.’ This post provides a quick introduction. [GitHub repo](https://github.com/shayonj/pg-osc). 

Shayon Mukherjee   

**In brief:** 

- A [quick look at work on Zstd support](https://www.phoronix.com/scan.php?page=news_item&px=PostgreSQL-ZStd-Start#pgzstd) coming to Postgres.
- The [explain.depesz.com](https://explain.depesz.com/) EXPLAIN ANALYZE viewer [now has a handy 'hints' section](https://www.depesz.com/2022/02/16/explain-depesz-com-now-with-hints/) which, unsurprisingly, can give you some help in improving your query, indexes, or settings.    

**Got a new email?** You can [change your address here](https://postgresweekly.com/edit_subscription/*|UID|*). 

--- 

**Bored of us?** [Click here to stop getting Postgres Weekly](https://postgresweekly.com/leave/*|UID|*). 

--- 

**Got a link for us?** Reply and tell us. We can't include everything but we'll look at anything you send. Thanks! 

--- 

Published by Cooper Press Ltd.
Fairfield Enterprise Centre, Louth, LN11 0LS, United Kingdom 

Postgres, PostgreSQL and the Slonik Logo are trademarks or registered trademarks of the PostgreSQL Community Association of Canada. 

[Stop getting this newsletter.](https://postgresweekly.com/leave/*|UID|*)
