Topic

PostgreSQL

Monitor PostgreSQL database developments, extension releases, and version updates. Our digest aggregates query optimization, indexing, and replication discussions from database administrator communities.

What this topic tracks

  • Database releases and ecosystem updates
  • Query, indexing, and modeling practices
  • Operational lessons from production systems

PostgreSQL · 107 stories

Recent stories

Each story's summary, with the places it was discussed.

Summaries are written by AI from the linked sources. Open the source for full context.

20 stories

Postgres LISTEN/NOTIFY actually scales

dbos.dev · 24 Jul

Database · Performance · PostgreSQL

Postgres LISTEN/NOTIFY is often criticized for scalability issues caused by a global exclusive lock during commits.

By buffering notifications and batching them, developers can bypass this serialization bottleneck. This approach enables high-throughput, low-latency streaming—achieving 60K writes per second while maintaining millisecond latency—without sacrificing system reliability or durability.

timescale/pg_vectorsearch

github.com · 14 Oct

Artificial Intelligence · C · Database · Performance · PostgreSQL

pg_vectorsearch is an alpha PostgreSQL extension for high-performance approximate nearest neighbor (ANN) search.

Its PRISM index targets datasets exceeding 100 million vectors, using hierarchical routing, RaBitQ quantization with theoretical error bounds, SIMD-optimized distance computation, and PostgreSQL buffer caching. It supports inserts, updates, deletes, rebalancing through prism_rebalance, and existing pgvector vector or halfvec columns. Two-stage filtering reduces full-precision reranking while preserving recall and improving query and index-building speed.

Just Use Postgres for Durable Workflows

dbos.dev · 28 May

Database · Distributed Systems · PostgreSQL

Durable workflows improve reliability by checkpointing task progress to a database.

While traditional systems use complex external orchestrators, this article proposes building durable workflows directly on Postgres. By leveraging Postgres for state management, coordination, and observability, developers can reduce infrastructure complexity, improve scalability, and unify security policies without adding new single points of failure.

Introduction to PostgreSQL Indexes

dlt.github.io · 11 Sept

Database · Performance · PostgreSQL

This comprehensive guide to PostgreSQL indexes explores their internal mechanics, storage on disk using heap files and 8KB pages, and the tradeoffs associated with their use.

It details how the query planner decides between sequential and index scans and emphasizes the costs of indexing, including disk space, memory usage, and impact on write operations. The article breaks down various index types, such as B-tree, Hash, BRIN, GIN, GiST, and SP-GiST, while also covering advanced strategies like partial, covering, multi-column, and expression indexes for specialized optimization.

Show HN: PgDog – Scale Postgres without changing the app

github.com · 23 Feb

Database · PostgreSQL · Rust

PgDog is an open-source, high-performance PostgreSQL proxy written in Rust.

It offers advanced connection pooling, load balancing, and sharding capabilities. Featuring application-layer routing, health checks, and automatic failover, it supports complex cross-shard queries and online re-sharding. It is designed for scalability on commodity hardware and integrates with Kubernetes, AWS RDS, and Terraform.

I Love You, Redis, but I'm Leaving You for SolidQueue

simplethread.com · 19 Nov

Backend · PostgreSQL · Rails

Rails 8 introduces a significant architectural shift by removing Redis from its standard technology stack in favor of 'Solid' alternatives.

By utilizing SolidQueue for job processing, SolidCache for caching, and SolidCable for real-time messaging, developers can now rely solely on relational databases like PostgreSQL, MySQL, or SQLite. This change simplifies infrastructure by reducing the operational overhead of managing separate Redis instances, clusters, and backup strategies. SolidQueue leverages modern database features such as FOR UPDATE SKIP LOCKED to ensure efficient, concurrent job handling without lock contention. While Redis remains superior for extreme low-latency requirements or massive throughput, the new 'Redis-less' approach is capable of handling millions of jobs daily, making it an ideal choice for the vast majority of web applications seeking to minimize complexity.

Things you didn't know about (Postgres) indexes

jon.chrt.dev · 15 Apr

Database · PostgreSQL · SQL

Database indexes speed up read operations by acting like sorted references, similar to a book index.

However, they introduce overhead for writes and storage. Key optimization strategies include understanding composite indexes, using functional indexes for expressions, implementing partial indexes for filtered datasets, and leveraging covering indexes for index-only scans. Always measure performance using EXPLAIN and EXPLAIN ANALYZE.

How Oracle's Secret Algorithm Came into the Public Domain After Patent Expiration, Making Sorting 5x Faster for Open-Source Databases and Boosting Performance for AWS and Other Cloud Companies

deepsystemstuff.com · 6 Jul

Database · MySQL · PostgreSQL

Oracle's Orasort algorithm, which boosts database sorting speeds by comparing 8-byte segments as 64-bit integers instead of character-by-character, has entered the public domain following its 20-year patent expiration.

This efficient method reduces CPU cycle consumption, now enabling open-source databases like MySQL and PostgreSQL to optimize performance and lower operational costs in cloud environments.

Postgres isn't slow, your storage is

clickhouse.com · 12 Oct

Backend · Database · Performance · PostgreSQL · Software Architecture

Sai Srirampur’s POSETTE 2026 benchmark found the same 3.3-billion-row PostgreSQL UPDATE workload achieved median 16,030 TPS on local NVMe versus 1,734 on baseline gp3 EBS, with latency falling from 36.9 ms to 4.0 ms.

EBS spent most extra time waiting for storage, contributing to slow ingestion, read latency, VACUUM, checkpoints, and replication lag. Production use requires two synchronous standbys across availability zones, plus Object Storage base backups and continuous WAL archiving for failover and recovery.

What would Postgres do?

planetscale.com · 2 Dec

Backend · Database · Distributed Systems · PostgreSQL · Testing

Neki validates its sharded Postgres behavior by treating vanilla Postgres as an oracle: identical queries, data, and protocol interactions must produce identical results or errors.

Differential tests explore plan variants created by changing statistics, planners, sharding topologies, and simple/extended text/binary protocols. Across about 9,800 workload queries, a recent CI run executed 37,000 variants; this exposed real correctness bugs, including incorrect volatile CTE evaluation, while fuzzing found over 70 more bugs.

Designing a reliable unplanned failover

planetscale.com · 5 Nov

Backend · Database · Distributed Systems · PostgreSQL · Software Architecture

Neki’s unplanned Postgres failover uses replica evidence rather than Admin’s health check alone.

It declares a primary dead only when reachable replicas report broken replication without contradiction, then disconnects them to prevent the old primary from returning and to freeze WAL positions. It promotes the replica with the highest received, preferably fully replayed, WAL, reconfigures the shard, and tears down the old primary. Synchronous `ANY 1` durability helps establish write unavailability, while TCP and WAL receiver timeouts detect silent or frozen failures.

Designing a planned switchover for minimum disruption

planetscale.com · 29 Oct

Backend · Database · Distributed Systems · PostgreSQL · Software Architecture

Neki minimizes planned Postgres primary switchovers by validating candidates beforehand, establishing a final WAL position, preserving synchronous replication, and buffering primary-bound queries.

Admin makes the old primary read-only, disconnects other replicas, waits for the target to replay all required WAL, prepares replication, and promotes it only when safety checks pass. Routers then replan buffered queries, so applications usually see delay rather than errors. A deadline enables rollback to the old primary, while acknowledged commits remain durable.

Shard design doesn't start from your tables

planetscale.com · 23 Oct

Backend · Database · Distributed Systems · PostgreSQL · Software Architecture

Neki shard-group design should start from query and transaction patterns, not table structure.

