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 1nSLoL-0000mZ-2n for pgsql-hackers@arkaria.postgresql.org; Thu, 10 Mar 2022 16:38:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nSLoJ-0002Vu-Ep for pgsql-hackers@arkaria.postgresql.org; Thu, 10 Mar 2022 16:38:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <9erthalion6@gmail.com>) id 1nSLoJ-0002Vl-3i for pgsql-hackers@lists.postgresql.org; Thu, 10 Mar 2022 16:38:43 +0000 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from <9erthalion6@gmail.com>) id 1nSLoG-000230-TZ for pgsql-hackers@postgresql.org; Thu, 10 Mar 2022 16:38:42 +0000 Received: by mail-ed1-x52c.google.com with SMTP id y8so2646246edl.9 for ; Thu, 10 Mar 2022 08:38:40 -0800 (PST) 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:in-reply-to; bh=Yk7h9nqa7l3QdV7GCuVFjRqG+gnTKm+NnMzEG5q96CY=; b=PoSu4Geiyn7TO1tF7M+2z733moBBNX8X84bHWUtZqstzl0ii5puhQnz1qWA4DT8g5H G8ht/fYLs3gcpMMaBa3zMX6VtS+bfqtgkgYTgM+CjMpNJxGKNgk+jeapgeq5HR2jCJoF V3VE/Wno2gS78ijtrmufa7nACp+pjeyDJ24MITQz547ZiKbToKnDJxHKpVyFRgV9Nr0c m/7pVrdnAz5woxSHbyEWfaIH0KfnzL7rcsPeQXSi1KRXYpJ3ZH8vg63SIsO9bywLws4n 1HCQjurRB3PFiftGPSLZFlkzrtlWiQbzoKJlcfc4qPpHLXnBk+aCYEhQ/rVFv5Tg2VTh 0a4A== 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:in-reply-to; bh=Yk7h9nqa7l3QdV7GCuVFjRqG+gnTKm+NnMzEG5q96CY=; b=clLayxrf+K0CQwjYAoJDyAHpDpAtViRRc3zs2QST7rh5FwwVBNtaCSaMJqDFCwcuyh PDr9m1jPpGW4Y5YKTbv6KX79QBLw3QvzMLmm8eSi/G4dN1UigDxhZxgImDCGL42xGlbt DyzIGIc5LHaIGw+tEyYhKrbypEyBOu5MwyEbpWHVj7HCdYDXV/corRveel51qx8bKJ7R na1f661Xoq/DXp+f7yNHBuv//ODGViS200uRkjGOa1NoiMwrVcAK+9or6X/6qdIwAVu9 MYhyxY8yWCKR26MrIJWRgBYFsgV3GNRbnyjEZRqGU9E3oQECmwDDu0RgrfwzU/S8tT9W kYYA== X-Gm-Message-State: AOAM5313GZLV2fp8U35cDsThmXP03xCK8KzcjmR0IIm/0PEbeanKe1x1 5ThKu6grgg709wjwhQuUcH8= X-Google-Smtp-Source: ABdhPJyCz2ionYodUo1z3fd3ZBNDdohGgeJyqp/ZKdTAPrWC7EgzK33RyUXxkDKfr0KNIOx470ivxw== X-Received: by 2002:a05:6402:42c9:b0:415:e324:c211 with SMTP id i9-20020a05640242c900b00415e324c211mr5361859edc.234.1646930319471; Thu, 10 Mar 2022 08:38:39 -0800 (PST) Received: from ddolgov.remote.csb (dslb-178-005-230-047.178.005.pools.vodafone-ip.de. [178.5.230.47]) by smtp.gmail.com with ESMTPSA id i4-20020a1709061e4400b006db370920bbsm1985937ejj.90.2022.03.10.08.38.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Mar 2022 08:38:38 -0800 (PST) Date: Thu, 10 Mar 2022 17:38:37 +0100 From: Dmitry Dolgov <9erthalion6@gmail.com> To: Tom Lane Cc: Zhihong Yu , David Steele , PostgreSQL-development , Greg Stark , Pavel Trukhanov Subject: Re: pg_stat_statements and "IN" conditions Message-ID: <20220310163837.pzvr4yntdk33cbkb@ddolgov.remote.csb> References: <20210318155002.ggrgf2p2mvaodcox@localhost> <20210615151850.6nsue7z5xjhpytle@localhost> <20210616140212.kt3n5wi3alfz5i5d@localhost> <20210930134930.d4vzwhvxhfpk2zxt@localhost> <20210930150957.tz3h3unjyrzatw6e@localhost> <4154685.1641337363@sss.pgh.pa.us> <20220105211111.5oh7ypjfonaqubuq@erthalion.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220105211111.5oh7ypjfonaqubuq@erthalion.local> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Wed, Jan 05, 2022 at 10:11:11PM +0100, Dmitry Dolgov wrote: > > On Tue, Jan 04, 2022 at 06:02:43PM -0500, Tom Lane wrote: > > We can debate whether the rules proposed here are good for > > pg_stat_statements or not, but it seems inevitable that they will be a > > disaster for some other consumers of the query hash. > > Hm, which consumers do you mean here, potential extension? Isn't the > ability to use an external module to compute queryid make this situation > possible anyway? > > > do you really think that a query with two int > > parameters is equivalent to one with five float parameters for all > > query-identifying purposes? > > Nope, and it will be hard to figure this out no matter which approach > we're talking about, because it mostly depends on the context and type > of queries I guess. Instead, such functionality should allow some > reasonable configuration. To be clear, the use case I have in mind here > is not four or five, but rather a couple of hundreds constants where > chances that the whole construction was generated automatically by ORM > is higher than normal. > > > I can see the merits of allowing different numbers of IN elements > > to be considered equivalent for pg_stat_statements, but this patch > > seems to go far beyond that basic idea, and I fear the side-effects > > will be very bad. > > Not sure why it goes far beyond, but then there were two approaches > under consideration, as I've stated in the first message. I already > don't remember all the details, but another one was evolving around > doing similar things in a more limited fashion in transformAExprIn. The > problem would be then to carry the information, necessary to represent > the act of "merging" some number of queryids together. Any thoughts > here? > > The idea of keeping the original queryid untouched and add another type > of id instead sounds interesting, but it will add too much overhead for > a quite small use case I guess. ``` Thu, 10 Mar 2022 New status: Waiting on Author ``` This seems incorrect, as the only feedback I've got was "this is a bad idea", and no reaction on follow-up questions.