Re: query_id, pg_stat_activity, extended query protocol

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: "Imseih (AWS), Sami" <samimseih(at)gmail(dot)com>, Anthonin Bonnefoy <anthonin(dot)bonnefoy(at)datadoghq(dot)com>, "Imseih (AWS), Sami" <simseih(at)amazon(dot)com>, Andrei Lepikhov <lepihov(at)gmail(dot)com>, kaido vaikla <kaido(dot)vaikla(at)gmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: query_id, pg_stat_activity, extended query protocol
Date: 2024-09-02 01:11:43
Message-ID: ZtUQz05c3EF3GElC@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Aug 31, 2024 at 09:47:41AM +0800, jian he wrote:
> /* test \bind queryid exists */
> select query_id is not null as query_id_exist
> from pg_stat_activity where pid = pg_backend_pid() \bind \g
>
> /* test that \parse \bind_named queryid exists */
> select pg_backend_pid() as current_pid \gset pref01_
> select query_id is not null as query_id_exist from pg_stat_activity
> where pid = $1 \parse stmt11
> \bind_named stmt11 :pref01_current_pid \g

I need to spend a bit more time with my head down for this thread, but
couldn't we use these commands with various query patterns in
pg_stat_statements and look at the shmem counters reported through its
view?
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Xing Guo 2024-09-02 02:23:49 Re: JIT: Remove some unnecessary instructions.
Previous Message Michael Paquier 2024-09-02 00:53:30 Re: Test 041_checkpoint_at_promote.pl faild in installcheck due to missing injection_points