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 1pSCaE-0005Tc-UJ for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Feb 2023 07:52:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pSCaC-0001Kx-KS for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Feb 2023 07:52:04 +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 1pSCaC-0001Kn-9L for pgsql-hackers@lists.postgresql.org; Wed, 15 Feb 2023 07:52:04 +0000 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pSCa7-0001JK-EG for pgsql-hackers@postgresql.org; Wed, 15 Feb 2023 07:52:03 +0000 Received: by mail-ed1-x530.google.com with SMTP id d40so19476999eda.8 for ; Tue, 14 Feb 2023 23:51:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=z1o5J70Vpfxe2qfsmJasRYD4aqNcxiTUgF+kRehPOq4=; b=imQeZu+xWoIxREvo7gPaR/IS102rZuu+khKmXRVjY8pYF+OO2KFsFSL8CbSykpa2CG EJNJBMcEJ2Z/X1cyZ6W2mW3e+9P7cvAu/tVFSmEWfcLcHp14fVuXDHTgbwZ5tVcz80wn Um+sFWrGr/Q/OnMRqS2qHHyAsCVpygQPcB8hcUwxhzYs/8tbJPL0tUA8KYrYdnpG3goo 2ra4xqGwK0w6pl8eNANxPfiPjD6DPmoX9Mb7DdHMwMoSJCeV6wHYA88ur7JR2j+9nZnx GUgsjI5XeDFMcoWOGCCV/GxSAIkYww1ffcSDvypUQA/yXNVJx/j7XvoZt3l4fOkMcTrV lL2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=z1o5J70Vpfxe2qfsmJasRYD4aqNcxiTUgF+kRehPOq4=; b=MpTDjAx4nxwdW6cCy+w5XWjFR9HEN7AWYOo8XZNpnYgXeLvXFOPTtwtaiD5pkHx8yX Em3YXECaGJStN2psTUwLJlbLVbL85p2U3iyfPhYaVg/XiXOFQmMQ1YYwlSenYZ3E98rE K3IyaYY+0v30s3coqr+431fenB1C1RjpRCGwsYXdYYawopj5eLxwEnSMoV9kTd9TbGAv Y5OBxUe7xFcbj27mY+uxO1oLpArEIPyy19BEX6THq8t1SLgUZA2YuU0yQjrOOYjvD/bV BByUD2rtQuH6UV52Z7jVBT2XjRL10I4+rpQZWR3i889y0pT5OWutddkcwaykNjfOcrkp 8J6Q== X-Gm-Message-State: AO0yUKXyNVVDib7zWqSL0D1vMMoD8VFL9L0HeVtOHybS+01k9F+zlkZF EME2D5cWKeM6cb70jT/kSiE= X-Google-Smtp-Source: AK7set9XLQlU7OCfYUVAy/Ydv3YQdl+2aW7W4Uhv1Wb8KYrDe9FlphtEX1Oj0BnwCmfJdGuWxfpZmQ== X-Received: by 2002:a05:6402:28e:b0:4ac:d2b2:fe82 with SMTP id l14-20020a056402028e00b004acd2b2fe82mr1330848edv.17.1676447517994; Tue, 14 Feb 2023 23:51:57 -0800 (PST) Received: from [172.16.209.129] ([165.225.27.1]) by smtp.gmail.com with ESMTPSA id b2-20020a50b402000000b004a245d70f17sm9093443edh.54.2023.02.14.23.51.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Feb 2023 23:51:57 -0800 (PST) Message-ID: <07919318-6c35-a13f-6a1d-98686a3e38de@gmail.com> Date: Wed, 15 Feb 2023 08:51:56 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: pg_stat_statements and "IN" conditions Content-Language: en-US To: Dmitry Dolgov <9erthalion6@gmail.com> 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 References: <20230202150554.dwxhvw23epcskppb@ddolgov.remote.csb> <20230204170841.xfgxoo7ymwbvu7yx@erthalion.local> <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> From: David Geier In-Reply-To: <20230211120820.y7krq37jubnjsa5b@erthalion.local> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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. 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)) -- David Geier (ServiceNow)