PostgresAI retweeted
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…
PostgresAI retweeted
What happens when a random-key index outgrows shared_buffers? And what does UUIDv7 reveal about your data?
Kirk Wolak and Nik dig into both in episode 194 🎙️
▶️ youtube.com/watch?v=gf8e3JkQ…
🎧 postgres.fm/episodes/uuidv4-…
PostgresAI retweeted
🚨 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? 👇
PostgresAI retweeted
Why does this keep happening?
pg_restore doesn't do it for you.
Autovacuum does it eventually: in tests from my blog post, after 6 s to 6+ minutes. And (!) it never analyzes partitioned parents.
Yes, Postgres could do a better job. But also most existing guides stop at "pg_restore finished".
I checked 28 of them, incl. Postgres docs, AWS, Google Cloud, Azure, Supabase, Neon:
→ only 8/28 say to run ANALYZE
→ only 3/28 say to run VACUUM
→ and just 1 explains what visibility maps are
Only one tells the whole story.
Full research, all 28 pages: github.com/NikolayS/postgres…
So teams step on the same rake 🤕
✅ Check your runbooks, scripts and AI agent skills. Before traffic:
vacuumdb --analyze --jobs 4 # adjust
plus ANALYZE each partitioned parent
Follow me for more Postgres tips the docs leave out.
pg_dump + pg_restore finished. Exit code 0. Row counts match.
Your database is not ready yet.
One query, 250M rows, Postgres 18.6, cold cache:
→ right after pg_restore: 32.6 s
→ after ANALYZE: 6.1 s
→ after VACUUM ANALYZE: 23 ms 💥
Same data. ~1,400× faster.
A logical dump does not carry the visibility map, and by default not the planner statistics.
25 of 28 migration guides we checked don't say to run VACUUM after the load.
Before traffic:
vacuumdb --analyze --jobs 4
then ANALYZE each partitioned parent
All tests are reproducible, and the scripts are in the post (bonus: podcast episode) 👇
PostgresAI retweeted
pg_dump + pg_restore finished. Exit code 0. Row counts match.
Your database is not ready yet.
One query, 250M rows, Postgres 18.6, cold cache:
→ right after pg_restore: 32.6 s
→ after ANALYZE: 6.1 s
→ after VACUUM ANALYZE: 23 ms 💥
Same data. ~1,400× faster.
A logical dump does not carry the visibility map, and by default not the planner statistics.
25 of 28 migration guides we checked don't say to run VACUUM after the load.
Before traffic:
vacuumdb --analyze --jobs 4
then ANALYZE each partitioned parent
All tests are reproducible, and the scripts are in the post (bonus: podcast episode) 👇
PostgresAI retweeted
something spiked 10 minutes ago.
pg_stat_activity already forgot.
pg_ash remembers.
Active Session History for any Postgres -- pure SQL, no extension, no restart. RDS, Cloud SQL, Supabase, AlloyDB, Neon.
in 2.0 (currently rc1):
- redesigned to be easier to use, for humans and agents
- unified AAS metrics
- up to 23x faster reads
tested on PG 14–19rc1
free, Apache 2.0
setup:
\i sql/ash-install.sql
select ash.start('1 second');
github.com/NikolayS/pg_ash -- ASH for Postgres, in pure SQL
Postgres 19 delayed for a month. Is this about AI? youtube.com/watch?v=-TiSorR4…
postgresai 0.17 is out!
- outbound-only agent: the platform never connects to your instance
- new pgai promql
- autovacuum checks use each table's real trigger point
- pg_stat_statements from all databases
- VictoriaMetrics admin keys
…and much more: gitlab.com/postgres-ai/postg…
PostgresAI retweeted
New episode: "pg_stat_log"
Nik and Michael are joined by @fabriziomello to discuss his new extension pg_stat_log.
🎧 postgres.fm/episodes/pg_stat…
📺 youtu.be/xr5kv1WUdWM
PostgresAI retweeted
finally got dark theme in console.postgres.ai
PostgresAI retweeted
PgQue got a website with docs – pgque.dev
PostgresAI retweeted
"you can't have superuser"
"you can't install that extension"
"you can't access WAL"
"it's for your protection!"
no.
it's free software -- handed back to you with the freedom removed, and the cage painted as safety
Postgres is free.
that freedom is the whole point.
you don't need protection from the database you've run for decades.
you need access to it. full control. and ownership.
PostgresAI retweeted
PgQue v0.2.0:
🐍 Python, 🟦 TypeScript, 🐹 Go clients
⚡️ send_batch() performance optimized
👥 subconsumers to scale consumption near-linearly
⏱️ sub-second ticking and 10 ticks/sec by default (incl. with pg_cron)
🧩 pg_cron, pg_timetable, pg_tle paths
PgQue is a highly-efficient, zero-bloat Postgres queue built on top of on battle-proven Skype's PgQ. One SQL file to install, pg_cron to tick. Works in any Postgres.
PostgresAI retweeted
pg_ash v1.4 is out
• Long-term rollups: 1-minute and 1-hour rollup tables for longer storage
• Configurable raw partitions: by default, 3 daily partitions, can be any number
• Safer destructive operations: explicit confirmations needed
• Hardened privileges: public access is restricted; guarded search paths; "ash.grant_reader('youruser');"
• Stronger release gate: CI covers PostgreSQL 14–18, pg_cron and no-pg_cron modes, e2e tests, etc.
pg_ash is Active Session History (ASH) implemented in pure SQL/PLpgSQL — no C extension build, no restart, no shared_preload_libraries. Works in any Postgres.
Ask your AI agent to inject it "\i sql/ash-install.sql" and then analyze workload using functions – your AI will figure it out easily.
PostgresAI retweeted
Upcoming PgQue 0.2 introduces subconsumers (PgQ's "cooperative consumers", reimplemented due to license uncertainty) -- this is how you can scale consumption almost linearly
PgQue is a very efficient, zero-bloat Postgres queue. One SQL file to install, pg_cron or pg_timetable to tick. Works everywhere.
PostgresAI retweeted
Replying to @samokhvalov
@samokhvalov you've done an amazing job with pgque. I ran a new comparison of postgresql based job-queue (ish) systems over the weekend.
PostgresAI retweeted
What a nice blog post by Christophe Pettus
PgQue: Two Snapshots and a Diff thebuild.com/blog/2026/05/03…
PostgresAI retweeted
PgQue v0.1.0 is out.
PgQ -- the Postgres queue system built at Skype 20 years ago for 1B-user-scale workloads -- repackaged for the managed-Postgres era. One SQL file. No C extension. No external daemon. pg_cron to tick.
Why bother reviving a 2007 architecture?
Every major Postgres queue in production today uses some flavor of SKIP LOCKED + UPDATE/DELETE. It works under light load. When you have more data and higher load, it degrades predictably. Then you get posts like these:
- Brandur at Heroku, 2015: 60k job backlog in one hour from a single open transaction
- PlanetScale, 2026: death spiral at 800 jobs/sec
- River issue #59, awa issue #169 and so on, Oban's partitioning work, PGMQ's autovacuum tuning guide and duct-taping with pg_partman
The core issue is how Postgres MVCC is implemented and how we deal with it. Dead tuples in the hot path, xmin horizon pinned, vacuum falling behind, query performance quickly degrades. This happens every time you run pg_dump, execute an analytical query, or have a lagging/unused logical replication slot.
PgQ solved this in 2007 with snapshot-based batching and TRUNCATE rotation -- zero dead tuples in the event
path, by design.
But PgQ needed a C extension and an external daemon. Which means it doesn't run on RDS, Aurora, Cloud SQL, AlloyDB, Supabase, or Neon -- i.e., where most
Postgres lives now.
PgQue closes that gap.
💎 Pure SQL + PL/pgSQL (PgQ engine)
👩💻 \i sql/pgque.sql -- you're done
🕑 pg_cron replaces pgqd (optional, recommended)
💻 Python, Go, TypeScript client examples shipped
💙 Apache 2.0
Trade-off: end-to-end event delivery latency is up to a second, it depends on ticking frequency. If you need sub-3ms job dispatch, use River, Oban, or graphile-worker (and avoid anything that blocks xmin horizon). If you need high-throughput event streaming with fan-out inside Postgres -- Kafka-shaped, without Kafka and dealing with transactional outbox implementation -- this is the right shape of tool.
Kudos to Marko Kreen and Skype engineers who implemented this decades ago, for the original PgQ, and to Alexander Kukushkin whose recent "Rediscovering PgQ" talk brought this quiet corner of the Postgres ecosystem back into view.
Stars, issues, PRs, and honest criticism all welcome.
Link 👇












