---
title: "How savepoints quietly throttled our Postgres queue"
description: "Using a SAVEPOINT per tick in a Postgres-backed job queue made every locked row carry a MultiXact ID in xmax."
url: "https://swe.quest/articles/how-savepoints-quietly-throttled-our-postgres-queue-a32737dd90a62c34"
canonical: "https://incident.io/blog/how-savepoints-quietly-throttled-our-postgres-queue"
source: "incident.io"
published: "2026-10-06"
difficulty: "hard"
kind: "Case study"
reading_minutes: 15
tags: ["postgres","performance","storage-engines","concurrency","scalability"]
---

# How savepoints quietly throttled our Postgres queue

A post on [incident.io](https://swe.quest/sources/incident-io.md), published 2026-10-06, 15 min read, Case study. Original: [https://incident.io/blog/how-savepoints-quietly-throttled-our-postgres-queue](https://incident.io/blog/how-savepoints-quietly-throttled-our-postgres-queue)

## Summary

Using a SAVEPOINT per tick in a Postgres-backed job queue made every locked row carry a MultiXact ID in xmax. FOR UPDATE SKIP LOCKED scans then contended on the LWLock-guarded pg\_multixact cache, so adding workers made acquisition slower. incident.io fixed it by moving the queue to a slim escalation\_jobs table, replacing subtransactions with a claimed\_until lease (one transaction per tick), keeping claimed\_until unindexed with fillfactor 85 to allow HOT updates, and running one dispatcher goroutine per pod that feeds workers over a channel. Together these raised peak escalation capacity 3.5x, at the cost of up to 10 seconds of delay if a pod dies mid-claim.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Storage engines](https://swe.quest/tags/storage-engines.md) (Data & databases)
- [Concurrency](https://swe.quest/tags/concurrency.md) (Compilers & runtimes)
- [Scaling](https://swe.quest/tags/scalability.md) (Distributed systems)

## Prerequisites

- Postgres MVCC and tuples ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- row locking with SKIP LOCKED
- database job queues ([easy posts on Databases](https://swe.quest/tags/databases.md?difficulty=easy))
- Postgres vacuum ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))

## Keywords

PostgreSQL, MultiXact, SAVEPOINT, SKIP LOCKED, HOT updates, LWLock, Cloud SQL, incident.io On-call

## Related posts

- [1M Durable Workflows per Second on Postgres](https://swe.quest/articles/1m-durable-workflows-per-second-on-postgres-8f041571c87c6775.md): DBOS · 2026-10-28 · Medium · 5 min read · PostgreSQL, Distributed databases, Scaling, Resilience, Queues & messaging
  Sharding Postgres with PgDog let DBOS durable workflow throughput scale linearly from 20K workflows/sec on one db.m7i.4xlarge RDS instance to 1M workflows/sec across 50 shards.
- [When upserts don’t update but still write: Debugging Postgres performance at scale](https://swe.quest/articles/when-upserts-don-t-update-but-still-write-debugging-postgres-performance-at-cd64ef72ac9ca8ec.md): Datadog Engineering · 2026-03-23 · Medium · 11 min read · PostgreSQL, Performance engineering, Storage engines, Debugging, SQL
  A Postgres \`INSERT ... ON CONFLICT DO UPDATE ... WHERE\` upsert still locks the conflicting row even when the WHERE clause blocks the update.
- [PostgreSQL Stories: A simple query with a big problem](https://swe.quest/articles/postgresql-stories-a-simple-query-with-a-big-problem-6dd72fff3c9a1d47.md): Render · 2024-04-03 · Medium · 10 min read · PostgreSQL, Debugging, Incidents & postmortems, Schema migrations
  A seemingly simple indexed join with LIMIT 1 ran for over four hours on Render's staging PostgreSQL, holding a lock that blocked CREATE OR REPLACE VIEW migrations and stalled deploys.
- [PGKeeper: Building the bouncer we needed for Postgres](https://swe.quest/articles/pgkeeper-building-the-bouncer-we-needed-for-postgres-b0a410376e101175.md): Figma · 2026-05-04 · Medium · 19 min read · PostgreSQL, Resilience, Go, Databases, Scaling
  Figma replaced PgBouncer with PGKeeper, a Go service built on PGX that sits between its DBProxy router and each Postgres instance.
- [Everyone gets faster writes: We turned off FPW's in Neon](https://swe.quest/articles/everyone-gets-faster-writes-we-turned-off-fpw-s-in-neon-60d0cd25f29077e7.md): Neon · 2026-05-07 · Hard · 7 min read · PostgreSQL, Storage engines, Performance engineering, Distributed databases
  Neon disabled Postgres full-page writes fleet-wide because its stateless compute streams WAL to a Paxos safekeeper quorum and has no local disk pages that can tear.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
