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 1twwXN-001Da9-4o for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Mar 2025 05:09:17 +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 1twwXL-00Fq7e-SB for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Mar 2025 05:09:15 +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 1twwXL-00Fq6R-I0 for pgsql-hackers@lists.postgresql.org; Tue, 25 Mar 2025 05:09:15 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1twwXJ-000yvf-2E for pgsql-hackers@lists.postgresql.org; Tue, 25 Mar 2025 05:09:14 +0000 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-227a8cdd241so23141755ad.3 for ; Mon, 24 Mar 2025 22:09:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742879353; x=1743484153; darn=lists.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=1KzkiEo4gAXkIAxGzCzj/LtmcU5YebHJMT7JG9+O5jE=; b=CxyRad7QcOTFxdTm5qAGCQe/d+yYx8uj199sBqFXNiHQ+tLzE4hAYct4m17RM1tydK OmssW2HUPAh91690LMuVLlHs1QA4sRODCPKid/G+8utfX0KDBUq/pqYUykSSY1ejYsCC NL67DfOU2nU3FqJZwDF/U1Y0dwAeTzqxpWZoeI6ZKC8uAh3YlgyV4obR09ywYD6/081k VahlwZmdgzKH9SlgXd7HlP5xSySm7kO40Ifak6AvjaiLy5Hh7QYd3luxZe7EgsbJcqZb 3SgNvfIXF9lvBLuvTArPidXVQGT1Qjtk5F3hYz/TsPBv3rwvKyXgrAvkP30gwyDKp9Wl 77VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742879353; x=1743484153; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=1KzkiEo4gAXkIAxGzCzj/LtmcU5YebHJMT7JG9+O5jE=; b=R/a1yb5T5mHXXSbfalamnnm60/OgT0f+E0sijBniQlTD2GFlAValFW+EJ/qqiNoMc2 mXoP8f1axgP+nJMqcyzv+NBiOrv3xYBLg5n7RQjr/cXOBqrNA8vYhsWL7k1gGo83JRId 7058dK2cALb1aUQH+vWz12oOi+w7gp+Pc4LnXSf9/QTqm7AutCgBZNCRXkuNo6QpjAcl GtgOnW+pXeVY7loC7TcBXaaUTP3ki5SVmUsqJ9Xxjl52WyxNaFDK8nIfnTNC/7OQm7kO Vy421QywjPnNUShhzcY3MyXditTQY6mD71AoUAwXaR3Z5XEzWDd8FK9P5sTDTe6EUCa2 0kJA== X-Forwarded-Encrypted: i=1; AJvYcCXonNDC743H/0TJtAFgq81E+sjVNhO/AqRhPbN/xH8mHeu/CcJGoBmFg1A7jcn6NHZluqlLt9k/hgHZl1xg@lists.postgresql.org X-Gm-Message-State: AOJu0Yx8uU7AevHQpClw0vWQwshaALeZ2bYMAP2r+WCX8Bl/x8aPT6RN xerBq0rpRAKFzRc1bPjodw5NN2VNVeoto8HAuncfoTLtK85JyqOs X-Gm-Gg: ASbGncucGWFUiKFUm14Wg38kGVI0uuzLEAOI5YTvRiceZGYdpHk87OvxP1Ml2B2qzop dTKf9HybOwqZK2iHokhEv+eTLYhaU3y7sjI/Cv8qx804G9IC0E4cKMEQvMgBhPK3BUcOz9vXlZh Y36788SyVTaPtjAK1xb0i6J3/bhwgsubztXS0kIkYnkYsj5VIeyXkaGfT3BKFoq/z05VO7PPRvn +wpsNW0DfLCim+ahTAihbetGAizInrMiD9a1/stRL2U5WHGKJD5cthQ6pTVyWlo7Uw9wWWEpT/L iVtbrITkSQI/9ET/8vGZ7KC/17GrXGWyRCZW X-Google-Smtp-Source: AGHT+IFDHQv9UhFyJthv6u2NL/+u/jNJv+SO6+wO6S8MOCJHiYYGopkz0j/ci+uK/uaTPZC0pL+1BQ== X-Received: by 2002:a05:6a21:6d99:b0:1f5:8e39:9470 with SMTP id adf61e73a8af0-1fe432060cfmr33672978637.31.1742879352489; Mon, 24 Mar 2025 22:09:12 -0700 (PDT) Received: from jrouhaud ([115.43.41.38]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-af8a292b0besm8099513a12.49.2025.03.24.22.09.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Mar 2025 22:09:11 -0700 (PDT) Date: Tue, 25 Mar 2025 13:09:07 +0800 From: Julien Rouhaud To: Tom Lane Cc: Sami Imseih , Michael Paquier , Christoph Berg , PostgreSQL Hackers , ma lz Subject: Re: query_id: jumble names of temp tables for better pg_stat_statement UX Message-ID: References: <80506.1742660683@sss.pgh.pa.us> <461405.1742691859@sss.pgh.pa.us> <1189112.1742869660@sss.pgh.pa.us> <1192185.1742871390@sss.pgh.pa.us> <1203118.1742877125@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1203118.1742877125@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Tue, Mar 25, 2025 at 12:32:05AM -0400, Tom Lane wrote: > > I'm not opining one way or the other on whether squashing an IN list > is desirable. My point is that a GUC is a poor way to make --- or > really, avoid making --- such decisions. The reasons we took away > from previous experiments with semantics-determing GUCs were: > > 1. The scope of effect of a GUC is seldom what you want for such > things. There are going to be some queries in which you want behavior > A, and some in which you want behavior B, and in the worst case you > want different behaviors in different parts of the same query. It's > really painful to make that happen. > > 2. Tools that are not entitled to set the value of the GUC are forced > to be prepared to cope with any setting. That can be anywhere from > painful to impossible. Didn't that ship already sailed in pg14 when we allowed generating custom query_id? Now: > For the specific context of controlling how query jumbling happens, > there's still another problem: the actual statement-merging behavior of > pg_stat_statements will depend on the totality of settings of the GUC > across the entire system. It's not very clear to me what will happen > if different sessions use different settings, much less if people > change the setting intra-session; but I bet a lot of people will find > it surprising. 62d712ecf did no one any favors by marking that GUC > USERSET rather than something that would prevail system-wide. One of the requirement for the custom query_id was that you shouldn't be allowed to change the algorithm dynamically, at least not unless a superuser agrees to maybe break everything, which is why compute_query_id is marked as PGC_SUSET. I think that the same reasoning should apply here and if the GUC is kept it should be at least at that level.