pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add two attributes to pg_stat_database for parallel workers acti
Date: Mon, 11 Nov 2024 01:44:02 +0000
Message-ID: <E1tAJTF-001ESF-Jj@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e7a9496de90657e2161f68b3a5a9b2d9b0b7bb07

Modified Files
--------------
doc/src/sgml/monitoring.sgml                  | 18 ++++++++++++++++++
src/backend/catalog/system_views.sql          |  2 ++
src/backend/executor/execMain.c               |  5 +++++
src/backend/utils/activity/pgstat_database.c  | 19 +++++++++++++++++++
src/backend/utils/adt/pgstatfuncs.c           |  6 ++++++
src/include/catalog/catversion.h              |  2 +-
src/include/catalog/pg_proc.dat               | 10 ++++++++++
src/include/pgstat.h                          |  4 ++++
src/test/regress/expected/rules.out           |  2 ++
src/test/regress/expected/select_parallel.out | 27 +++++++++++++++++++++++++++
src/test/regress/sql/select_parallel.sql      | 14 ++++++++++++++
11 files changed, 108 insertions(+), 1 deletion(-)



Message-ID: <E1tAJTF-001ESF-Jj@gemulon.postgresql.org>
Permalink:  ../E1tAJTF-001ESF-Jj@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tAJTF-001ESF-Jj@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add two attributes to pg_stat_database for parallel workers acti
  In-Reply-To: <E1tAJTF-001ESF-Jj@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox