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 1tkuUw-007mJ4-43 for pgsql-hackers@arkaria.postgresql.org; Thu, 20 Feb 2025 00:33:02 +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 1tkuUt-00Fynj-Ov for pgsql-hackers@arkaria.postgresql.org; Thu, 20 Feb 2025 00:32:59 +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.94.2) (envelope-from ) id 1tkuUt-00Fymx-FH for pgsql-hackers@lists.postgresql.org; Thu, 20 Feb 2025 00:32:59 +0000 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tkuUs-001oBA-0D for pgsql-hackers@postgresql.org; Thu, 20 Feb 2025 00:32:58 +0000 Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-30797730cbdso3367101fa.3 for ; Wed, 19 Feb 2025 16:32:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740011575; x=1740616375; 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=QTEc6B0C5NHCCgPwu9ErMMqxXxR8SdrHe7KLDlwL48I=; b=M2DGlvxFrcNuzm6G0C7XVp1H1gBakT7xnXkwTAgxg3BY92JvGMr/vv6nlqwfbTGN+n MqcHbMrIXAjbw5rRYbpuSf2vW3tNZocM0lBJomKKAS37bJ+JsM5hrDIan147+rJIFuh7 GVihzMTNSJSu5Ux2c9l8fgi53NOhlmUaroIlhEW8x5pzzNyg86gk6tEQntHSslEXzSzx t0RLK43kwgSlC85Z1Mko13BOLjPKmexvhBn5P0xqrx90hjQ0ZyiLZuR37WYRoXbIYyZJ Fbjx204QRIfu2KkHQTkfksW2acuMUOr5Hw31WxHRl7vTtHWvFB1uST1A5WIZ9QhABz2l PLjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740011575; x=1740616375; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QTEc6B0C5NHCCgPwu9ErMMqxXxR8SdrHe7KLDlwL48I=; b=ZY2MnQ06cLvtTxdtVutEoGHsrRjQYLI92WG3+dZew2iRd5csWQQGuUVDsmHHCJSELU 1g//AUV/iHYBEulfIFO40u5Pb5CVQ2QEQhxf0E5CPit+W2FJYJgiYgNJfm3F4MfvYSqb nh7tk8hh1i7WiLzSeQ7lkk5Hnli957pUYQUHx7hGeoq5/OMqtjT+4nS5tIZYNQSxFX92 q3bpTBspQCpvgxrBxSGJs4HfuN6I4hzLs3qosY3FjQn0I5r2Wz762EpXW7b5zS8Sia0V j7OUCiBtCK8yK57kJExT94p8u2fdyPeqbrCHovndGIHyoDbMNzE1/5YHjakJ5vtcZ/rm iZjw== X-Forwarded-Encrypted: i=1; AJvYcCWC36/2W6HbAIlXOHFAQ3WyWNBtLb9Fw9l4LyW82KvHjAm/vKZFXUPgo+fTwbW/KcdCR5XZCphLGlOlhoNP@postgresql.org X-Gm-Message-State: AOJu0YyDVbF3Gf7CEa3/RFvUM73i83LCEVASIqeRwmfKe7QYC2SfNOCf yh0ysguwrya7jDkZm78vXkpmNCpgp76+NroPFpnR4sbjEg/2mBbV9w/klecgsClZnfZz6nwbXYb OUlEjPQzqVdPklrV6+NatTh2c0ag= X-Gm-Gg: ASbGncsO2gLVwp5NcpoIvS0iybYNejTaRirVT6AcMqtUcuXQjXKixv28tTmzlko4GL5 RyZ0K+zymHDvc0bubMa3oeZwLp+Ej9sq/6Ac2+FGsP0QDzFbotTYBkmqDKTa/Bk8seqODObs= X-Google-Smtp-Source: AGHT+IHWpRnVNSc7/hCCdLXWvwHNgPMxXOOFYth2prnCI2a9TSN7v57fT4Gk9NjbAg9CxM/J2SE/myVnj8OR/p3WyLc= X-Received: by 2002:a2e:800c:0:b0:308:ec9d:d9d3 with SMTP id 38308e7fff4ca-30a44ed0191mr18153401fa.17.1740011575228; Wed, 19 Feb 2025 16:32:55 -0800 (PST) MIME-Version: 1.0 References: <7AD765EF-14DE-4B3E-8282-E82A9B44DBAA@yandex-team.ru> <0c7770bd-9750-4200-a472-bdb262583c2f@tantorlabs.com> <18631d46-1741-4edc-b116-8d9631cdf919@tantorlabs.com> <4f98ec33-c627-4eb4-84f3-9994a0982277@tantorlabs.com> <623db69f-b40a-4d50-b1bd-bb073fcc4336@tantorlabs.com> <3546e2a7-5831-4c0a-996b-358d4ec483a6@tantorlabs.com> <6bf3059f-7ebe-4640-8870-1220f83b88ed@tantorlabs.com> <7b9df88f-3015-464b-881e-4c6a7b3a5c03@tantorlabs.com> <6f305fd1-44c3-4189-81ef-238777277e5e@tantorlabs.com> In-Reply-To: <6f305fd1-44c3-4189-81ef-238777277e5e@tantorlabs.com> From: Sami Imseih Date: Wed, 19 Feb 2025 18:32:44 -0600 X-Gm-Features: AWEUYZmlzCuzVY1sO2OVqZtHCE2aJMC3abD3fbKE6wLI2NB8gdz_xcXROeCpUEM Message-ID: Subject: Re: Sample rate added to pg_stat_statements To: Ilia Evdokimov Cc: Alexander Korotkov , Michael Paquier , Greg Sabino Mullane , Andrey Borodin , Alena Rybakina , pgsql-hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > As you can see, the query has not been normalized. Is it a bug, expected or undefined behavior? No, this behavior is expected. The ability to normalize a statement is only available during post_parse_analyze (pgss_post_parse_analyze), as this is when we have access to JumbleState. In your example, pgss_post_parse_analyze is skipped and during the subsequent \bind_named, ExecutorEnd (pgss_ExecutorEnd) does not have access to JumbleState, leading to the query to be stored without normalization. It will be nice to make JumbleState available to all hooks, IMO. -- Sami