From 905be0ddf42be687b31490f32f4e691cf5b32f79 Mon Sep 17 00:00:00 2001 From: GradedJestRisk Date: Fri, 20 Sep 2024 10:21:23 +0200 Subject: [PATCH 1/3] [doc][postgresql] add tracking active queries and index creation progress using client --- src/_posts/databases/postgresql/2000-01-01-monitoring.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/_posts/databases/postgresql/2000-01-01-monitoring.md b/src/_posts/databases/postgresql/2000-01-01-monitoring.md index 1d2daeb5a..8a5339a60 100644 --- a/src/_posts/databases/postgresql/2000-01-01-monitoring.md +++ b/src/_posts/databases/postgresql/2000-01-01-monitoring.md @@ -89,6 +89,12 @@ stuck ones. Viewing running queries is only available from the database dashboard. {% endnote %} +### Using an sql client + +Running queries will appear in [pg_stat_activity](https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-ACTIVITY-VIEW) view, filtering on `state = 'active'. + +You can monitor `CREATE INDEX` and `REBUILD INDEX` progress in [pg_stat_progress_create_index] (https://www.postgresql.org/docs/current/progress-reporting.html#CREATE-INDEX-PROGRESS-REPORTING). + ## Exploring Query Statistics From 390f297b6a124ef887a5175096e47bf26825a2b1 Mon Sep 17 00:00:00 2001 From: GradedJestRisk Date: Fri, 20 Sep 2024 10:22:58 +0200 Subject: [PATCH 2/3] [doc][postgresql] add tracking maintenance operation --- src/_posts/databases/postgresql/2000-01-01-monitoring.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/_posts/databases/postgresql/2000-01-01-monitoring.md b/src/_posts/databases/postgresql/2000-01-01-monitoring.md index 8a5339a60..d883c428b 100644 --- a/src/_posts/databases/postgresql/2000-01-01-monitoring.md +++ b/src/_posts/databases/postgresql/2000-01-01-monitoring.md @@ -143,3 +143,10 @@ to be activated manually. {% note %} Consulting query statistics is only available from the database dashboard. {% endnote %} + +## Maintenance operations + +Scheduled VACUUMs are run automatically and can affect database performance. +While executing, they will appear in [pg_stat_activity](https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-ACTIVITY-VIEW) view, not appear in [pg_stat_progress_vacuum](https://www.postgresql.org/docs/current/progress-reporting.html#VACUUM-PROGRESS-REPORTING) view. + +You can log them using [log_autovacuum_min_duration](https://www.postgresql.org/docs/current/runtime-config-logging.html#GUC-LOG-AUTOVACUUM-MIN-DURATION) parameter, and check the last time a table has been VACUUMed in [pg_stat_user_tables.last_autovacuum](https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-ALL-TABLES-VIEW) view. From ad895231af4725b576ea8af6d1c30fd297c7960e Mon Sep 17 00:00:00 2001 From: GradedJestRisk Date: Fri, 20 Sep 2024 10:36:03 +0200 Subject: [PATCH 3/3] [doc][postgresql] update modification date --- src/_posts/databases/postgresql/2000-01-01-monitoring.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_posts/databases/postgresql/2000-01-01-monitoring.md b/src/_posts/databases/postgresql/2000-01-01-monitoring.md index d883c428b..1403a34f7 100644 --- a/src/_posts/databases/postgresql/2000-01-01-monitoring.md +++ b/src/_posts/databases/postgresql/2000-01-01-monitoring.md @@ -1,7 +1,7 @@ --- title: Monitoring and Auditing Your Scalingo for PostgreSQLĀ® Addon nav: Monitoring and Auditing -modified_at: 2024-03-26 12:00:00 +modified_at: 2024-09-20 10:35:00 tags: databases postgresql addon index: 7 ---