Tables sharing a key can be co-located across Postgres shards using a common shard index, keeping joins and transactions local and preserving full single-shard semantics. Reference tables are replicated to every shard, while differently keyed data can use separate groups. Global secondary indexes support lookups without shard keys. MoveTables and Reshard later change placement, shard keys, or shard counts as workloads evolve.

I don't trust ON DELETE CASCADE

planetscale.com · 21 Oct

Backend · Database · Performance · PostgreSQL · SQL

ON DELETE CASCADE can turn simple deletions into outages and replication failures as foreign-key trees grow.

A cascading delete removes matching rows in one transaction, generating dead tuples, index updates, and WAL while holding locks; migrations may queue writes, unindexed keys can trigger scans, and logical replication can leave orphans or fail without replica identity. Soft deletes avoid this by marking one row, then reaping descendants in small background batches, keeping transactions short and bounded.

Neki update: $50 Metal, read-only replicas, Azure, and more

planetscale.com · 20 Oct

Backend · Database · DevOps · Distributed Systems · PostgreSQL

Neki, PlanetScale’s sharded Postgres, added read-only replicas, Metal nodes starting at $50/month, Azure regions, and broader Terraform, CLI, MCP, and configuration support during its platform preview.

The query layer now supports more SQL, standard exports via COPY, and EXPLAIN (NEKI_PG_PLAN); distributed INSERT ... SELECT is 76x faster and COPY ingest 5x faster than launch. More than 650 changes have shipped, enabling evaluation for production workloads.

Sequences and other volatiles in Neki

planetscale.com · 14 Oct

Backend · Database · Distributed Systems · PostgreSQL · SQL

Neki implements PostgreSQL sequences in its sharded query planner by making sequence operations router-only and coordinating allocation through an authoritative shard.

Because nextval() is volatile, Neki must evaluate it once per output row, even when rows arrive from multiple shards, while stable expressions such as now() are evaluated once per statement. Shard-local joins and immutable expressions can still be pushed down. For UPDATE, Neki locks and streams row IDs to the router, then sends parameterized per-row updates with globally unique sequence values.

Scaling PostgreSQL to power 800M ChatGPT users

openai.com · 22 Jan

Database · Distributed Systems · PostgreSQL

OpenAI has successfully scaled its PostgreSQL infrastructure to support 800 million users and millions of queries per second for ChatGPT and its API.

Despite a 10x surge in load over the past year, OpenAI utilizes a single-primary architecture on Azure PostgreSQL with nearly 50 read replicas globally. The engineering team implemented extensive optimizations, including offloading read traffic to replicas, using PgBouncer for connection pooling, and employing cache locking to prevent read storms. To manage write-heavy workloads that challenge PostgreSQL's MVCC implementation, OpenAI migrated shardable data to Azure Cosmos DB. This strategy prioritizes operational stability, achieving 99.999% availability while maintaining low latency across distributed regions. Future plans include cascading replication and further migration of write-heavy workloads to specialized sharded systems.

Oban, the job processing framework from Elixir, has come to Python

dimamik.com · 27 Jan

Distributed Systems · PostgreSQL · Python

This insightful article explores the inner workings of Oban-py, a Python implementation of the renowned Elixir background job processing library.

The author details how Oban-py leverages PostgreSQL features like FOR UPDATE SKIP LOCKED for concurrency, LISTEN/NOTIFY for real-time signaling, and UPSERT mechanisms for leader election. By centralizing coordination within the database, it eliminates the need for external brokers like Redis. The summary distinguishes between the Open Source version, which utilizes single-threaded asyncio, and the Pro version, which offers true parallelism, bulk operations, and sophisticated rescue heartbeats. Ultimately, it highlights the library's clean software architecture and its effectiveness as a reliable, database-backed solution for managing complex background tasks and job lifecycles in Python environments.

Where it came fromHacker NewsPlanetScaleRedditCreate a Snapbyte.dev digest and choose PostgreSQL as one of your topics.Build your digest