Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pHgdQ-0002BW-4H for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Jan 2023 07:43:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pHgdO-0000cZ-LT for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Jan 2023 07:43:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pHgdN-0000br-JL for pgsql-hackers@lists.postgresql.org; Tue, 17 Jan 2023 07:43:54 +0000 Received: from new4-smtp.messagingengine.com ([66.111.4.230]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pHgdJ-00018l-Tt for pgsql-hackers@lists.postgresql.org; Tue, 17 Jan 2023 07:43:52 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailnew.nyi.internal (Postfix) with ESMTP id BBEE2581E52; Tue, 17 Jan 2023 02:43:47 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 17 Jan 2023 02:43:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1673941427; x= 1673948627; bh=9AuKMFggn2RYGgnGEd0Y9fMpnhubm7HH0IIlUkB+SeQ=; b=f SFwT99UXfpy6LGeZT70i3T7RarSgSFIyZJG97geUh7qXq0oZsYmtEbVzJMR18mzl HGOkNl2AFMHpSCMowjULBNd45Vy7dVhwf9hptslEuTuFETwpbd5NzZQqPrOBCS+K oTZ0BRkkaobO9h9hY3s8zb/kcwWzOTBv5FOauhWNZ6HP/w3OeOBJvoDUIiwHycHI G9oZr4ADQ1lchcQ2/8QaItVp0LYyPkbZkQChe3kSXeEBJnf6SKOmeYBWAqf4J3OS t0joMGoPmmpcKnfFkPqWJ8PPbbRqoY+oe3CR6mdMDWtcZJe/IMQHV8BuSuzWCduj E2zlStTd8ACnRrs99v1gw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedruddthedguddugecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomheprfgv thgvrhcugfhishgvnhhtrhgruhhtuceophgvthgvrhdrvghishgvnhhtrhgruhhtsegvnh htvghrphhrihhsvggusgdrtghomheqnecuggftrfgrthhtvghrnhepheelffeggedujeet iefhleetuddvieffhfffvdejvdffgeejkeduleduheduieefnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhdrvghishgvnhhtrhgr uhhtsegvnhhtvghrphhrihhsvggusgdrtghomh X-ME-Proxy: Feedback-ID: i131946ab:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 17 Jan 2023 02:43:46 -0500 (EST) Message-ID: Date: Tue, 17 Jan 2023 08:43:44 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: Generating code for query jumbling through gen_node_support.pl Content-Language: en-US To: Michael Paquier Cc: Postgres hackers , "Drouvot, Bertrand" References: <34491a4e-2664-6ea7-662c-b13d18d2a92d@enterprisedb.com> From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 17.01.23 04:48, Michael Paquier wrote: >>> Anyway, when it comes to the location, another thing that can be >>> considered here would be to require a node-level flag for the nodes on >>> which we want to track the location. This overlaps a bit with the >>> fields satisfying "($t eq 'int' && $f =~ 'location$')", but it removes >>> most of the code changes like this one as at the end we only care >>> about the location for Const nodes: >>> - int location; /* token location, or -1 if unknown */ >>> + int location pg_node_attr(jumble_ignore); /* token location, or -1 >>> + * if unknown */ >>> >>> I have taken this approach in v2 of the patch, shaving ~100 lines of >>> more code as there is no need to mark all these location fields with >>> "jumble_ignore" anymore, except for Const, of course. >> >> I don't understand why you chose that when we already have an established >> way. This would just make the jumble annotations inconsistent with the >> other annotations. > > Because we don't want to track the location of all the nodes! If we > do that, pg_stat_statements would begin to parameterize a lot more > things, from column aliases to full contents of IN or WITH clauses. > The root point is that we only want to track the jumble location for > Const nodes now. In order to do that, there are two approaches: > - Mark all the locations with jumble_ignore: more invasive, but > it requires only one per-field attribute with "jumble_ignore". This > is what v1 did. Ok, I understand now, and I agree with this approach over the opposite. I was confused because the snippet you showed above used "jumble_ignore", but your patch is correct as it uses "jumble_location". That said, the term "jumble" is really weird, because in the sense that we are using it here it means, approximately, "to mix together", "to unify". So what we are doing with the Const nodes is really to *not* jumble the location, but for all other node types we are jumbling the location. At least that is my understanding.