Chris van Eijk: PostgreSQL indexes for multi-tenant SaaS: tenant_id first
Five indexes, 1,000 tenants, one query, measured in PostgreSQL 17: why tenant_id goes first, what RLS does to the plan, and when partitioning pays off.
Ideas y movimientos que importan a quienes diseñan, construyen y operan software. Una selección breve para mantener el pulso del oficio.
Categoría
Five indexes, 1,000 tenants, one query, measured in PostgreSQL 17: why tenant_id goes first, what RLS does to the plan, and when partitioning pays off.
Sequence, max()+1, SERIALIZABLE or a counter row: five ways to number invoices per tenant, measured under load in PostgreSQL 17 for duplicates, gaps and speed.

The phrase now appears on almost every technology vendor’s website. That’s exactly why it has stopped meaning much. A database is called AI-ready because it supports vectors. A cloud platform is AI-ready because it offers foundation…
`max_standby_streaming_delay` buys you replication lag, not query time—and when the budget runs out, queries get canceled regardless of how long they've…
Replication slots can silently fill your disk and crash the primary, or you can set `max_slot_wal_keep_size` to kill a stalled replica instead.
What a 4 TiB Azure Disk Taught Us about Slow Reads One of our customers spent most of a week tuning PostgreSQL to fix slow reads. They worked through shared_buffers, effective_cache_size, work_mem, and the rest of the checklist, and set…

You can't read a pg_dump file the way you read a table. To see what is inside, you normally restore it into a PostgreSQL server first. pg_restore and grep can list the tables without a restore, and even print a table's rows as raw text.…
I’m happy to share that I was a guest on the Rails Business podcast and the episode is now live. Here’s a recap of the topics we discussed. Engineering Work at Aura We spent most of the time discussing engineering work last year related to…
`max_replication_slots` sizes a shared-memory array that holds every replication slot, regardless of type or state.
October's hacking workshop will cover my talk, pg_plan_advice: Plan Stability and User Planner Control for PostgreSQL?. If you're interesting in joining us, please sign up using this form and I will send you an invite to one of the…
A recent question on the community channels described a difficult situation: a standby had been promoted with archive_mode=off, and restarting the new primary was something the team wanted to avoid. Could they enable archiving on a…