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 1pT2xs-0002MP-5q for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Feb 2023 15:48:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pT2xq-0007DM-AQ for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Feb 2023 15:47:58 +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 <9erthalion6@gmail.com>) id 1pT2xp-0007Cg-VL for pgsql-hackers@lists.postgresql.org; Fri, 17 Feb 2023 15:47:58 +0000 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from <9erthalion6@gmail.com>) id 1pT2xj-0000Do-LS for pgsql-hackers@postgresql.org; Fri, 17 Feb 2023 15:47:57 +0000 Received: by mail-ed1-x529.google.com with SMTP id l11so6354516edb.11 for ; Fri, 17 Feb 2023 07:47:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=NEzkEaJy8iw2GiQN31wtY4AqRHDh2eBJkiqSzY8g/XY=; b=NoosjeaWul6sUjon+vkaitXrY9Ryh1t+/fsPmJdaK1DQO+5po9PmCS/TvsdhMBXiwl btjV8ARc9rkbTNwcF9CkaYt86pR4oyEu/6VMqoMd2Eqne1K5FszohPAn2OgbKCb45wf/ Milc19g5xDsOZbK27QcFgA6msdoQwLiCMV/z070d8za9VXFHJPNWCopNXe6SFZg/97sA Cqcy3g+cABYvO6JPc8wowDIFocEnViEw5FDk9Agfap7n21MW1n8OsEJDfIee2Dl+9CqS X1zBN/O8RbgFihqIk/c4z9dbFOMFeV66+H8qpUT5KeMbP4+bU0doNzHMXW1ch+lCtdEP aRfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=NEzkEaJy8iw2GiQN31wtY4AqRHDh2eBJkiqSzY8g/XY=; b=agbWRF/sYkyPT6fh4odiJm903xVRuXA506ZoeoyOtq0nNS1Qw0ofkVKKQ0xsy6nTsD Z6pRG0C3dKvbYf4K2p6KsGCeLuVJ5lDkhCi7bUxRbPFnuevJ2t+MS95XosrVjJxkobpc ejHOuzg9oyHJ3OsRz+TM56J0BMsPD/FE1aIwcU5+MiAjgyckVgQ04OvFyR1vYy+HDgfK 6vLACOAuxbJurLrdieJS+kGi7FFbFO3KmxN675SCHXBI82+u+6JVVnHqEmwpFH1L9v5z X3mQPVhiNf9+yjl9xvivIhKvINdinWmTq990yc4x+VY+JVXJLZtfLZc3wyPzel3ZJpH3 k+7g== X-Gm-Message-State: AO0yUKX7poTawgRW8+ovqwfVLbEhve9zD44mJNTkA1dcLSEeMnlSSEce Md9jIZnaGjPAN9zHYNiM5YE= X-Google-Smtp-Source: AK7set+Poi0IXT0zIETovZzegG2AB+Ej3RK5KohVTo1IBU6fkS0R8r6RG81YfhFg4P0M1629z2WbnA== X-Received: by 2002:aa7:c60c:0:b0:4ac:be68:9f9b with SMTP id h12-20020aa7c60c000000b004acbe689f9bmr2190043edq.23.1676648870535; Fri, 17 Feb 2023 07:47:50 -0800 (PST) Received: from erthalion.local (dslb-178-012-041-046.178.012.pools.vodafone-ip.de. [178.12.41.46]) by smtp.gmail.com with ESMTPSA id p1-20020a50cd81000000b004ad726479acsm1872861edi.78.2023.02.17.07.47.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 07:47:49 -0800 (PST) Date: Fri, 17 Feb 2023 16:46:02 +0100 From: Dmitry Dolgov <9erthalion6@gmail.com> To: David Geier Cc: Sergei Kornilov , Michael Paquier , Alvaro Herrera , Marcos Pegoraro , vignesh C , Robert Haas , Zhihong Yu , David Steele , PostgreSQL-development , Greg Stark , Pavel Trukhanov , Tom Lane Subject: Re: pg_stat_statements and "IN" conditions Message-ID: <20230217154602.uf3a3cgqeoeysycz@erthalion.local> References: <20230205113346.gmbf5ycnukuhnmqa@erthalion.local> <2420105.1675612952@sss.pgh.pa.us> <20230205195600.e3bhwszzm5kdyyxl@erthalion.local> <966631675800892@znolar4klagewshm.sas.yp-c.yandex.net> <20230209150238.rdtwruh5i34hdag5@ddolgov.remote.csb> <20230211104707.grsicemegr7d3mgh@erthalion.local> <20230211120820.y7krq37jubnjsa5b@erthalion.local> <07919318-6c35-a13f-6a1d-98686a3e38de@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <07919318-6c35-a13f-6a1d-98686a3e38de@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Wed, Feb 15, 2023 at 08:51:56AM +0100, David Geier wrote: > Hi, > > On 2/11/23 13:08, Dmitry Dolgov wrote: > > > On Sat, Feb 11, 2023 at 11:47:07AM +0100, Dmitry Dolgov wrote: > > > > > > The original version of the patch was doing all of this, i.e. handling > > > numerics, Param nodes, RTE_VALUES. The commentary about > > > find_const_walker in tests is referring to a part of that, that was > > > dealing with evaluation of expression to see if it could be reduced to a > > > constant. > > > > > > Unfortunately there was a significant push back from reviewers because > > > of those features. That's why I've reduced the patch to it's minimally > > > useful version, having in mind re-implementing them as follow-up patches > > > in the future. This is the reason as well why I left tests covering all > > > this missing functionality -- as breadcrumbs to already discovered > > > cases, important for the future extensions. > > I'd like to elaborate on this a bit and remind about the origins of the > > patch, as it's lost somewhere in the beginning of the thread. The idea > > is not pulled out of thin air, everything is coming from our attempts to > > improve one particular monitoring infrastructure in a real commercial > > setting. Every covered use case and test in the original proposal was a > > result of field trials, when some application-side library or ORM was > > responsible for gigabytes of data in pgss, chocking the monitoring agent. > > Thanks for the clarifications. I didn't mean to contend the usefulness of > the patch and I wasn't aware that you already jumped through the loops of > handling Param, etc. No worries, I just wanted to emphasize that we've already collected quite some number of use cases. > Seems like supporting only constants is a good starting > point. The only thing that is likely confusing for users is that NUMERICs > (and potentially constants of other types) are unsupported. Wouldn't it be > fairly simple to support them via something like the following? > >     is_const(element) || (is_coercion(element) && is_const(element->child)) It definitely makes sense to implement that, although I don't think it's going to be acceptable to do that via directly listing conditions an element has to satisfy. It probably has to be more flexible, sice we would like to extend it in the future. My plan is to address this in a follow-up patch, when the main mechanism is approved. Would you agree with this approach?