Around the world with extensions
summary
pg_stat_statments records parameterized queries and reports total and average times so slow or N+1 queries surface quickly; at Heroku scale (about 1.5 million databases) a one‑in‑a‑million problem shows up daily. pg_stat_statments enables per‑tenant billing when extended. HyperLogLog stores tiny sketches for approximate uniques and supports union/aggregation (5+10 ≈ 13). Citus shards by hash (recommend powers like 32/128) and fans queries to shards; Timescale creates hypertables for time series, and pg_partman automates native partition creation and retention. Foreign data wrappers push predicates or expose external indexes (Redis, Elasticsearch/Zombo).
AI-written summary · about
chapters (19)
- 0:00Start
- 1:21What are extensions
- 9:46HyperLogLog
- 13:20Some best practices
- 13:45Tuning parameters
- 14:38Common use cases
- 18:03Timescale
- 21:51pg_partman
- 24:13Why not native partitioning.
- 24:47Citus
- 25:09What is sharding
- 26:50Don't just route values
- 27:01Create range of hash values
- 27:29How does sharding work
- 27:41Distributing data
- 28:16Real-time executor
- 30:12Create foreign server
- 31:24Postgres is more than Postgre
- 32:15Honorable mentions
