Re: Introduce WAIT_EVENT_EXTENSION and WAIT_EVENT_BUFFER_PIN

Masahiro Ikeda <ikedamsh@oss.nttdata.com>

From: Masahiro Ikeda <ikedamsh@oss.nttdata.com>
To: "Drouvot, Bertrand" <bertranddrouvot.pg@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>, Robert Haas <robertmhaas@gmail.com>, Andres Freund <andres@anarazel.de>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-06-08T01:57:55Z
Lists: pgsql-hackers
Hi,

On 2023-05-19 16:48, Drouvot, Bertrand wrote:
> While at it, I think that making use of an enum might also be an open 
> door
> (need to think more about it) to allow extensions to set their own wait 
> event.
> Something like RequestNamedLWLockTranche()/GetNamedLWLockTranche() are 
> doing.
> 
> Currently we have "only" the "extension" wait event which is not that
> useful when
> there is multiples extensions installed in a database.

(Excuse me for cutting in, and this is not directly related to the 
thread.)
+1. I'm interested in the feature.

Recently, I encountered a case where it would be nice if
different wait events were output for each extension.

I tested a combination of two extensions, postgres_fdw and neon[1],
and they output the "Extension" wait event, but it wasn't immediately 
clear
which one was the bottleneck.

This is just a example and it probable be useful for other users. IMO, 
at least,
it's better to improve the specification that "Extension" wait event 
type has
only the "Extension" wait event.

[1] https://github.com/neondatabase/neon

Regards,

-- 
Masahiro Ikeda
NTT DATA CORPORATION



Commits

  1. Refactor some code related to wait events "BufferPin" and "Extension"