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 1w6AgU-0041Zh-0v for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Mar 2026 17:09:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w6AgS-00AyPb-2M for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Mar 2026 17:09:21 +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 1w6AgS-00AyPT-1R for pgsql-hackers@lists.postgresql.org; Fri, 27 Mar 2026 17:09:20 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w6AgR-00000001Ltb-12fH for pgsql-hackers@postgresql.org; Fri, 27 Mar 2026 17:09:20 +0000 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-66b0684f98eso3495356a12.3 for ; Fri, 27 Mar 2026 10:09:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774631358; cv=none; d=google.com; s=arc-20240605; b=BhLq19TAWDhZdIf6sSptUBlhANiVm/qjEOuNJHyhSxL46SfNXZ+TfKj18qyiTy7N0n 8sRJ7+F8BXSG655pMvmUxTxeM3btA7Yojyt9SXLdDPSRehLQqWbsZlBPhzz35TI9NpCr aDxkU/dxRe7rVX/Dq36x+LFnyVAA84nKuSvviCtw0sM93CmzbSL5nY7r7IDM2A5v5uIR SEQ3ycBSfDaKmWYP5292Hn4+Eeq211p9PCn6SfdOdJrDMSaSyzEjHP7QvOP10dRZBXAM jRAF5HwVyZh1yidVDVN+rH/hqYlj/ABpSneNmFL3FLQgT5oMG2O63KF8TfmoiRTmMP7B H90A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=XamVNYTrlMlCsK9J2xI7mQhkmrauXUc2cvUiC3atl9U=; fh=rab4eFNAiigcqp77q+mIg9nxxCdFye1EgdY9phpuhBA=; b=Kj35POjVGqNS7jvrGQYeKImGwMSIvpZZV/I6F0D9+1GxicstTXmTMXGBRFcYsATWTX fmz+ysc7wY6BSuUdd2hznzFfJBhbdQHEUmybUMycxr06isapdGBNKlO+DQ8hcz7Z5cP2 /3CxcKxUyvPKnuvFAsaPMHvELN9o7cJTvhC/tmWjSWPON+7L4RrWJOm831/CZwXB/XiW YBueKn782tAjd94sbUN/ulz7re0qs2koHEluIOBA+82JCDbW0Vq4lHoXsusnUhNzps9E afOinRVREtaf/N3G5qseE2uzw/prhCWZOyBSR7IOKhU0r2G8lzyRltEYypLjTPOjZEK5 n8TQ==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774631358; x=1775236158; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=XamVNYTrlMlCsK9J2xI7mQhkmrauXUc2cvUiC3atl9U=; b=O5UCE3j+A6q7xA40/NZ4gWUs0X2n16ZHR0tK5xKTegy3UF9r6Htb27PMbH0cHbbKXt B7532RE0D6Mqs69cxIoScAak7X7EUfYHHT8ZGllNIPR/y700zE3d7CvCWV9pXPiw4Szu u25y1sN2qTxszG6bKQt7S/K5TfXVMP9nkGmVo79xwS3R0y7UNNllWyUJfURJpsVgc16L pHIHSFJmOdONe5aRBIbbWed26HQ3gLgLzOQLrPj/cHoNSDsV8F+iXfKGHZDDnxQ/VMu9 wv2ILwObXWM8fxn2opAGSdsEhHRwmwgA+RyWq+Emcz3BaOfM4By+SY/Kw2jnyUYxC9Je 94Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774631358; x=1775236158; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=XamVNYTrlMlCsK9J2xI7mQhkmrauXUc2cvUiC3atl9U=; b=Gy9IbnE3UTs/xKKnROcyYtTUgWW6UasDs1dtODKh/OxNYF1vHa4YNIssdnfMr37FYl zF8AIpfTPe2JiNMNvqYSJdBobby+MlXjJqh+ByA/37PUn0FpHULrnbsT1M/9wQprbiX7 tWfFLPeQQ/pwn+AWGmE72sTJBc3JB7w3hyQqsyMOdt1rTMb6XAWGwhMJudCwjX+iOP7x vduiNf8KLeNehO/Reeak0okfVA+INLj2wzWB2yVjouf3XajpJV4KjV5HFu4Y6FsYdjvK u31ZgoVlyOL9jN0Zq6PH/YRjC024KRiMeuyw2GqCpFmBD6as7+ZrWMTs0FD2uUG7TCJg E3ug== X-Forwarded-Encrypted: i=1; AJvYcCXbospMcYlRKBuB6XYrMrVgwD0HjU2Jv107esRfE42zlwxhUC3+kjOi6Slycf2sfzvGyveZB9bBxHdwqjVS@postgresql.org X-Gm-Message-State: AOJu0Yw6p229GJpvdq4JbkmlF3zwm2LC0n6TdXqc/WrsnFdxFkkLEExJ I0IhM07At2l9YDqKrwB/n6tzT0A0aedCLeBpvfmD7OgtTwPX2NuHf508KtdB86rku9qjaCcSzir +Ibz6q7Phz1CLGI87+6j4PTq0fpYCUfU1pASIkeo= X-Gm-Gg: ATEYQzwxUqYuoNIswZsybrkYRD5/N0Jk+aKifHbEEyU+Ej1H1B1EUcdggiHpGMfSbyM VSUnJCMrzVfMwNkw/RFviyyNUCRd3wGJf6zu9tBZLPVm+Vkgho+k7qC+ZCh56dnSH3RIuu1uVPf VrFub03Y0chx1Okw5xtyz7KRwkqqOMchBNZv6wE0sTAwHKYqTRHE107Qg0Wy8Ug+3XMZVCYL2DI VOOho5CunBGgw4br9DdmL6Lq5Y5xY3KRLcOiVHTiukOhEgYqZuwoTL0qHIi1CQvlx8Iehw2CLD9 uR5c/Q== X-Received: by 2002:a05:6402:3718:b0:667:f3dd:6062 with SMTP id 4fb4d7f45d1cf-66b28a54a50mr2015548a12.17.1774631357538; Fri, 27 Mar 2026 10:09:17 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Sami Imseih Date: Fri, 27 Mar 2026 12:09:04 -0500 X-Gm-Features: AQROBzDJzCes2t-BJ3bygl3qRtjy6j_C2daWhlEaiFJqdNkQIscuVPf2v_pvpuQ Message-ID: Subject: Re: Refactor query normalization into core query jumbling To: Lukas Fittl Cc: Michael Paquier , zengman , pgsql-hackers , Julien Rouhaud Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Thu, Mar 26, 2026 at 10:18=E2=80=AFPM Michael Paquier wrote: > > This line of arguments is stronger for the normalization of the query > > string. Why should the core code decide what a normalized string > > should look like when it comes to the detection of the constants, if > > any? Instead of a dollar-quoted number, we could enforce a bunch of > > things, like a '?' or a '$woozah$' at these locations. > > Fair enough, though I haven't seen any extensions that do that in > practice - its reasonable to have normalization result in a query > string that's parsable again and can be passed to EXPLAIN > (GENERIC_PLAN). with regards to generate_normalized_query, AFAICT, the most common case is extensions are using it for is dollar quoted number, but I agree this one is a gray area. > What if we only put the ComputeConstantLengths (as Sami had it in v7) > in core, together with making JumbleState const? I agree that ComputeConstantLengths should be in core. This one is not a gray area IMO. The query jumble already records constant locations, but leaves the lengths unset. ComputeConstantLengths is just the completion of that work. There could be no other interpretation, unlike generate_normalized_query, of what the lengths should be. -- Sami Imseih Amazon Web Services (AWS)