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 1w7liW-005fvj-1K for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Apr 2026 02:54:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w7liU-00EPid-2M for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Apr 2026 02:54:03 +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 1w7liU-00EPiU-1Q for pgsql-hackers@lists.postgresql.org; Wed, 01 Apr 2026 02:54:02 +0000 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w7liT-000000024Lk-0WK7 for pgsql-hackers@postgresql.org; Wed, 01 Apr 2026 02:54:01 +0000 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-66c17372965so4043867a12.1 for ; Tue, 31 Mar 2026 19:54:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775012040; cv=none; d=google.com; s=arc-20240605; b=Fmwlir77iCxhJPm0J+c+jJKkBPU/tWsFiH/DZmKHon/8ETS6m3+VI9MXj3/G/20eSh gfetzPj6IV2uQxODkyzC8AZgcMsGPL+RSDM9CpajIEz2pTxEO3R1jktfob8gNc5qikiC 5dCZLW+7p6NMJx01hrtEf4Tmg7SeQM9WoOBm5JCTAYSPQNZP346z93n2r4G1i3nM/bCM ud6HbxHWdno1M2jhPiOfkWzLt7khPSeagsB/sJixRqfSoeftsjIE3/w4XsWj9r+dpnGx /mU25twn+2prrm+J/0nawsL1KfXFSOJaaBL3B/GeuhxLc3CxtMWTx4WOum5Xb09Hil93 AwJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=p3xu52sSNn7kQU1mftQWvaTXTt950jpSs4QHi4gg8s4=; fh=JUgxecNCsw2Bs5nqpiyTfxBGOKP9Z59eSR/eS3q/2IE=; b=XBwgKEwE0knGkX2Occ4NgYDZUEDxPxUKtiT8773dRgkdjucCxCS3vFm981ghTDi2tN LzchOouhuJouFjO0ybYnG+F0JcR5EezRZmcQdjassqSdmr45dG+eo212YTPnmL1o1YSb xLhFz/A3NJk3YuHzZSm0JbWrOggMJ5Ey4TZpslUVxQp5Z29HJBdflpRbTqe0KJZ8kAAc pKEazQl8MsOeHg4ir58x7JtwqF3ERzSnczygClZ7dhwUQVplr5gXSgjZHtDDgHVoig9D NOKnib8ePfyBWro2sHjmGmbX5NuHMSPKYUyconQwOrRYBCKnxGS8lrpLK50bP41ipqIT sJwQ==; 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=1775012040; x=1775616840; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=p3xu52sSNn7kQU1mftQWvaTXTt950jpSs4QHi4gg8s4=; b=X6QP7vySk3eeNBUIP3JOh/2YZQog2i3snFmUYnLmhJngZWThUTfzrrTHAc8yTDJt3S CYQY2pCc9nkbgg9lSaA+ra3McxNlved8nwC9IHFl1DFLkX7oblNVRI75SYDT9zvuz3jn trgVzmDiUstJd3T9eufyAsqQRQnRJ6tpK39IAj26MAkarrTTUxvJKkcAfLiTA4RaR8CY gxC/JgNn3REzlJ/bFwVJmisDIjo+nqXt+p2WCBVHWuDnuNSHBt9xatBuzB21AUzPueKc 0YNEXpamaWEmX2w5PBioZDWTYTj9rlGmYXfAWpZmM6HsNqf84M/Y2ZcusnfzYYKEiIbM Z77Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775012040; x=1775616840; h=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=p3xu52sSNn7kQU1mftQWvaTXTt950jpSs4QHi4gg8s4=; b=lDlIqUkrwQOV0rgex353DaJxTymIVRHqog19QALM0k6uw6s9E05FMPWxBhx4+Fej7i PHq7pCqAeru8fClISEGRzsbFEDf1LBwtQvIIVTgdKTaOPPWh3LPM57Bdx5Xb3c93TMcd 4u3SQK9pE69ypONGIgKzxmsfw10yThMLm16+6mul9/vkDOiP3yNtvZjuZD8s2XZ0DC/6 Bpd2qu87XhfG3cJSFteHtDs9sl6eq4VTV/VATRdaBE2WBSevUnpz9VLsuOnkffWDZMMx XCl58M9lkgOnsw3LN+pLn9zXHfik8MKwyRr5YUUGx1JOQ8d6D7rYHJwksPy9BtMryBkv mgZw== X-Forwarded-Encrypted: i=1; AJvYcCVOwvilV288Zner+IFCzleadF5pLkcl4COBZ5PKcKtTvSXYdCbJ28sNp3saoVhSurq7bfqYRfuLZlhxHHMZ@postgresql.org X-Gm-Message-State: AOJu0Yw8EsGKvELNptVPkc3JeUj8bx1tKq5W/j8bDplIIONEnbqYUoNv NLctEij1Hdg1uJ+N7HJbx64vqZQAS7deYizLA+eUxCiyekH5BmFhJdehylkACyYGgYxdX3IKiDU oDKnVdmtt7GkJESEON8aRu4c924ipIrBgrpZ8VjQ= X-Gm-Gg: ATEYQzwil2Mrbq+y05HPntSd/f1+E9YednjR2ZnNbAYSfhtGlR5x+naSXluhW4cXSdi BCctujJ9aXcMjvPKuVNIxuen4JYuBykWhs8FZTWZ3b/ZC8gEghrNEzqODCYEu98H6S12DAQb5ZE UzlvddhACG25LYPX9RQJZlKQqsRRhp5vFvFJgEhc4NkIvuaGJQOo3WJ6q0ClCh+1uGH4L6z3Hp5 nj3DrFevvXk7h+EaQItpIrO97cpfapvHNJXHQOBMjdKpqQusPBTWzBjCWyaWL5dcdlOe5DjBiXg yQe4GQ== X-Received: by 2002:a05:6402:1471:b0:66b:b714:45c4 with SMTP id 4fb4d7f45d1cf-66db03ae841mr1125892a12.12.1775012039641; Tue, 31 Mar 2026 19:53:59 -0700 (PDT) MIME-Version: 1.0 References: <8437F4D0-9DFB-4045-9318-CC3C5BA2E267@paquier.xyz> In-Reply-To: From: Sami Imseih Date: Tue, 31 Mar 2026 21:53:48 -0500 X-Gm-Features: AQROBzBQmzTNWUxx9Qwe5sP-ZhWXo5Ibw-8yVD6ILHyICXDGNRshjUxfVFDp8V4 Message-ID: Subject: Re: Refactor query normalization into core query jumbling To: Michael Paquier Cc: Lukas Fittl , zengman , pgsql-hackers , Julien Rouhaud Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > >> I see where you're coming from on that, but I don't think we can > >> remove anything here in practice: > > > > Yes. Not unless we want to rely on the parser to track the lengths in > > Const, which could be invasive, but I have not looked into it. > > Hmm. We may not want to get down to that, still that would be > cheaper than reprocessing the parsing of the query string twice. Although unless an extension, at least pg_stat_statements, should not be doing this double work often, and if it is it is due to heavy churn on entries. > >> I still think it'd be reasonable for us to include > >> ComputeConstantLengths in core to complete the picture of what we're > >> doing with _jumbleElements and the length field already anyway. Its > >> basically a way to fully hydrate the partially filled out JumbleState > >> from the initial jumble. > > > > I fully agree, ComputeConstantLengths is an optional post-jumble-query step > > for a consumer that wishes to calculate the lengths. The length calculation > > is not unique to a plug-in, so in my mind the work it's doing is core > > jumbling functionality. > > Okay. I could fall into that for this release. Marking the > JumbleState as a const is the most important piece here. I do agree. > I'm +-0 regarding this routine, but I can also see your point about how it's > useful to give at least the option to extensions to have a > recomputation of the Const lengths, the same way as PGSS. What are > the extensions that would use that? https://github.com/search?q=fill_in_constant_lengths&type=code A few well-known extensions/tools out there based on a Github search. -- Sami