---
title: "pg_stat_statements: everything it can't"
url: https://daily.dev/posts/pg-stat-statements-everything-it-can-t-7p0ewuvv6
source_url: https://postgr.es/p/9l6
type: article
source: "Planet PostgreSQL"
published: 2026-06-03T06:47:16.596Z
updated: 2026-06-03T06:47:44.565Z
tags: ["postgresql"]
reading_time: 14
upvotes: 2
comments: 0
language: 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.

# pg_stat_statements: everything it can't

**[Planet PostgreSQL](https://daily.dev/sources/planet-postgresql)** · 14 min read · 2 upvotes · 0 comments

## Summary

A deep dive into the limitations of PostgreSQL's pg_stat_statements extension. Covers silent entry eviction when the 5000-entry cap is hit, how to detect thrashing via pg_stat_statements_info.dealloc, the failure mode where all query texts go NULL due to file I/O errors, and what the extension never captures at all: execution plans, failed queries, parameter values, sort spills, and replica workloads. Also explains configuration traps including why track_planning is off by default (spinlock contention), how track_utility floods rankings with COMMIT/ROLLBACK, why I/O timing columns read zero without track_io_timing, and the column renames introduced in PostgreSQL 17. Concludes that pg_stat_statements is a cheap, lossy counter store useful for identifying slow query shapes, but not a full query store — it's the foundation you'd build one on.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://postgr.es/p/9l6>

## Similar posts on daily.dev

- [pg\_stat\_statements: everything it tells you](https://daily.dev/posts/pg-stat-statements-everything-it-tells-you-tihzbjd0h) · Planet PostgreSQL · 0 upvotes · 0 comments
- [statements Decides What to Keep](https://daily.dev/posts/statements-decides-what-to-keep-vwgx0iupm) · pganalyze · 0 upvotes · 0 comments
- [Part 1: What It Is and What It Isn't](https://daily.dev/posts/part-1-what-it-is-and-what-it-isn-t-wtgi7rhxh) · pganalyze · 0 upvotes · 0 comments

---

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

[View this post on daily.dev](https://daily.dev/posts/pg-stat-statements-everything-it-can-t-7p0ewuvv6)
