<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/keeping-a-postgres-queue-healthy-planetscale-h5pvjk1vk" -->

---
title: Keeping a Postgres queue healthy — PlanetScale | daily.dev
description: Postgres-backed job queues accumulate dead tuples from high-churn INSERT/DELETE cycles, and autovacuum cannot reclaim them while any active transaction pins...
canonical: https://daily.dev/posts/keeping-a-postgres-queue-healthy-planetscale-h5pvjk1vk
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Keeping a Postgres queue healthy — PlanetScale | daily.dev
og:description: Postgres-backed job queues accumulate dead tuples from high-churn INSERT/DELETE cycles, and autovacuum cannot reclaim them while any active transaction pins...
og:url: https://daily.dev/posts/keeping-a-postgres-queue-healthy-planetscale-h5pvjk1vk
og:image: https://api.daily.dev/og/posts/h5pVJk1vK.png
og:image:alt: Keeping a Postgres queue healthy — PlanetScale
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Keeping a Postgres queue healthy — PlanetScale

**[Hacker News](https://daily.dev/sources/hn)** · 19 min read · 0 upvotes · 0 comments

## Summary

Postgres-backed job queues accumulate dead tuples from high-churn INSERT/DELETE cycles, and autovacuum cannot reclaim them while any active transaction pins the MVCC horizon. In mixed-workload databases, overlapping analytics queries can continuously pin that horizon without any single query being long-running enough to trigger timeouts. Modern Postgres improvements (SKIP LOCKED, B-tree bottom-up deletion) raise the threshold but don't eliminate the problem. PlanetScale's Traffic Control feature solves this by limiting concurrency of lower-priority workloads (e.g., analytics queries) by class, allowing vacuum windows to open. Benchmarks show that without Traffic Control, 800 jobs/sec with 3 overlapping 120-second analytics queries causes a death spiral with 383k dead tuples and 300ms+ lock times; with Traffic Control limiting analytics to 1 concurrent worker, the queue stays at zero and dead tuples cycle normally.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://planetscale.com/blog/keeping-a-postgres-queue-healthy>

## Similar posts on daily.dev

- [Potential Consequences of Using Postgres as a Job Queue](https://daily.dev/posts/potential-consequences-of-using-postgres-as-a-job-queue-kcv0c9q1v) · Lobsters · 70 upvotes · 0 comments
- [Making Postgres queues scale](https://daily.dev/posts/making-postgres-queues-scale-otqspthk6) · Hacker News · 1 upvotes · 0 comments

---

Tags: [#postgresql](https://daily.dev/tags/postgresql), [#planetscale](https://daily.dev/tags/planetscale)

[View this post on daily.dev](https://daily.dev/posts/keeping-a-postgres-queue-healthy-planetscale-h5pvjk1vk)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Keeping a Postgres queue healthy — PlanetScale","url":"https://daily.dev/posts/keeping-a-postgres-queue-healthy-planetscale-h5pvjk1vk","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/keeping-a-postgres-queue-healthy-planetscale-h5pvjk1vk"},"datePublished":"2026-04-12T02:38:18.643Z","dateModified":"2026-04-12T02:38:41.753Z","description":"Postgres-backed job queues accumulate dead tuples from high-churn INSERT/DELETE cycles, and autovacuum cannot reclaim them while any active transaction pins...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/eb1c89981fb8c9ef448b8455dc17f5cb?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/eb1c89981fb8c9ef448b8455dc17f5cb?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Hacker News","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Hacker News","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/hn","url":"https://daily.dev/sources/hn"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/keeping-a-postgres-queue-healthy-planetscale-h5pvjk1vk","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"postgresql,planetscale","timeRequired":"PT19M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Hacker News","item":"https://daily.dev/sources/hn"},{"@type":"ListItem","position":3,"name":"Keeping a Postgres queue healthy — PlanetScale"}]}
```

