Postgres FM (@PostgresFM) header
Postgres FM (@PostgresFM) profile picture

A weekly podcast about all things PostgreSQL — by @michristofides and @samokhvalov. Also at https://www.teapawt.net/t.co/lQaOt18aZ0

🎧 Podcast + 📺 YouTube
Joined July 2022
Photo by Postgres FM (@PostgresFM)Photo by Postgres FM (@PostgresFM)Photo by Postgres FM (@PostgresFM)Photo by Postgres FM (@PostgresFM)Photo by Postgres FM (@PostgresFM)Photo by Postgres FM (@PostgresFM)Photo by Postgres FM (@PostgresFM)Photo by Postgres FM (@PostgresFM)Photo by Postgres FM (@PostgresFM)Photo by Postgres FM (@PostgresFM)
Don't miss Postgres 19 episode 🐘🚀 Michael, Nik, and Kirk talk about features they like most and first exciting PG18 vs. PG19 numbers from DBLab Forge benchmarks 📈
2
2
1
16
632
CREATE TEMP TABLE in every transaction: 3,931 tx/s 🐢 Same query as a CTE: 88,531 tx/s 🐘🚀 New Postgres FM with @yugedilbertfan and @samokhvalov: why it happens, and what to use instead With many idle sessions, DDL waits on LWLock:SInvalWrite Ever seen this one? thread 🧵👇
5
3
1
16
1,532
Idle sessions are not free. We asked for 500 temp-table tx/s and got: - 0 idle: 502 - 1,000: 502 - 3,000: 274 - 5,000: 127 At 5,000, the DDL sessions spend 91% of their active time waiting on LWLock:SInvalWrite (PG18, 16 vCPU, synthetic). First aid: cut idle sessions.
1
1
4
303
The fix: no temp tables in hot code - CTE: 88,531 tx/s - PL/pgSQL arrays, records - if you must: reuse one, ON COMMIT DELETE ROWS: 17,741 tx/s Brief (DBLab Forge): console.postgres.ai/shared/b… Listen (Spotify, Apple, any app): postgres.fm/episodes/the-hid… Watch: youtube.com/watch?v=gAdhpYew…
1
4
341
pgvector as its own container image: 0.31 MiB. A fat Postgres image with 18 extensions: 253 MiB. Both still cost the same restart to add. New episode with Álvaro Hernández @ahachete and Kirk Wolak @yugedilbertfan on extensions for Postgres in containers. New episode link👇
1
4
17
1,361
Álvaro's answer, in 65 seconds (sound on): you ask for Postgres + citus + ltree + unaccent, and you get one image with only those. Nothing more. This is StackGres Containers (public beta), built on DOCIR, a dynamic OCI registry.
1
1
4
351
Postgres FM retweeted
We discuss it on @PostgresFM Why does a random UUID slow down inserts once the index outgrows memory? Kirk Wolak explains it in rally well in 75 seconds: UUIDv4 → each insert lands on a random leaf. Those leaves get evicted, so inserts keep reading pages back from disk. UUIDv7 → every new key is to the right of the last one. Only the last page is touched. Same as bigint identity. Full episode: youtu.be/gf8e3JkQ_8M
1
1
9
486
Postgres FM retweeted
Random UUID primary keys look fine on day one: id uuid default gen_random_uuid() primary key At scale, INSERTs run much slower. Postgres 18.6, 16 clients, single-row inserts, same server: → small table: UUIDv4 at 0.95–1.10x of UUIDv7 → 100M rows: 0.62–0.69x of an ordered key → WAL per row: 1.5–1.9x → index size: +33% vs UUIDv7 Each UUIDv4 insert lands on a random leaf, so the whole index is hot. Past memory, almost every insert reads a page and evicts another one. Postgres 18 has uuidv7(). For an existing table, one statement under a short lock_timeout: alter table t alter column id set default uuidv7(); 7 runs, 14 hypotheses written down before the first row. Link below 👇
9
10
1
52
3,937
Postgres FM retweeted
Two UUID traps from our tests on Postgres 18: 1. order by id desc limit 100 on a UUIDv4 table → returns the 100 largest random values, not the newest rows 2. UUIDv7 generated in the app → 16 clients with clocks spread over ±60 s → index 69% full, 45% of leaves out of order → about as bad as UUIDv4 Generate uuidv7() in Postgres. On 17 and older: the pg_uuidv7 extension or a SQL function as the column default. Full post: postgres.ai/blog/20261105-uu…
2
7
309
Postgres FM retweeted
.Give this a watch if you haven’t yet! This was a fun one. Always enjoy how candid these conversations get with @samokhvalov and @michristofides. Love @PostgresFM! 🤗❤️
New episode: "ClickHouse Managed Postgres" Nik and Michael are joined by @saisrirampur to discuss @ClickHouseDB's new managed Postgres service. 🎧️ postgres.fm/episodes/clickho… 📺️ youtu.be/jRCjB_Vy7cE
1
3
15
1,137
Postgres FM retweeted
I have participated in multiple podcasts. This is one of those I enjoy the most. It was fantastic, thank you for inviting me 🙏
New episode: "Citus + StackGres" Nik and Michael are joined by Álvaro Hernández to discuss sharding Postgres with Citus and StackGres, especially the new query router support that has been added very recently. 🎧️️️ postgres.fm/episodes/citus-s… 📺️️️ youtu.be/by4Gn3MJJOc
1
1
9
617
Postgres FM retweeted
Nice to see our recent blog post: Open-source Citus matches PlanetScale's Neki at 10M QPS on half the data nodes stackgres.io/blog/open-sourc… mentioned on Postgres Weekly news (thanks @cooperx86 ) Mentioned next to the link to @PostgresFM's episode where Citus and the benchmark were discussed: postgres.fm/episodes/citus-s… Have you listened to it?
1
2
16
840
🚨 UUIDv4 or UUIDv7 for your Postgres primary key? We inserted 2 billion UUIDs to settle it. 100M rows. Postgres 18. 1 GiB shared_buffers. ⚡ int8: 23.5k inserts/s ⚡ UUIDv7: 21.7k inserts/s 🐌 UUIDv4: 13.9k inserts/s UUIDv4 starts slowing at ~26M rows. Why? 👇
7
18
138
15,570
It's not just inserts/s. WAL per insert at 80–100M rows: → int8: 745 B → UUIDv7: 744 B → UUIDv4: 1,324 B 🐌 Postgres 18 ships uuidv7(). And yes, it has a catch. It's in the episode.
1
1
3
653
How we tested: ~2.1B UUID rows across 7 runs, driven by AI agents in DBLab Forge, PostgresAI's experiment platform. ~1.5B tokens (mostly cached context; ~10.5M generated). Every number, chart and config 📊 console.postgres.ai/shared/b…
1
1
577