Postgres FM cover image

pg_stat_statements

Postgres FM

00:00

The Pros and Cons of PG Stat Statements

PG stat statements and auto explain were added in the same release of Postgres 8.4. PGS statments has special list of queries in normalized form, so-called normalized format. When a new entry needs to be inserted, it needs an exclusive lock on shared memory area for PGS statment or PGS stat K cash. If some selects are happening concurrently in parallel, those selects hold a shared lock and your insert needs to wait. For example, imagine we have like 5,000 that's default records in PGS statings, and somebody is slowly reading them during, for example, 100 milliseconds. It's quite slow. And while they are reading it, one session,

Transcript
Play full episode

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app