Postgres FM

Postgres FM

By Nikolay Samokhvalov and Michael ChristofidesNewsTechnologyTech News
Download on the App Store

All Postgres FM episodes

  • Snapshots

    Nikolay talks Michael through using cloud snapshots — how they can be used to reduce RTO for huge Postgres setups, also to improve provisioning time, and some major catches to be aware of.
     
    Here are some links to things they mentioned:

    • Snapshots on RDS https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreateSnapshot.html
    • pgBackRest https://pgbackrest.org
    • WAL-G https://github.com/wal-g/wal-g
    • pg_backup_start and pg_backup_stop (docs) https://www.postgresql.org/docs/current/functions-admin.html#FUNCTIONS-ADMIN-BACKUP 
    • How to troubleshoot long Postgres startup (by Nikolay) https://gitlab.com/postgres-ai/postgresql-consulting/postgres-howtos/-/blob/main/0003_how_to_troubleshoot_long_startup.md
    • Restoring to a DB instance (RDS docs mentioning lazy loading) https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_RestoreFromSnapshot.html
    •  Amazon EBS fast snapshot restore https://docs.aws.amazon.com/ebs/latest/userguide/ebs-fast-snapshot-restore.html
    • Our 100th episode “To 100TB, and beyond!” https://postgres.fm/episodes/to-100tb-and-beyond 


    ~~~

    What did you like or not like? What should we discuss next time? Let us know via a YouTube comment, on social media, or by commenting on our Google doc!


    ~~~

    Postgres FM is produced by:

    • Michael Christofides, founder of pgMustard
    • Nikolay Samokhvalov, founder of Postgres.ai


    With credit to:

    • Jessie Draws for the elephant artwork
    45 min
  • GIN Indexes

    Nikolay and Michael discuss GIN indexes in Postgres — what they are, what they're used for, and some limitations to be aware of.
     
    Here are some links to things they mentioned:

    • GIN Indexes https://www.postgresql.org/docs/current/gin.html
    • Generalized Search Trees for Database Systems (Hellerstein, Naughton, Pfeffer) https://dsf.berkeley.edu/papers/vldb95-gist.pdf 
    • RUM extension https://pgxn.org/dist/rum/1.1.0/
    • Understanding Postgres GIN Indexes: The Good and the Bad (Lukas Fittl) https://pganalyze.com/blog/gin-index


    ~~~

    What did you like or not like? What should we discuss next time? Let us know via a YouTube comment, on social media, or by commenting on our Google doc!


    ~~~

    Postgres FM is produced by:

    • Michael Christofides, founder of pgMustard
    • Nikolay Samokhvalov, founder of Postgres.ai


    With credit to:

    • Jessie Draws for the elephant artwork
    41 min
  • Best Practices

    Nikolay and Michael use a recent "best practices" article as a prompt — giving a few tips each on the topics mentioned, like schema design, performance, backups, and more.
     
    Here are some links to things they mentioned:

    • 7 Crucial PostgreSQL Best Practices (recent blog post) https://speakdatascience.com/postgresql-best-practices
    • “Don't do this” episode https://postgres.fm/episodes/dont-do-this
    • Article discussion on Hacker News https://news.ycombinator.com/item?id=42992913
    • Mozilla’s SQL Style Guide https://docs.telemetry.mozilla.org/concepts/sql_style
    • “SQL vs NoSQL” episode with Franck Pachot https://postgres.fm/episodes/sql-vs-nosql
    • HA episode https://postgres.fm/episodes/high-availability 


    ~~~

    What did you like or not like? What should we discuss next time? Let us know via a YouTube comment, on social media, or by commenting on our Google doc!


    ~~~

    Postgres FM is produced by:

    • Michael Christofides, founder of pgMustard
    • Nikolay Samokhvalov, founder of Postgres.ai


    With credit to:

    • Jessie Draws for the elephant artwork
    41 min
  • Extended Statistics

    Nikolay and Michael discuss the CREATE STATISTICS feature in Postgres — what it's for, how often it's used, and how to spot cases where it would help. 
     
    Here are some links to things they mentioned:

    • CREATE STATISTICS https://www.postgresql.org/docs/current/sql-createstatistics.html
    • citext https://www.postgresql.org/docs/current/citext.html
    • Statistics Used by the Planner https://www.postgresql.org/docs/current/planner-stats.html
    • default_statistics_target https://www.postgresql.org/docs/current/runtime-config-query.html#GUC-DEFAULT-STATISTICS-TARGET
    • Tomáš Vondra on Postgres TV https://www.youtube.com/watch?v=8la-OWfD3VI
    • Recent commit to Postgres 18 for pg_upgrade https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=1fd1bd871012732e3c6c482667d2f2c56f1a9395
    • Multivariate Statistics Examples https://www.postgresql.org/docs/current/multivariate-statistics-examples.html
    • Extended statistics (README) https://github.com/postgres/postgres/blob/master/src/backend/statistics/README
    • How we used Postgres extended statistics to achieve a 3000x speedup (blog post by Jared Rulison) https://medium.com/affinity-engineering/how-we-used-postgres-extended-statistics-to-achieve-a-3000x-speedup-ea93d3dcdc61


    ~~~

    What did you like or not like? What should we discuss next time? Let us know via a YouTube comment, on social media, or by commenting on our Google doc!


    ~~~

    Postgres FM is produced by:

    • Michael Christofides, founder of pgMustard
    • Nikolay Samokhvalov, founder of Postgres.ai


    With credit to:

    • Jessie Draws for the elephant artwork
    33 min
  • SQL vs NoSQL

    Nikolay and Michael are joined by Franck Pachot to discuss SQL vs NoSQL — did Franck change teams by joining MongoDB, normalisation vs denormalisation, developer experience, NULLs, and more!
     
    Here are some links to things they mentioned:

    • Franck Pachot https://postgres.fm/people/franck-pachot
    • Franck's workshop at PGConf India https://pgconf.in/conferences/pgconfin2025/program/proposals/958 
    • PostgreSQL Conference Germany https://2025.pgconf.de
    • "Schema Later" Considered Harmful by Michael Stonebraker and Álvaro Hernández https://www.enterprisedb.com/blog/schema-later-considered-harmful
    • Comparison of JOINS by Michael Stonebraker and Álvaro Hernández https://www.enterprisedb.com/blog/comparison-joins-mongodb-vs-postgresql 
    • Franck’s post about why he joined MongoDB https://www.linkedin.com/pulse/2025-im-joining-mongodb-franck-pachot-e4shf
    • EdgeDB https://www.edgedb.com
    • Nikolay’s tweet about a recent issue with NULLs https://x.com/samokhvalov/status/1889078097124999272
    • PartiQL https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ql-reference.html
    • FerretDB https://www.ferretdb.com
    • DocumentDB https://github.com/microsoft/documentdb


    ~~~

    What did you like or not like? What should we discuss next time? Let us know via a YouTube comment, on social media, or by commenting on our Google doc!


    ~~~

    Postgres FM is produced by:

    • Michael Christofides, founder of pgMustard
    • Nikolay Samokhvalov, founder of Postgres.ai


    With special thanks to:

    • Jessie Draws for the elephant artwork 
    51 min
  • Return of the BUFFERS

    Nikolay and Michael return to the topic of BUFFERS for the third (and final?) time! They discuss the news that it'll be on by default with EXPLAIN ANALYZE in Postgres 18, and what effect that might have. 
     
    Here are some links to things they mentioned:

    • Our first BUFFERS episode https://postgres.fm/episodes/buffers-by-default
    • Our second BUFFERS episode https://postgres.fm/episodes/buffers-ii-the-sequel
    • BUFFERS enabled for EXPLAIN ANALYZE by default (commit for Postgres 18) https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=c2a4078ebad71999dd451ae7d4358be3c9290b07
    • https://explain.depesz.com/history
    • Latency Numbers Every Programmer Should Know https://gist.github.com/jboner/2841832
    • Twitter conversation about flushing caches https://x.com/prochazkafilip/status/1881655337499205736
    • pg_buffercache_evict https://www.postgresql.org/docs/current/pgbuffercache.html#PGBUFFERCACHE-PG-BUFFERCACHE-EVICT
    • How to compare the quality of SQL query plans (blog post by Andrei Lepikhov) https://danolivo.substack.com/p/whose-optimisation-is-better
    • We were added as PostgreSQL Contributors! https://www.postgresql.org/about/news/new-postgresql-contributors-3006


    ~~~

    What did you like or not like? What should we discuss next time? Let us know via a YouTube comment, on social media, or by commenting on our Google doc!


    ~~~

    Postgres FM is produced by:

    • Michael Christofides, founder of pgMustard
    • Nikolay Samokhvalov, founder of Postgres.ai


    With special thanks to:

    • Jessie Draws for the elephant artwork 
    52 min
  • Reads causing writes

    Nikolay and Michael discuss a couple of surprising ways read queries (selects) can cause writes (shared buffers dirtied) in Postgres.
     
    Here are some links to things they mentioned:

    • Reads causing writes in Postgres (post by Alex Jesipow) https://jesipow.com/blog/postgres-reads-cause-writes/
    • Exploring how SELECT queries can produce disk writes (post by Nikolay Sivko) https://blog.okmeter.io/postgresql-exploring-how-select-queries-can-produce-disk-writes-f36c8bee6b6f 
    • Hint Bits (wiki) https://wiki.postgresql.org/wiki/Hint_Bits
    • pg_stat_statements https://www.postgresql.org/docs/current/pgstatstatements.html 
    • pg_stat_kcache https://github.com/powa-team/pg_stat_kcache 
    • pg_wait_sampling https://github.com/postgrespro/pg_wait_sampling 
    • BUFFERS by default (episode 4!) https://postgres.fm/episodes/buffers-by-default 
    • Page layout (docs) https://www.postgresql.org/docs/current/storage-page-layout.html 
    • From Reddit (user merlinm), PD_ALL_VISIBLE may be a third case https://www.reddit.com/r/PostgreSQL/comments/1hjuyfn/comment/m3e6e7v/ 
    • Coroot https://coroot.com/ 


    ~~~

    What did you like or not like? What should we discuss next time? Let us know via a YouTube comment, on social media, or by commenting on our Google doc!


    ~~~

    Postgres FM is produced by:

    • Michael Christofides, founder of pgMustard
    • Nikolay Samokhvalov, founder of Postgres.ai


    With special thanks to:

    • Jessie Draws for the elephant artwork 
    27 min
  • NOT VALID constraints

    Nikolay and Michael discuss adding constraints in an online fashion, using NOT VALID and then VALIDATE CONSTRAINT.
     
    Here are some links to things they mentioned:

    • ADD table_constraint NOT VALID  https://www.postgresql.org/docs/current/sql-altertable.html#SQL-ALTERTABLE-DESC-ADD-TABLE-CONSTRAINT
    • Our episode on zero-downtime migrations https://postgres.fm/episodes/zero-downtime-migrations
    • VALIDATE CONSTRAINT https://www.postgresql.org/docs/current/sql-altertable.html#SQL-ALTERTABLE-DESC-VALIDATE-CONSTRAINT
    • ALTER TABLE notes https://www.postgresql.org/docs/current/sql-altertable.html#SQL-ALTERTABLE-NOTES
    • pgroll https://github.com/xataio/pgroll


    ~~~

    What did you like or not like? What should we discuss next time? Let us know via a YouTube comment, on social media, or by commenting on our Google doc!


    ~~~

    Postgres FM is produced by:

    • Michael Christofides, founder of pgMustard
    • Nikolay Samokhvalov, founder of Postgres.ai


    With special thanks to:

    • Jessie Draws for the elephant artwork 
    34 min
  • pg_squeeze

    Michael and Nikolay are joined by Antonín Houska to discuss pg_squeeze — what it is, how it started, some of its features, and hopes of getting the functionality into core.
     
    Here are some links to things they mentioned:

    • Antonín Houska https://postgres.fm/people/antonin-houska
    • pg_squeeze https://github.com/cybertec-postgresql/pg_squeeze
    • Cybertec https://www.cybertec-postgresql.com
    • pg_repack https://github.com/reorg/pg_repack
    • Introducing pg_squeeze (by Kaarel Moppel) https://www.cybertec-postgresql.com/en/introducing-pg_squeeze-a-postgresql-extension-to-auto-rebuild-bloated-tables
    • pg_squeeze is included in the PostgreSQL APT packages https://wiki.postgresql.org/wiki/Apt
    • pg_squeeze is included in the PostgreSQL Yum packages https://yum.postgresql.org
    • pg_rewrite https://github.com/cybertec-postgresql/pg_rewrite
    • VACUUM FULL / CLUSTER CONCURRENTLY patch https://commitfest.postgresql.org/51/5117


    ~~~

    What did you like or not like? What should we discuss next time? Let us know via a YouTube comment, on social media, or by commenting on our Google doc!


    ~~~

    Postgres FM is produced by:

    • Michael Christofides, founder of pgMustard
    • Nikolay Samokhvalov, founder of Postgres.ai


    With special thanks to:

    • Jessie Draws for the elephant artwork 
    37 min
  • pg_duckdb

    Michael and Nikolay are joined by Joe Sciarrino and Jelte Fennema-Nio to discuss pg_duckdb — what it is, how it started, what early users are using it for, and what they're working on next.
     
    Here are some links to things they mentioned:

    • Joe Sciarrino https://postgres.fm/people/joe-sciarrino
    • Jelte Fennema-Nio https://postgres.fm/people/jelte-fennema-nio
    • pg_duckdb https://github.com/duckdb/pg_duckdb
    • Hydra https://www.hydra.so
    • MotherDuck https://motherduck.com
    • The problems and benefits of an elephant with a beak (lightning talk by Jelte) https://www.youtube.com/watch?v=ogvbKE4fw9A&list=PLF36ND7b_WU4QL6bA28NrzBOevqUYiPYq&t=1073s
    • pg_duckdb announcement post (by Jordan and Brett from MotherDuck) https://motherduck.com/blog/pg_duckdb-postgresql-extension-for-duckdb-motherduck
    • pg_duckdb 0.2 release https://github.com/duckdb/pg_duckdb/releases/tag/v0.2.0


    ~~~

    What did you like or not like? What should we discuss next time? Let us know via a YouTube comment, on social media, or by commenting on our Google doc!


    ~~~

    Postgres FM is produced by:

    • Michael Christofides, founder of pgMustard
    • Nikolay Samokhvalov, founder of Postgres.ai


    With special thanks to:

    • Jessie Draws for the elephant artwork 
    41 min