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 1qrIKA-003Z0D-Bn for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Oct 2023 13:35:30 +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 1qrIK7-000vBD-Kf for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Oct 2023 13:35:28 +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 <9erthalion6@gmail.com>) id 1qrIK7-000vA6-As for pgsql-hackers@lists.postgresql.org; Fri, 13 Oct 2023 13:35:28 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from <9erthalion6@gmail.com>) id 1qrIK5-000IVU-E9 for pgsql-hackers@postgresql.org; Fri, 13 Oct 2023 13:35:26 +0000 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-98377c5d53eso326702166b.0 for ; Fri, 13 Oct 2023 06:35:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697204123; x=1697808923; darn=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=fZoFMU6krihKpeRw+OhGU63zhmLfqwWQvDeeC0BF6t4=; b=KkHWWXmHSmciagdYZq9R72FGiLlmNGV2vSsbCrGbSvXkcZG2z5ybcuH7tIt6vwZTJn cLVpIRTBjNgHDnbbVxFIjYg42IxrT9Sb9OJi/84uyDifUf7sU68KhFlQwKRizwKCz2Jh hl4qz3x8fUfHzIXDthgIsxoUhNohhdsQuJZhTyRkmu8J2ACP6dJkKf8xV0l7bguVVjGp s+NDOT2GwgNyY/wQXG+9qDAJ2jCk5MnuU2segsLkwjcwzOSwP/4OSQQEjKhoQfuowiPY B64iWydaHCML0iUFmUBvPGmLio9zzGlanGAmP7G2YBeFekv3rlYGnMzUWG4bnurUV301 KgyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697204123; x=1697808923; 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=fZoFMU6krihKpeRw+OhGU63zhmLfqwWQvDeeC0BF6t4=; b=E45FziTcACdz5muTZPW9LDNqp8JLYBs7DxCVRt19Vj9QHAFuQT4jdXx2mlBQ3v0HLY wfxJNXD2yD3mqOZuNHAs/O6S0mq7z1kpfIUUYw9+yaIt8TyxDBzGQnAEOkOxZfUnTXV6 GnglndmNniwW8iL5xG5Zlq3dTFlD/feZ+xTw5QfhymQxUC8Nfb9OiFXcsaGm4vLV6mv2 2C7blcXplnCn5KXNNqgZ7kuXt2d5xLZ9MhZxnkdblo6IWrjmeg0EWAv3TbuHMa4HAm3k CeWodWmoiUR0MS20tgwlo9s4gG0as7k/HIDBCQrIr5Qc8n0L1XByhckhQUE01uDg2rJh Bc1Q== X-Gm-Message-State: AOJu0YyZBv1z9AWCWPc5e911WZbMXBA8+zu23oRbiRDjkztkiEmwUi7O SGZj53QEY6B5hxxekiu6FKs= X-Google-Smtp-Source: AGHT+IHi2oaaMaxftDBVzRD7nbRECABgi5gHSsJ77nJBEpD3bQRyxWhX/6zgYo70WUAg0m/uJuMoNw== X-Received: by 2002:a17:906:3284:b0:9b8:e670:657b with SMTP id 4-20020a170906328400b009b8e670657bmr23730514ejw.64.1697204122710; Fri, 13 Oct 2023 06:35:22 -0700 (PDT) Received: from ddolgov.remote.csb (dslb-178-012-047-187.178.012.pools.vodafone-ip.de. [178.12.47.187]) by smtp.gmail.com with ESMTPSA id t8-20020a17090616c800b009a1be9c29d7sm12566348ejd.179.2023.10.13.06.35.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 06:35:21 -0700 (PDT) Date: Fri, 13 Oct 2023 15:35:19 +0200 From: Dmitry Dolgov <9erthalion6@gmail.com> To: Michael Paquier Cc: Nathan Bossart , "Gregory Stark (as CFM)" , David Geier , Sergei Kornilov , 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: <20231013133519.yf26oncodrvemfjw@ddolgov.remote.csb> References: <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> <20230704044611.GA3373000@nathanxps13> <20230704190256.arszjcwvrjekxj25@ddolgov.remote.csb> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Fri, Oct 13, 2023 at 05:07:00PM +0900, Michael Paquier wrote: > Now, it doesn't mean that this approach with the "powers" will never > happen, but based on the set of opinions I am gathering on this thread > I would suggest to rework the patch as follows: > - First implement an on/off switch that reduces the lists in IN and/or > ANY to one parameter. Simply. > - Second, refactor the powers routine. > - Third, extend the on/off switch, or just implement a threshold with > a second switch. Well, if it will help move this patch forward, why not. To clarify, I'm going to split the current implementation into three patches, one for each point you've mentioned. > When it comes to my opinion, I am not seeing any objections to the > feature as a whole, and I'm OK with the first step. I'm also OK to > keep the door open for more improvements in controlling how these > IN/ANY lists show up, but there could be more than just the number of > items as parameter (say the query size, different behaviors depending > on the number of clauses in queries, subquery context or CTEs/WITH, > etc. just to name a few things coming in mind). Interesting point, but now it's my turn to have troubles imagining the case, where list representation could be controlled depending on something else than the number of elements in it. Do you have any specific example in mind?