Top stories

  1. Image: pganalyze

    Postgres 18.7 Security Release: The Impact of CVE-2026-6460 & other memory corruption issues

    PostgreSQL released minor versions 18.7, 17.12, 16.16, 15.20 and 14.25, fixing 52 security vulnerabilities and other bugs. Lukas Fittl's analysis groups the CVEs by attacker requirements, examines CVE-2026-6460 and its unusually invasive fix, and warns the release can break extensions. Deployments that allow arbitrary SQL execution or face SQL injection risk should update, since any user able to run SQL could ultimately become an OS user or the Postgres superuser.

Latest

  1. Postgres Monitoring for SQL Server DBAs: Statistics and Logs 101

    A pganalyze guide aimed at SQL Server DBAs learning Postgres explains where to find statistics and logs for query performance tuning. It contrasts SQL Server tooling such as DMVs, Extended Events and Query Store, where logs serve mainly as an incident destination and logging works without configuration, with Postgres, where logs are central to finding performance issues and require deliberate configuration.

  2. Postgres in Production Special Series: How to Query pg_stat_statements to Find Slow and Expensive Postgres Queries (Part 7)

    In the final, seventh part of the "Postgres in Production" series, Ryan Booz shows how to query pg_stat_statements to find slow and expensive Postgres queries. He recommends checking pg_stat_activity first during incidents, and describes two ways to get a usable time window from cumulative metrics: diffing snapshots or resetting and re-querying. The episode also covers which columns to order by, why the slowest query is not always the problem, and what to look for in a monitoring tool.

  3. Postgres in Production Special Series: Diagnosing High Cardinality Workloads in pg_stat_statements (Part 6)

    In the sixth episode of a Postgres in Production series, Ryan Booz examines high cardinality workloads and how they limit the usefulness of pg_stat_statements. ORMs, dynamic SQL and AI-assisted development tools can generate far more unique queries than expected. The episode includes a side-by-side demo of the same workload on Postgres 17 and Postgres 18 and checks for whether pg_stat_statements is losing data needed for query tuning.

  4. Postgres in Production Special Series: Configuring pg_stat_statements to Reduce Deallocations (Part 5)

    Part 5 of a Postgres in Production series, presented by Ryan Booz, covers configuring pg_stat_statements to reduce deallocations that discard query statistics. It shows how to detect data loss using the pg_stat_statements_info view and explains settings such as pg_stat_statements.max, track, track_utility, track_planning and save. Application-side changes that reduce deallocations over time are also discussed.

  5. Postgres in Production Special Series: How pg_stat_statements Decides What to Keep (Part 4)

    In the fourth part of the "Postgres in Production" series, Ryan Booz walks through the pg_stat_statements source code to show how it decides which entries to keep when its hash table fills up. Allocation is driven by pg_stat_statements.max, a hidden per-query usage counter and mean_query_length. Eviction sorts every entry on each deallocation, only completed executions are stored, and raising pg_stat_statements.max carries a cost.

  6. Postgres in Production Special Series: Where Your Query Text Actually Lives (Part 3)

    In part 3 of a Postgres in Production series, Ryan Booz explains where pg_stat_statements stores query text: in a file on disk rather than the in-memory hash table. He covers the file's location, its append-only growth with a 2× size ceiling, the offset-and-length pointers linking hash entries to SQL, and the rewrite cycle when the file fills. He also shows how the same query text can appear multiple times and why ORM-heavy workloads can grow the file to hundreds of megabytes.

  7. Postgres in Production Special Series: What Makes a Statement Unique (Part 2)

    Ryan Booz's second episode in the "Postgres in Production" series examines what makes an entry in pg_stat_statements unique, explaining that uniqueness is structural rather than textual. It covers what normalization removes, why SQL comment tags can disappear, and how ORMs, dynamic SQL and multi-database setups can fill the in-memory hash table and hide important queries. The episode also discusses the IN-clause explosion and how Postgres 18, which exposes about 45 columns in the view, fixes it.

  8. Postgres in Production Special Series: What pg_stat_statements Is and Isn't (Part 1)

    pganalyze has launched a "Postgres in Production" series on pg_stat_statements, the Postgres extension for tracking query performance. In Part 1, Ryan Booz covers what the extension is, how to enable it, how it stores data and what it tracks. He also explains what it does not track and the problem of cumulative metrics, and why that matters for monitoring setups.

  9. Waiting for Postgres 19: Reduced timing overhead for EXPLAIN ANALYZE with RDTSC

    Lukas of pganalyze explains a committed change for Postgres 19, co-authored with Andres Freund and David Geier, that cuts timing overhead in EXPLAIN ANALYZE by using the RDTSC instruction. The change adds a timing_clock_source setting and compares RDTSC with RDTSCP. Lower overhead should allow auto_explain.log_timing to be enabled for more workloads.

  10. Image: pganalyze

    The Dilemma of the ‘AI DBA’

    A database engineer argues that the 'AI DBA' and 'self-driving database' promises miss the practical reality of using AI tools in production. Agents may create indexes, optimize data models and tune settings, but they cannot be held responsible when a database goes down. The author supports automating routine tasks, while warning against skipping the database expertise needed to handle incidents, particularly with Postgres.

  11. How we used pg_query to rewrite queries to fix bad query plans

    pganalyze explains how it uses the open source pg_query library to rewrite SQL queries programmatically for its new Query Advisor feature, which suggests alternative query patterns to fix bad query plans. pg_query parses queries into a parse tree that can be modified and regenerated as deterministic, syntactically valid SQL, avoiding the pitfalls of regex or AI-generated rewrites. Examples include adding +0 to ORDER BY to avoid index misuse and turning multiple OR clauses into ANY.

  12. Image: pganalyze

    Waiting for Postgres 18: Accelerating Disk Reads with Asynchronous I/O

    Postgres 18 Beta 1 introduces asynchronous I/O, a multi-year architectural change to how the database handles disk reads. A new io_method setting offers sync, worker and io_uring modes, and an AWS benchmark shows read performance doubling, with larger gains from io_uring. AIO is limited to reads in this release, writes stay synchronous, and a new pg_aios view monitors in-flight I/Os, though async I/O makes timing data harder to interpret.

  13. Image: pganalyze

    Postgres vs. SQL Server: B-Tree Index Differences & the Benefit of Deduplication

    A comparison examines how PostgreSQL and Microsoft SQL Server, including Azure SQL, implement, maintain and store B-Tree indexes differently. It benchmarks the effect of value deduplication on index size, finding that PostgreSQL's deduplication reduces index size. A reference table summarizes the differences for engineers optimizing queries or planning migrations.

  14. Image: pganalyze

    Comparing EXPLAIN Plans is hard (and how pganalyze does it)

    pganalyze is expanding its text-based diff interface for comparing Postgres EXPLAIN plans, first released in the beta of Query Tuning Workbooks, to the EXPLAIN plan list under query details. The update also adds buffers as a new comparison metric. The company explains EXPLAIN fundamentals, why comparing plans helps when the planner's choices diverge from reality, and the shortcomings of existing comparison tools that shaped its approach.

  15. Image: pganalyze

    Replacing Oracle Hints: Best Practices with pg_hint_plan on PostgreSQL

    A pganalyze guide explains how teams migrating from Oracle Database to PostgreSQL can replace Oracle optimizer hints using the pg_hint_plan extension. It contrasts Oracle's embedded SQL hints, which can accumulate "hint debt", with Postgres's cost-based planner that relies on statistics, indexes and configuration. The guide covers when hints are still needed, particularly when migrated workloads depend on execution plans previously forced in Oracle.

  16. Image: pganalyze

    Postgres 16: Cumulative I/O statistics with pg_stat_io

    A new pg_stat_io view providing cumulative I/O statistics has been committed to the upcoming Postgres 16, authored by Melanie Plageman, committed by Andres Freund and documented by Samay Sharma. It aims to give a fuller picture of server I/O, which Postgres splits between WAL writes and data directory reads and writes. Tracking which process writes to the data directory after commit has historically been hard, a problem made costlier in the cloud by provisioned IOPS or per-I/O billing such as on Amazon Aurora.

  17. Lock monitoring in Postgres: Find blocking queries in a lock tree with pganalyze

    pganalyze has launched a Lock Monitoring feature that automatically detects locking and blocking queries in Postgres as they happen and can alert users. It replaces manual approaches based on querying the pg_locks view or walking the lock tree with pg_blocking_pids(), which require being present while the problem occurs, since lock information disappears once it resolves.

  18. Image: pganalyze

    How Postgres Chooses Which Index To Use For A Query

    A technical deep dive walks through Postgres source code to explain how the query planner analyzes queries and decides which indexes to use, or whether to use one at all. It covers parse analysis, the stages of planning, and how B-tree index costing works. It also examines a case where Nested Loop Joins affect index usage, and ends by previewing an upcoming pganalyze feature.