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.96) (envelope-from ) id 1vaUrK-009RAn-0i for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Dec 2025 08:13:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vaUrI-003TB9-2i for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Dec 2025 08:13:37 +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.96) (envelope-from ) id 1vaUrI-003TB1-1m for pgsql-hackers@lists.postgresql.org; Tue, 30 Dec 2025 08:13:37 +0000 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vaUrH-003JAf-2o for pgsql-hackers@postgresql.org; Tue, 30 Dec 2025 08:13:36 +0000 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4775e891b5eso39274775e9.2 for ; Tue, 30 Dec 2025 00:13:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767082414; x=1767687214; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=EP4aJ+fZ/Sj8JeuGjH+IjgiFrji6ZGtRc5j5IVM3GuI=; b=iej14PmJt/TFh/eTi40FKF7mY/aAPj812JkGGjGnJ/ZXHbjofywZ7zbP7UaUzb/xM4 JgiiJG2Vqx7okxoxMHlSvJCPtF4XW9C1JKAOLbSdja9Y741bk9B3r30OF71LthIh8Ym5 FUij+4jR4tYvxcSWh+1aXGrQJKzzN0CqZD43Ko9r9qZc9x7/3jBL/p6NBL7ROKBIDfKo I1/xmziiBUw2fhzS18/UbpbNhz0cPBniVN35wgYY9A1D1nX8fXBbgYMtjI0Mh/e6DbJj aai6T8wwe7GsjCLo0zYLzbvCO6CWRlReT1Ywe8L5wNXjWrDChjyaVNniPosiKTu/SIwo 9c/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767082414; x=1767687214; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EP4aJ+fZ/Sj8JeuGjH+IjgiFrji6ZGtRc5j5IVM3GuI=; b=vqa/mQTnI3w2hxfSoOg7+OfEQzkSHzcsNCMYXMTO6q21sPdu24POkTER5uLGI2cSFK 16tCmX1NMY0CaBY0YD9sU+kU5SRajkkYoikLYnEcv5fpa6P1GhzJcbdJBRg+WzxYDSak CdLcKftY7Jo+6tqXtD7botUVHKeDIZT8q2ihMBj+tSbagos+dbDDJWjckvucMnB3595l uWmNW8SzT+UoJCkuysv435xgEz1R5rgvVVkMNqb8UzqlVSym8NUm6GDzjvkChDrt6isT +8uIKMGpcb6ebVY0oQoL88MSsmJJc8C/lIeyCSG44FuYlvug0pLhLpNzNedDCOCukK1F RDsQ== X-Forwarded-Encrypted: i=1; AJvYcCXeHzUzUEIiDNHJo2kX9NozVPS/Yqnm7j/kYdEuop6XH2jR4aeEBd6KnnlsDIWQtRYYRl5XBpypBatbhxWe@postgresql.org X-Gm-Message-State: AOJu0YzYg7SHhH1EGnIa51Ves2EIZvj1isNrdQOzAa+N2pO+nDZJQmb3 I9ghVYpWBB8OqOz7NCIYOZD/yV3g3fIyNLpQGAz+uqq4QKdxI8FnfRpJ X-Gm-Gg: AY/fxX5e+cSWFyYO3AihxIYYfwZzyiX2BfnUb4Q61duNgvWNZkQ0EzTInCGv8oGtXR+ 6jZ+2dFMCvS3fliKpKsSqmMqVXp7nP4hTOOfn5T5XNM8V5p2IjLfWhu4MdVA4lM+f4cTq/oSGmz egcHbOZMv+u3/Skv3gYIfSbne3KNBQt8wsvgOTZRGqysq4YTCbXnzmMEIdoBO2z1oEahUGMYxca Iw+yGooG+hz/J6KyV1xKXDEZqhLHqBiWjyOnfep2/W27JAv5a3aXkVLnrQEK0bN8JREcyo3zCpb lIUZTNKhOGXriNOZ6ZX+vBPsg0J93a6AWdGBj1qbRJaNYl4r8+8BR16+h212Y2q36xFh4u/aBEp /e0klXod4h1Rc9FiC33F4jBb7MmmXEl2S3h16M3kHiWwlPgbUldG2+RATRLrzWc5rpiy8jcmnre 6tllgXCxv0uXQrHI/zJIcmj6jgaqDRZ229htkP0HF68D1O2faNem6//cqTOQ9Fpx1s326XjZlNM yGCJdSSOW8rVZgjpOg5FTgLHI9nLTuQ9kx7dRM76A2MCA== X-Google-Smtp-Source: AGHT+IE/uB/wDaxzA2z+cbtQZxIcFyHMwR+ljjMYb5JHfIEjs0ZnuGfN+K26hQHmy6fLIlIXloMupA== X-Received: by 2002:a05:600c:1d1d:b0:477:9dc1:b706 with SMTP id 5b1f17b1804b1-47d19576d2cmr343205065e9.19.1767082413777; Tue, 30 Dec 2025 00:13:33 -0800 (PST) Received: from ip-10-97-1-34.eu-west-3.compute.internal (ec2-15-237-197-144.eu-west-3.compute.amazonaws.com. [15.237.197.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47be272e46fsm617776095e9.4.2025.12.30.00.13.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Dec 2025 00:13:33 -0800 (PST) Date: Tue, 30 Dec 2025 08:13:32 +0000 From: Bertrand Drouvot To: Sami Imseih Cc: zengman , pgsql-hackers Subject: Re: Refactor query normalization into core query jumbling Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Tue, Dec 23, 2025 at 10:35:18AM -0600, Sami Imseih wrote: > v3 implements this approach without a callback. This establishes a clear > boundary: core owns JumbleState modifications, extensions consume the > results through the API. > Thanks for the new patch version. Some random comments: === 1 + SetConstantLengths((JumbleState *) jstate, query, query_loc); This cast seems unnecessary. === 2 +CompLocation(const void *a, const void *b) In the commit message I can see "Functions are renamed to match core naming conventions" but wasn't comp_location() better? === 3 + /* + * generate the normalized query. Note that the normalized + * representation may well vary depending on just which + * "equivalent" query is used to create the hashtable entry. We + * assume this is OK. + */ + norm_query = GenerateNormalizedQuery(jstate, query, Should part of this comment be on top of the GenerateNormalizedQuery() definition instead? Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com