Read the collector before you run it.
The investigation starts from a read-only psql script that your team runs and reviews. No credentials leave your environment, and nothing is installed.
The investigation starts from a read-only psql script that your team runs and reviews. No credentials leave your environment, and nothing is installed.
psql "host=... dbname=... user=..." -X -f pg-evidence-collector.sql -o evidence.txtpg_monitor. On RDS or Aurora, the master user can grant it to a dedicated role: GRANT pg_monitor TO your_role;default_transaction_read_only = on, a 30-second statement_timeout and a 1-second lock_timeout for its own session.pg_monitor role. Not yet tested against RDS or Aurora themselves.| Section | Source | Why |
|---|---|---|
| Server and settings | version(), pg_settings (non-default only), extensions | Context for every other number |
| Database activity | pg_stat_database | Cache hit ratio, temp files, rollbacks, deadlocks |
| Top statements | pg_stat_statements, top 50 by total time | Where database time actually goes |
| Tables and indexes | pg_stat_user_tables, pg_stat_user_indexes | Size, scan patterns, dead tuples, vacuum and analyze timing, unused indexes |
| Connections and waits | pg_stat_activity, pg_blocking_pids() | Pool behaviour, idle transactions, current blocking |
| Maintenance health | Transaction ID age, checkpoints, replication slots, vacuum progress | Problems that build up slowly before they hurt |
pg_stat_statements. PostgreSQL normalizes them to $1, $2, ….The output is a plain text file. Read it first. Table, column and index names appear throughout, and the current-activity section includes the first 120 characters of running queries, which can contain literal values. Delete or redact anything you are not comfortable sharing; the investigation notes what was removed.
EXPLAIN (ANALYZE, BUFFERS) output for the slow requests, from a safe environment.Start with the problem and the evidence you already have. You will get a direct answer on whether a scoped investigation is the right next step.
Prefer to talk first? Book a 20-minute triage call.