pg_mon
pg_mon · PostgreSQL extension for query monitoring with execution-time histograms and plan information in a shared view
Overview
PostgreSQL · 11, 12, 13, 14, 15, 16, 17
Usage
Sources:
pg_mon records query execution-time and row-count histograms plus scan and join information in shared memory. It must be preloaded:
Restart PostgreSQL, then create the extension and query its view. Restrict the reset function if ordinary users must not erase monitoring state:
Operation
Version 1.0 has an upstream CI matrix for PostgreSQL 11 through 17. pg_mon.plan_info_immediate makes plan information visible after planning but can add locking overhead; pg_mon.plan_info_disable suppresses plan details. Histogram boundaries are fixed, and the collected state is memory-resident rather than a durable history. The install SQL grants SELECT on the view to PUBLIC, so review visibility requirements on shared systems.