Performance Monitoring
Monitor Last VACUUM Runs with pg_stat_user_tables
Jul 12, 2026 / · 9 min read · postgresql database administration sql queries vacuum autovacuum pg_stat_user_tables dead tuples postgres dba ·Monitor Last VACUUM Runs with pg_stat_user_tables When a table's dead tuple count keeps climbing and last_autovacuum stays weeks old, autovacuum is falling behind on that table. pg_stat_user_tables shows that gap in a single query, without tailing logs or guessing at a schedule. Purpose and Overview pg_stat_user_tables …
Read MoreMonitor PostgreSQL ANALYZE Progress with pg_stat_progress_analyze
Jun 18, 2026 / · 6 min read · postgresql database administration sql queries statistics progress reporting pg_stat_progress_analyze postgres dba pg_class ·Monitor PostgreSQL ANALYZE Progress with pg_stat_progress_analyze Running ANALYZE on a multi-hundred-gigabyte table and wondering whether it is halfway done or barely started is a common operational question with, until recently, no good answer. pg_stat_progress_analyze answers it: a live view that reports the current …
Read MorePostgreSQL Performance Monitoring: Identify Slow Queries
PostgreSQL: Identify Slow Running Queries in Real-Time Purpose This PostgreSQL SQL query provides a real-time snapshot of sessions whose current query (or, for idle sessions, most recent query) started more than 30 seconds ago. It acts as a powerful alternative to a traditional slow query log, helping you proactively …
Read MoreBoost PostgreSQL Efficiency with Cache Hit Ratio Analysis
PostgreSQL Performance Tuning: Analyze Cache Hit Ratio with pg_stat_statements Purpose This PostgreSQL query empowers you to gain critical insights into the efficiency of your query workload by measuring the cache hit ratio from the pg_stat_statements extension. Cache hit ratio is a crucial metric for evaluating how …
Read MoreAnalyze PostgreSQL Query Times with pg_stat_statements
Aug 29, 2024 / · 8 min read · postgresql performance performance tuning pg_stat_statements pg_database pg_roles ·Analyze PostgreSQL Query Times with pg_stat_statements PostgreSQL 13 renamed the timing columns of pg_stat_statements: total_time became total_exec_time, mean_time became mean_exec_time, and the same suffix went onto the minimum, maximum and standard deviation columns. A query copied from an older tutorial fails on a …
Read More