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 1twu1D-000qJf-Lw for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Mar 2025 02:27:55 +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 1twu1C-00DeWD-B6 for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Mar 2025 02:27:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1twu1C-00DeSy-0m for pgsql-hackers@lists.postgresql.org; Tue, 25 Mar 2025 02:27:54 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1twu19-000zNf-2l for pgsql-hackers@lists.postgresql.org; Tue, 25 Mar 2025 02:27:53 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 52P2Re2v1189113; Mon, 24 Mar 2025 22:27:40 -0400 From: Tom Lane To: Sami Imseih cc: Michael Paquier , Christoph Berg , PostgreSQL Hackers , ma lz Subject: Re: query_id: jumble names of temp tables for better pg_stat_statement UX In-reply-to: References: <1831838.1742656359@sss.pgh.pa.us> <80506.1742660683@sss.pgh.pa.us> <461405.1742691859@sss.pgh.pa.us> Comments: In-reply-to Sami Imseih message dated "Mon, 24 Mar 2025 20:51:14 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1189111.1742869660.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 24 Mar 2025 22:27:40 -0400 Message-ID: <1189112.1742869660@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Sami Imseih writes: > For example, I have seen users add comments to SQLs to differentiate > similar SQLs coming from different tenants. This patch makes this no lon= ger a > somewhat decent workaround to overcome the fact that pg_stat_statements > does not track schemas or search path. Well, the workaround is different, but that doesn't mean there is no workaround. You just need to alter a table alias in the query: select * from foo s1; select * from foo s2; As against this, there is probably also a set of people who would *like* identical queries on identically-rowtyped tables in different schemas to be merged. Right now they have no way to make that happen. So yeah, it's a nontrivial behavioral change. But I think on the whole it's likely to be more useful. We could always revert the change during beta if we get too much pushback. regards, tom lane