~/talk

Point-in-time query tuning and observability with pg_stat_statements

Talkat Citus Con: An Event for Postgres 2022 · 2022-04-12..04-13· [databases]
slides:none on file

pg_stat_statements is cumulative by default (resets on restart or manual reset) and exposes 31 columns of stats; the method shown snapshots that view periodically into tables, computes per-statement deltas, and visualizes calls/min and exec-time in Grafana. Implementation uses pg_stat_statements output, scheduling via pg_cron or a TimescaleDB background job, storing rows in a partitioned/hypertable (default retention/compression reduces storage). Default statement buffer is ~5,000 entries; the demo pipeline works and reveals spikes and inefficient queries.

AI-written summary · about

  1. 0:00Introduction
  2. 1:21pg_stat_statements primer
  3. 10:47How to track historical data
  4. 14:42Demo of pg_stat_statements
  5. 22:57pg_stat_monitor & pganalyze
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.