Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s9ANn-000EYa-Do for pgsql-admin@arkaria.postgresql.org; Mon, 20 May 2024 21:17:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1s9ANm-005LcM-DI for pgsql-admin@arkaria.postgresql.org; Mon, 20 May 2024 21:17:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s9ANl-005LcD-O8 for pgsql-admin@lists.postgresql.org; Mon, 20 May 2024 21:17:22 +0000 Received: from mout-u-107.mailbox.org ([2001:67c:2050:101:465::107]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s9ANh-001BHl-TN for pgsql-admin@lists.postgresql.org; Mon, 20 May 2024 21:17:20 +0000 Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-107.mailbox.org (Postfix) with ESMTPS id 4Vjr456hBwz9t4h; Mon, 20 May 2024 23:17:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ewie.name; s=MBO0001; t=1716239830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zk9JehU5IKb1m3DxcW5acPaxl9gQmJsYLDivClEb/sU=; b=pJSfcsD9jVfo9xa3RnwaHMrxIEqagM9V9AcQK0yP290eZw3myV1cCZWAu/PY3onrXneitU dubwuJvnpLdtU3xBQIv0n2McXYG6I78HogHCNBY/F4tBsxFL42nlobmP0LNxS1cyMMFLNk kihJaMuCxj+cffDTLQNu9V4UM/rRdaaVw7J6XldK3+sc/+cJ8F/y3+wSQwBmq54DAVFd01 3nu1yM+T+GjvTH5/7xOXictpCvBczMu4WGVvpFRTiD8Szq6Ofw4aLSTzXc2Nd0dfR5SBfJ OSWHeDmBIJJZquX+hhVgb2cRO+J0x/j2O15KY5BRcOva4OKys9VP9JLc+g0CVw== Date: Mon, 20 May 2024 23:17:06 +0200 From: Erik Wienhold To: Teja Jakkidi Cc: pgsql-admin Subject: Re: Query_id is not being populated for all the pids Message-ID: <8f64b4cb-c983-4dfa-b937-a3bda6729f94@ewie.name> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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%40mail.gmail.com 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