Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qGXvi-0005uX-7r for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Jul 2023 04:46:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qGXvg-00079J-Lu for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Jul 2023 04:46:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qGXvg-00079A-CX for pgsql-hackers@lists.postgresql.org; Tue, 04 Jul 2023 04:46:20 +0000 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qGXvc-00250W-CE for pgsql-hackers@postgresql.org; Tue, 04 Jul 2023 04:46:19 +0000 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6682909acadso2496127b3a.3 for ; Mon, 03 Jul 2023 21:46:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688445974; x=1691037974; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=5MLaQulX62fkPjIy0wI9UTblW8/srcg+v0omxIO1yMY=; b=joWyV2xmZctmpUPCVitl7cICY+ZEyWzkr30J2twmC1qZivhJkdqZSigGyEDkbWKbCf fu/WptI8gdwiqbAsSAM1mnbm01CaQoW0H8GhvQlktjVpIrO29AjC0PKFxC4HhFXsNqGw I2BpI10yoV1elDlYYZtcPx04Re2d9Lx9SoSpUdHrZKNWAOZiKK/y1OL/p2A5O1IW/4O7 NLt3vFewIIxdgfoStkGHt0kDpJxBKHjJQWA+1RQ+FTEJtYuZh5LyXEqSTe6H3D/bKGv5 Lm3iOHOn5vbIc+cRU41eUVJmd6pMyrb4IhfTvtX9FSvXotHysfOIbpNJofWQGKU4m3Wv vwYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688445974; x=1691037974; h=in-reply-to:content-transfer-encoding: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=5MLaQulX62fkPjIy0wI9UTblW8/srcg+v0omxIO1yMY=; b=IzcsRTk+N7ZLmyxaekmXrneZgEnH5xcVrSy5+zkCH/+zXGx8MgpEtJhmHyUlclNf24 5ddFzVLW6RJFe3rlgK3VwGny0+qhjeaqY8vzhKIKZlyYyV0uNF1ganhosGHMPpH7dlbk JNx6aaIZarb9VelQjJA6iZdLBv8GWETxkI9y1k2Yg7n+rjXhh2kmABg+ohQWDXuRF5jW 1mFz+oMrcF9npIXKm4DL27wfisyBKzFUtYrPoXttUOzlV0nBvJ+qSa8HH5P1thvV/Lq4 w8KqvweNWrGzhOqSJNKkMSULUOoYShj8QyAt5/Qa6hjNd4EgVOvY7++FhPPq7gwItSeO j2QQ== X-Gm-Message-State: ABy/qLalvT19Gu+MiHuewCQImNgQvRTEF7RyXMyUiRmS2JSYVn2LWaX9 kChgh0yiaCd5WtL5LWe4Cv4= X-Google-Smtp-Source: APBJJlEIIF+IhYVp0g+/FORd+npdIRpOksMhHyqfBlmGlPN8fnKG+XGS158kisyj69dl1dIId/RHHA== X-Received: by 2002:a05:6a00:21ca:b0:67f:6226:58ac with SMTP id t10-20020a056a0021ca00b0067f622658acmr11619443pfj.14.1688445974246; Mon, 03 Jul 2023 21:46:14 -0700 (PDT) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id e13-20020a62aa0d000000b0067526282193sm13156288pff.157.2023.07.03.21.46.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 21:46:13 -0700 (PDT) Date: Mon, 3 Jul 2023 21:46:11 -0700 From: Nathan Bossart To: Dmitry Dolgov <9erthalion6@gmail.com> Cc: "Gregory Stark (as CFM)" , David Geier , Sergei Kornilov , Michael Paquier , Alvaro Herrera , Marcos Pegoraro , vignesh C , Robert Haas , Zhihong Yu , David Steele , PostgreSQL-development , Pavel Trukhanov , Tom Lane Subject: Re: pg_stat_statements and "IN" conditions Message-ID: <20230704044611.GA3373000@nathanxps13> References: <20230211104707.grsicemegr7d3mgh@erthalion.local> <20230211120820.y7krq37jubnjsa5b@erthalion.local> <07919318-6c35-a13f-6a1d-98686a3e38de@gmail.com> <20230217154602.uf3a3cgqeoeysycz@erthalion.local> <8702fa3e-5aac-dcf0-161b-faa2b9eadad6@gmail.com> <20230226104619.jfmwrpd5zrkmp3eu@erthalion.local> <20230314190432.l4oe3wa3pvt5b7hx@erthalion.local> <20230319122734.xkba536kut3g4gcy@erthalion.local> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230319122734.xkba536kut3g4gcy@erthalion.local> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, Mar 19, 2023 at 01:27:34PM +0100, Dmitry Dolgov wrote: > + If this parameter is on, two queries with an array will get the same > + query identifier if the only difference between them is the number of > + constants, both numbers is of the same order of magnitude and greater or > + equal 10 (so the order of magnitude is greather than 1, it is not worth > + the efforts otherwise). IMHO this adds way too much complexity to something that most users would expect to be an on/off switch. If I understand Álvaro's suggestion [0] correctly, he's saying that in addition to allowing "on" and "off", it might be worth allowing something like "powers" to yield roughly the behavior described above. I don't think he's suggesting that this "powers" behavior should be the only available option. Also, it seems counterintuitive that queries with fewer than 10 constants are not merged. In the interest of moving this patch forward, I would suggest making it a simple on/off switch in 0002 and moving the "powers" functionality to a new 0003 patch. I think separating out the core part of this feature might help reviewers. As you can see, I got distracted by the complicated threshold logic and ended up focusing my first round of review there. [0] https://postgr.es/m/20230209172651.cfgrebpyyr72h7fv%40alvherre.pgsql -- Nathan Bossart Amazon Web Services: https://aws.amazon.com