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 1tJaVX-0041lx-3Y for pgsql-general@arkaria.postgresql.org; Fri, 06 Dec 2024 15:44:43 +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 1tJaVU-00CjiI-FB for pgsql-general@arkaria.postgresql.org; Fri, 06 Dec 2024 15:44:41 +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 1tJaVU-00CjiA-2M for pgsql-general@lists.postgresql.org; Fri, 06 Dec 2024 15:44:41 +0000 Received: from mout-u-204.mailbox.org ([80.241.59.204]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tJaVR-001N3w-Up for pgsql-general@lists.postgresql.org; Fri, 06 Dec 2024 15:44:40 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (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-204.mailbox.org (Postfix) with ESMTPS id 4Y4bCz4SJZz9tQC; Fri, 6 Dec 2024 16:44:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ewie.name; s=MBO0001; t=1733499871; 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: in-reply-to:in-reply-to:references:references; bh=KbB65uIS6HPay2HOb5Pprgd+OzoPb6TtfvL6f5vUuI8=; b=LNQd4VVyreiiOCR+EAH46FEfy+wU8Fx0V7O+z/RCSGVPWFmjEfT924S/EbKyguyi2msSGB JC1CObVR//8xWgDfw2dtUoQXJ0wht2cWR+xI8KvZmcfjALdWXNt83Be9d1qTg5edgzumJT o7eF1AJdJYAnuVqNSXFRJm9E7i0RgtM2fkHjggRzZ9TLyinjs1NXYG2FX4sb2SK+SvsPA6 2VPYUsB2k0ohU5VSN8orErUurTZK6aCfm8EwXOPKo/L3XsuszGQ4GOGlBa1+TJWEx6Lggr x3FH6kaKx+5EcWubTASGgCQ5a16tz/x4g6gv6lvIGOjmVzinlQO6Ww0KYxpjUQ== Date: Fri, 6 Dec 2024 16:44:29 +0100 From: Erik Wienhold To: Costa Alexoglou Cc: "pgsql-general@lists.postgresql.org" Subject: Re: Empty query_id in pg_stat_activity Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4Y4bCz4SJZz9tQC List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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