public inbox for [email protected]  
help / color / mirror / Atom feed
From: Erik Wienhold <[email protected]>
To: Costa Alexoglou <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: Empty query_id in pg_stat_activity
Date: Fri, 6 Dec 2024 16:44:29 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAJ+5Ff4sLuTMpg__fZH67UdaC2bWpLK1U3a8kkj_BvqO8ScYQw@mail.gmail.com>
References: <CAJ+5Ff4sLuTMpg__fZH67UdaC2bWpLK1U3a8kkj_BvqO8ScYQw@mail.gmail.com>

On 2024-12-06 15:32 +0100, Costa Alexoglou wrote:
> Hey folks, I am running Benchbase and pgbench at the same time just for
> debugging purposes, and I notice that sometimes query_id is missing
> from pg_stat_activity. Any clue why this is happening?

What's your Postgres version?

Could be that query_id is not reported because the session is using the
extended query protocol.  This has been fixed just recently in releases
14.14/15.9/16.5/17.1.  From the 14.14 release notes:

> * Report the active query ID for statistics purposes at the start of
>   processing of Bind and Execute protocol messages (Sami Imseih)
>   https://postgr.es/c/b36ee879c
>
>   This allows more of the work done in extended query protocol to be
>   attributed to the correct query.

Another possibility is that the session just disabled compute_query_id:
https://postgr.es/m/472115375.225506.1683812791906%40office.mailbox.org

-- 
Erik






view thread (3+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Empty query_id in pg_stat_activity
  In-Reply-To: <[email protected]>

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

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