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 1txDdN-004wFN-Lr for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Mar 2025 23:24:37 +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 1txDdL-00Baxx-4o for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Mar 2025 23:24:35 +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 1txDdK-00Bavd-Qx for pgsql-hackers@lists.postgresql.org; Tue, 25 Mar 2025 23:24:34 +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 1txDdI-001AXi-1U for pgsql-hackers@lists.postgresql.org; Tue, 25 Mar 2025 23:24:34 +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 52PNOK7s1324037; Tue, 25 Mar 2025 19:24:20 -0400 From: Tom Lane To: Michael Paquier cc: Sami Imseih , Christoph Berg , Lukas Fittl , PostgreSQL Hackers , ma lz Subject: Re: query_id: jumble names of temp tables for better pg_stat_statement UX In-reply-to: References: <461405.1742691859@sss.pgh.pa.us> <1189112.1742869660@sss.pgh.pa.us> Comments: In-reply-to Michael Paquier message dated "Wed, 26 Mar 2025 08:10:16 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1324035.1742945060.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 25 Mar 2025 19:24:20 -0400 Message-ID: <1324036.1742945060@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Michael Paquier writes: > [ v6-0001-Add-custom-query-jumble-function-for-RangeTblEntr.patch ] Couple of minor review comments ... * In 5ac462e2b, this bit: # node type - if (($t =3D~ /^(\w+)\*$/ or $t =3D~ /^struct\s+(\w+)\*$/) + if ($query_jumble_custom) + { + # Custom function that applies to one field of a node. + print $jff "\tJUMBLE_CUSTOM($n, $f);\n"; + } + elsif (($t =3D~ /^(\w+)\*$/ or $t =3D~ /^struct\s+(\w+)\*$/) fails to honor $query_jumble_ignore as the other if-branches do. Perhaps it's unlikely that a node would have both query_jumble_custom and query_jumble_ignore annotations, but still, the script would emit completely incorrect code if it did. Also, the "# node type" comment should probably be moved down to within the first "elsif" block. * In the v6 patch, this doesn't read very smoothly: + * Expanded reference names. This uses a custom query jumble functio= n so + * as the table name is included in the computation, not its list of + * columns. Perhaps better + * Expanded reference names. This uses a custom query jumble functio= n so + * that the table name is included in the computation, but not its li= st of + * columns. * Also, here: + considered the same. However, if the alias for a table is different + for semantically similar queries, these queries will be considered + distinct. I'd change "semantically similar queries" to "otherwise-similar queries"; I think writing "semantically" will just confuse people. Otherwise LGTM. regards, tom lane