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 1mVwRE-00088G-Gr for pgsql-hackers@arkaria.postgresql.org; Thu, 30 Sep 2021 13:49:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mVwRC-0001wC-NV for pgsql-hackers@arkaria.postgresql.org; Thu, 30 Sep 2021 13:49:26 +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 1mVwRC-0001w4-9V for pgsql-hackers@lists.postgresql.org; Thu, 30 Sep 2021 13:49:26 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from <9erthalion6@gmail.com>) id 1mVwR8-0006mU-Qp for pgsql-hackers@postgresql.org; Thu, 30 Sep 2021 13:49:25 +0000 Received: by mail-wm1-x333.google.com with SMTP id z184-20020a1c7ec1000000b003065f0bc631so8544796wmc.0 for ; Thu, 30 Sep 2021 06:49:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=TSGyaLfr3JrkyRhWw2j7mOhmRP4+36WkBQn3dbWsVv0=; b=TgmDdlYX0LVAOsUlTPjS4wI1APxvJGENWSjZOgLvgRDfb6UnVFh7jnP+lg1+/AGS55 OjyjhC1JzB7pUocchrxIwQG8keCvKm2co3kkY5UB02du9hEzR7kHm8c33LtVBMlFzCF1 9QCDxS2FX72WG8X4okXssrwhavVmJeQ8q5TIz+MgNN1S2InUYhlb/2Qbh3fNH8cSKO1L MrDoL51z1Re18GL2CQsrEBAM7mSTjW8a00F3ZDBbPE921anoYIo8fG6vtr2zWKtkexyX vtrGzba6WEYyHu1JtsdPoUL7RviallSn8CFpWrgWQcw68rLG6VNPxRR39Ht0wOVlIQ/M cJtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=TSGyaLfr3JrkyRhWw2j7mOhmRP4+36WkBQn3dbWsVv0=; b=OmVvdOr/eQKVP+6T3qEV/3dNCfSGXWE8tZyC5vodIAxtrjxVwgGlXfnd2tDz/N3Sk8 5FNzYhE/ju2nJyItMaFXvueXCl8SYclF1WG298pe2lugZ5djGhr3CE/7FFtNZCySUspf sbXwGWZrPvcW+b7/E+u6NHEykeNZL/3MZjNZt50MCNsutA3K/f4kHZ4TC72yPEM5Ei85 Vq0BQtE5Cm3sOvB/6yaSFGV7+J1iPCwB1WFxZHNQOfBvFS91H8DoPHILTtPiOGcYhOGD FiOVub3i+qYimsdm4n138tgorAd1jbxb7e4UBlX9dQ3YzBNvbtU3X3WqjO3aFw/7iMk8 jiLg== X-Gm-Message-State: AOAM530sN+m4Mk9vL/J86/aZUYO725a8fgw+PVMPf/xBwhGO3xN2gA4+ JRbpjJDa/wxViRY6agIwCn0= X-Google-Smtp-Source: ABdhPJyo4uh59RiSTMWirRhrebvV8RXAoLQU8wmKZxYyd+RAVapCb4dRd/LZcmHThyFtbycwLmD/bw== X-Received: by 2002:a1c:7d0f:: with SMTP id y15mr5442901wmc.41.1633009761057; Thu, 30 Sep 2021 06:49:21 -0700 (PDT) Received: from localhost (dslb-094-222-009-006.094.222.pools.vodafone-ip.de. [94.222.9.6]) by smtp.gmail.com with ESMTPSA id k11sm3067905wrn.84.2021.09.30.06.49.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Sep 2021 06:49:20 -0700 (PDT) Date: Thu, 30 Sep 2021 15:49:30 +0200 From: Dmitry Dolgov <9erthalion6@gmail.com> To: David Steele Cc: Zhihong Yu , PostgreSQL-development , Tom Lane , Greg Stark , Pavel Trukhanov Subject: Re: pg_stat_statements and "IN" conditions Message-ID: <20210930134930.d4vzwhvxhfpk2zxt@localhost> References: <20201118160432.hyko73sqc2bf7nkj@localhost> <20201226104635.uvzkftzu72zg5qux@localhost> <20210105125230.etgmgixnn6fmpszl@localhost> <20210318155002.ggrgf2p2mvaodcox@localhost> <20210615151850.6nsue7z5xjhpytle@localhost> <20210616140212.kt3n5wi3alfz5i5d@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="mapvsyiflabcgyvj" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210616140212.kt3n5wi3alfz5i5d@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --mapvsyiflabcgyvj Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit >On Wed, Jun 16, 2021 at 04:02:12PM +0200, Dmitry Dolgov wrote: > > > I've prepared a new rebased version to deal with the new way of > > computing query id, but as always there is one tricky part. From what I > > understand, now an external module can provide custom implementation for > > query id computation algorithm. It seems natural to think this machinery > > could be used instead of patch in the thread, i.e. one could create a > > custom logic that will enable constants collapsing as needed, so that > > same queries with different number of constants in an array will be > > hashed into the same record. > > > > But there is a limitation in how such queries will be normalized > > afterwards — to reduce level of surprise it's necessary to display the > > fact that a certain query in fact had more constants that are showed in > > pgss record. Ideally LocationLen needs to carry some bits of information > > on what exactly could be skipped, and generate_normalized_query needs to > > understand that, both are not reachable for an external module with > > custom query id logic (without replicating significant part of the > > existing code). Hence, a new version of the patch. > > Forgot to mention a couple of people who already reviewed the patch. And now for something completely different, here is a new patch version. It contains a small fix for one problem we've found during testing (one path code was incorrectly assuming find_const_walker results). --mapvsyiflabcgyvj Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v5-0001-Prevent-jumbling-of-every-element-in-ArrayExpr.patch"