pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Erik Wienhold <ewie@ewie.name>
To: Teja Jakkidi <teja.jakkidi05@gmail.com>
Cc: pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: Query_id is not being populated for all the pids
Date: Mon, 20 May 2024 23:17:06 +0200
Message-ID: <8f64b4cb-c983-4dfa-b937-a3bda6729f94@ewie.name> (raw)
In-Reply-To: <B57361F6-41F2-4EF7-B46B-982DF2E4A9C9@gmail.com>
References: <B57361F6-41F2-4EF7-B46B-982DF2E4A9C9@gmail.com>

On 2024-05-20 21:48 +0200, Teja Jakkidi wrote:
> When we query pg_stat_statements in Postgres, it has a column
> “query_id” which is not having any value for most of the sessions. 
> 
> Compute_query_id is set to AUTO
> 
> Can someone please help me understand why the query_id is missing most
> of the sessions and how is it populated in the background?

Are you using PgJDBC or the extended query protocol?

This reminds me of this thread:
https://www.postgresql.org/message-id/flat/CA%2B427g8qBArPuqwZOuYVhdoCQUsdbutR18fG7Gt7%2B3JunuHsjA%4...

That was about pg_stat_activity, though.  But the key take-away was that
query_id is not computed in the extended query protocol which is used by
PgJDBC.

-- 
Erik





view thread (2+ messages)

Message-ID: <8f64b4cb-c983-4dfa-b937-a3bda6729f94@ewie.name>
Permalink:  ../8f64b4cb-c983-4dfa-b937-a3bda6729f94@ewie.name/
Also on:    postgresql.org/message-id/8f64b4cb-c983-4dfa-b937-a3bda6729f94@ewie.name

 · 

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-admin@postgresql.org
  Cc: ewie@ewie.name, teja.jakkidi05@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Query_id is not being populated for all the pids
  In-Reply-To: <8f64b4cb-c983-4dfa-b937-a3bda6729f94@ewie.name>

* 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