---
title: "The Postgres mistakes we all still make"
description: "Five common Postgres mistakes all eventually show up as connection pressure: opening a connection per request, appending to JSONB columns, holding transactions open across external API calls, nightly bulk DELETEs, and unused indexes."
url: "https://swe.quest/articles/the-postgres-mistakes-we-all-still-make-63314d194ac77b85"
canonical: "https://neon.com/blog/postgres-mistakes-we-all-still-make"
source: "Neon"
published: "2026-11-28"
difficulty: "medium"
kind: "How-to"
reading_minutes: 15
tags: ["postgres","performance","databases"]
---

# The Postgres mistakes we all still make

A post on [Neon](https://swe.quest/sources/neon.md), published 2026-11-28, 15 min read, How-to. Original: [https://neon.com/blog/postgres-mistakes-we-all-still-make](https://neon.com/blog/postgres-mistakes-we-all-still-make)

## Summary

Five common Postgres mistakes all eventually show up as connection pressure: opening a connection per request, appending to JSONB columns, holding transactions open across external API calls, nightly bulk DELETEs, and unused indexes. Each comes with a detection query and a fix. In a pgbench test, per-transaction connects hit 1,415 TPS, PgBouncer 31,524, and persistent connections 215,538. The fixes are to pool connections, move accumulating facts into tables to avoid MVCC bloat, keep only SQL inside transactions using idempotency keys plus idle/transaction timeouts, partition and drop instead of DELETE, and drop unused indexes that slow writes and disable HOT updates.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Databases](https://swe.quest/tags/databases.md) (Data & databases)

## Prerequisites

- SQL basics ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))
- Postgres MVCC and VACUUM ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- database transactions ([easy posts on Databases](https://swe.quest/tags/databases.md?difficulty=easy))

## Keywords

PostgreSQL, PgBouncer, JSONB, pg\_stat\_activity, pg\_stat\_statements, pg\_partman, pgbench, Neon

## Related posts

- [Postgres Support Recap: Investigating Postgres Query Performance](https://swe.quest/articles/postgres-support-recap-investigating-postgres-query-performance-82d2d3f876d71410.md): Neon · 2024-02-29 · Medium · 9 min read · PostgreSQL, Performance engineering, SQL, Observability
  Three starting points for diagnosing slow Postgres queries: use pg\_stat\_statements to find long-running queries by mean execution time and then EXPLAIN ANALYZE them, check the cache hit ratio (in Neon via the neon\_stat\_file\_cache view, since Neon extends shared buffers with a local file cache), and look for table and index bloat caused by MVCC dead tuples.
- [Incident Report: December 8th, 2025](https://swe.quest/articles/incident-report-december-8th-2025-0ad0c5a15c22753f.md): Railway · 2025-12-08 · Medium · 2 min read · PostgreSQL, Schema migrations, Incidents & postmortems
  A schema migration adding a nullable column to a ~1 billion row PostgreSQL table stalled behind locks held by a long-running query.
- [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.
- [Using Neon’s Scale to Zero with Long-Running Applications](https://swe.quest/articles/using-neon-s-scale-to-zero-with-long-running-applications-bbe64dd8466d86d8.md): Neon · 2024-01-24 · Medium · 7 min read · PostgreSQL, Serverless, Resilience, JavaScript, Performance engineering
  Neon's scale to zero suspends a Postgres compute after an idle window (only when no WAL senders are active and autovacuum isn't running), which severs connections held by long-running servers.
- [Can your Postgres survive a bad query?](https://swe.quest/articles/can-your-postgres-survive-a-bad-query-744ea9a22b65710c.md): ClickHouse · 2026-09-28 · Hard · 13 min read · PostgreSQL, Memory management, Resilience, Query engines, Linux
  Postgres's \`work\_mem\` limits memory per plan node per process, not per query, so parallel workers and \`hash\_mem\_multiplier\` can push a simple aggregation past 8x \`work\_mem\`.

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)
