-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add postgresql query progress api #2797
base: master
Are you sure you want to change the base?
Add postgresql query progress api #2797
Conversation
### 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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this page include only Scalingo features (not PG ones), I suggest to move this to Troubleshooting
https://doc.scalingo.com/databases/postgresql/troubleshooting
## 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the actual behaviour in 2023, but may have changed since then.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember how I changed log_autovacuum_min_duration
, maybe I asked the support, as we can't access pgsql.conf
file.
Problem
Some features on PG progress API are not supported on Scalingo, but are not documented.
Check this blog post.
Solution
Add resources using official docs.