pg_ash v1 - Active Session History for PostgreSQL

From: PostgresAI via PostgreSQL Announce <announce-noreply(at)postgresql(dot)org>
To: PostgreSQL Announce <pgsql-announce(at)lists(dot)postgresql(dot)org>
Subject: pg_ash v1 - Active Session History for PostgreSQL
Date: 2026-04-03 09:06:09
Message-ID: 177520716916.3221089.1804726113216120208@wrigleys.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-announce

pg_ash samples `pg_stat_activity` once per second via `pg_cron`, stores encoded snapshots in partitioned tables, and provides 32 SQL functions for wait event analysis.

Pure SQL + PL/pgSQL. No C extension, no `shared_preload_libraries`, no restart required. Works anywhere `pg_cron` runs — managed providers (RDS, Cloud SQL, AlloyDB, Azure Database for PostgreSQL, Supabase, etc.), self-managed, Kubernetes, or any other deployment.

Storage: ~100-200 bytes per sample, ~30 MiB/day with `TRUNCATE`-based partition rotation (zero bloat).

Analysis functions include top waits, per-query wait profiles, wait event drill-down, time-range investigation, and timeline visualization. Functions are designed to chain naturally for iterative root cause analysis — by a human in psql or by AI tools such as Claude Code, OpenCode, or Codex.

PostgreSQL 14-18. Apache 2.0. CI tested.

[https://github.com/NikolayS/pg_ash](https://github.com/NikolayS/pg_ash)

Browse pgsql-announce by date

  From Date Subject
Previous Message Gavin M. Roy via PostgreSQL Announce 2026-04-03 09:03:54 tree-sitter-postgres, libpgfmt, pgfmt, and libpgdump