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 1n6qUK-0007By-9y for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Jan 2022 08:57:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n6qUJ-0002Za-5P for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Jan 2022 08:57:11 +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 1n6qUI-0002ZR-PS for pgsql-hackers@lists.postgresql.org; Mon, 10 Jan 2022 08:57:10 +0000 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1n6qUG-0005yK-2L for pgsql-hackers@lists.postgresql.org; Mon, 10 Jan 2022 08:57:10 +0000 Received: by mail-pf1-x429.google.com with SMTP id p37so10066536pfh.4 for ; Mon, 10 Jan 2022 00:57:07 -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=kUfTYnl2rIKWudvhLfIfJifiYZUQSOd+TpcrMccq228=; b=KXUbTvmpp6hjKSGFfq3epaNpJ3Yb4aE/UJZDF53JH697b8iriDW2Yo+DD1lpI1q0Yd SKpvdG0y8C1mQ/2CjOUnbWUGIGlE+jFEGXwAFU12WlZCtoYeNEQEzvxzWzNiOdXIOjlR azvsB3A+eRumSfknbyYBwNTCOnTd/yOY/czyhYRA+6lNBrUHyuZPql8t/Xb2/qE8/Wj8 3OohfTaaAK/nmq6Ykl4XP8WPHwlrw5NN6IUMmhNSsnA07kyMTy16ICuZpqJaOgkhd803 5j2Y02qC2hFo9NFbsVFCR+GGz0CvKbsDw95/m1y0qd0U8qTVTJ8yv4qausBtB+btusKg unmg== 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=kUfTYnl2rIKWudvhLfIfJifiYZUQSOd+TpcrMccq228=; b=6vbQuZx/ADbhWoSOjfn30Bw+E4t9zMTOWg2wSk0Q1lr2gnxdrprrteFQpVs6FHBnX7 SESYZpEg+fD9oEH8zbnup8zsC6LC5PKsF3YvqoT9DDYLWydhFhFP6qNKuZBC4d5mjyNA EfoLpKi7rk59BTqlWZJgfpMVwMGSZmhxSsbkLALCWeqgCVJKmVG0ms4z41ikNa+vFNlq 1cD7E6x2kKDGiVplJ85BexIu6hLu4mZgDCdYQi7B4Or7y5C6xZNZ+zYw8BqzEQj4B1RE rLajkYqjUuOYcYMtBXej/XcAEwGZRGOMOh0PURGJvwsXjwgxUzhjYC8mihALY3CvXkO3 2GTg== X-Gm-Message-State: AOAM5314fIUlrvxKYlIb++7lwj/y7m4uU9yUMrNW/6+lT8JkmmopRZD7 Z1KOyElFlHoz42+w6Jl/QmY= X-Google-Smtp-Source: ABdhPJwhFXQzvH70gR5Z5mce3mw2wwFeX8DXwHxZOOeiTGCaIlkYfACl0kvvu6M4iATICda1IASK3A== X-Received: by 2002:a63:7e01:: with SMTP id z1mr65227031pgc.238.1641805025668; Mon, 10 Jan 2022 00:57:05 -0800 (PST) Received: from jrouhaud (1-171-174-202.dynamic-ip.hinet.net. [1.171.174.202]) by smtp.gmail.com with ESMTPSA id h7sm6133511pfc.152.2022.01.10.00.57.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jan 2022 00:57:03 -0800 (PST) Date: Mon, 10 Jan 2022 16:56:58 +0800 From: Julien Rouhaud To: "Andrey V. Lepikhov" Cc: PostgreSQL Hackers , Tom Lane Subject: Re: Multiple Query IDs for a rewritten parse tree Message-ID: References: <1606733.1641689399@sss.pgh.pa.us> <20220109121321.3d74krhjbr5mp4zv@jrouhaud> <1ea9d518-becb-1c3d-dc6c-e0045d3101de@postgrespro.ru> 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 Mon, Jan 10, 2022 at 12:37:34PM +0500, Andrey V. Lepikhov wrote: > I think, pg_stat_statements can live with an queryId generator of the > sr_plan extension. But It replaces all constants with $XXX parameter at the > query string. In our extension user defines which plan is optimal and which > constants can be used as parameters in the plan. I don't know the details of that extension, but I think that it should work as long as you have the constants information in the jumble state, whatever the resulting normalized query string is right? > One drawback I see here - creating or dropping of my extension changes > behavior of pg_stat_statements that leads to distortion of the DB load > profile. Also, we haven't guarantees, that another extension will work > correctly (or in optimal way) with such queryId. But then, if generating 2 queryid is a better for performance, does the extension really need an additional jumble state and/or normalized query string?