diff options
author | Michael Paquier | 2024-11-11 01:40:48 +0000 |
---|---|---|
committer | Michael Paquier | 2024-11-11 01:40:48 +0000 |
commit | e7a9496de90657e2161f68b3a5a9b2d9b0b7bb07 (patch) | |
tree | 55851ad0de8ead2885921c59e6537bc5ba1a5a90 /src/include/pgstat.h | |
parent | bf8835ea9717df50230c12133cff1b486dcc57be (diff) |
Add two attributes to pg_stat_database for parallel workers activity
Two attributes are added to pg_stat_database:
* parallel_workers_to_launch, counting the total number of parallel
workers that were planned to be launched.
* parallel_workers_launched, counting the total number of parallel
workers actually launched.
The ratio of both fields can provide hints that there are not enough
slots available when launching parallel workers, also useful when
pg_stat_statements is not deployed on an instance (i.e. cf54a2c00254).
This commit relies on de3a2ea3b264, that has added two fields to EState,
that get incremented when executing Gather or GatherMerge nodes.
A test is added in select_parallel, where parallel workers are spawned.
Bump catalog version.
Author: Benoit Lobréau
Discussion: https://postgr.es/m/783bc7f7-659a-42fa-99dd-ee0565644e25@dalibo.com
Diffstat (limited to 'src/include/pgstat.h')
-rw-r--r-- | src/include/pgstat.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/pgstat.h b/src/include/pgstat.h index df53fa2d4f9..59c28b4aca8 100644 --- a/src/include/pgstat.h +++ b/src/include/pgstat.h @@ -386,6 +386,8 @@ typedef struct PgStat_StatDBEntry PgStat_Counter sessions_abandoned; PgStat_Counter sessions_fatal; PgStat_Counter sessions_killed; + PgStat_Counter parallel_workers_to_launch; + PgStat_Counter parallel_workers_launched; TimestampTz stat_reset_timestamp; } PgStat_StatDBEntry; @@ -583,6 +585,8 @@ extern void pgstat_report_deadlock(void); extern void pgstat_report_checksum_failures_in_db(Oid dboid, int failurecount); extern void pgstat_report_checksum_failure(void); extern void pgstat_report_connect(Oid dboid); +extern void pgstat_update_parallel_workers_stats(PgStat_Counter workers_to_launch, + PgStat_Counter workers_launched); #define pgstat_count_buffer_read_time(n) \ (pgStatBlockReadTime += (n)) |