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 1pOTrY-0001UB-Nm for pgsql-hackers@arkaria.postgresql.org; Sun, 05 Feb 2023 01:30:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pOTrX-0000up-Fs for pgsql-hackers@arkaria.postgresql.org; Sun, 05 Feb 2023 01:30:35 +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 ) id 1pOTrX-0000uf-6P for pgsql-hackers@lists.postgresql.org; Sun, 05 Feb 2023 01:30:35 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pOTrV-0004YF-0K for pgsql-hackers@postgresql.org; Sun, 05 Feb 2023 01:30:34 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 533A95C00B3; Sat, 4 Feb 2023 20:30:32 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sat, 04 Feb 2023 20:30:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; t=1675560632; x=1675647032; bh=ucgaZv0MgN 7H+xUKwmfY542LehTvuwFkyDRZA40MrwA=; b=GQ9gFqUV7rsR7IMqSIDtnaifbS jqLPnkN40Ytz4J0JNRzOxOXDbkompSkGTgFRPWTflGDWoH1YDKy2UTrZATxqyZlM or6LBsi/BJWio/E9a/3FWMr+ojKE9H6Ztv5eqMJ0mJ9wGHOgfiRNPQzgKUExUDwm ONr9QseLoChVbjRdA23QoRI/TITk4TDujXAeASPxz1j2ZH/S9irJUCqbrPJc97if 4UqBdk+9mWqHnVhdKFTuHSPC/oA3cPHrnA4D9s7gtDGTbgjjTYKR+qN97p+a7dcX pXIrP1W2Ij5oGOVGNU2ZfhsbastfBCoCIWyn3mQuesfjdVj9FztebuhBPiqA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1675560632; x=1675647032; bh=ucgaZv0MgN7H+xUKwmfY542LehTv uwFkyDRZA40MrwA=; b=S1Qfjt05q155yBl68AzdHc9bh4F+FgdsEc8hSxck53v4 Ctbjbl4gPtu9Us3SLzbcZkp3u0vwwukIikiL1DWwRFZE8wXWyZRNNroxYWSmT4IN M7Z8PcP/Y5XyPm+/Zp7YpqH2+ZvI/OhEUcWI1T4G6DlO+wwH72v7C0ncRLGipJ5N wRHA3gWUPBUg67uiI0MpSq+PTKpUBr+9z1olxaw3k8CH50K9Z8mvQqB6m8gnqBfI WTgc/Nyfb0O2VXragdo1TSJRd78ztyAHuO7OQS8LR9OzBftiw+Xi0Fxs6i5XB3F/ gcWYnOD9WtSTV6BmxlLtPAFSw/lRHkuDJtSarfz2cg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudegfedgfeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeg geegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 4 Feb 2023 20:30:28 -0500 (EST) Date: Sun, 5 Feb 2023 10:30:25 +0900 From: Michael Paquier To: Dmitry Dolgov <9erthalion6@gmail.com> Cc: Alvaro Herrera , Marcos Pegoraro , vignesh C , Sergei Kornilov , Robert Haas , Zhihong Yu , David Steele , PostgreSQL-development , Greg Stark , Pavel Trukhanov , Tom Lane Subject: Re: pg_stat_statements and "IN" conditions Message-ID: References: <20230129133219.tpuzqbyqw3ojztbd@erthalion.local> <20230202140727.g7tw7qjo43g54wcb@alvherre.pgsql> <20230202150554.dwxhvw23epcskppb@ddolgov.remote.csb> <20230204170841.xfgxoo7ymwbvu7yx@erthalion.local> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Op2eOY30ajKi9Hso" Content-Disposition: inline In-Reply-To: <20230204170841.xfgxoo7ymwbvu7yx@erthalion.local> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Op2eOY30ajKi9Hso Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Feb 04, 2023 at 06:08:41PM +0100, Dmitry Dolgov wrote: > Here is the rebased version. To adapt to the latest changes, I've marked > ArrayExpr with custom_query_jumble to implement this functionality, but > tried to make the actual merge logic relatively independent. Otherwise, > everything is the same. I was quickly looking at this patch, so these are rough impressions. + bool merged; /* whether or not the location was marked as + not contributing to jumble */ This part of the patch is a bit disturbing.. We have node attributes to track if portions of a node should be ignored or have a location marked, still this "merged" flag is used as an extension to track if a location should be done or not. Is that a concept that had better be controlled via a new node attribute? +-- +-- Consts merging +-- +CREATE TABLE test_merge (id int, data int); +-- IN queries +-- No merging Would it be better to split this set of tests into a new file? FWIW, I have a patch in baking process that refactors a bit the whole, before being able to extend it so as we have more coverage for normalized utility queries, as of now the query strings stored by pg_stat_statements don't reflect that even if the jumbling computation marks the location of the Const nodes included in utility statements (partition bounds, queries of COPY, etc.). I should be able to send that tomorrow, and my guess that you could take advantage of that even for this thread. -- Michael --Op2eOY30ajKi9Hso Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmPfBrEACgkQnvQgOdby QH312w//Rx0eTOpwz2reyh8kOqHLunqMixMfD4ESpD8D9DtTzND90p134XgI1wVt yEsaDodd5RzIn7PMDfCYa8O1PjC2pnr4558tkDLoaBfM8dkoeJGgzQUvaibrzXYC Fpoqrms1M3VxLJDUyZzG3b7LJvJ5L170kpYCCju0Ogh4xPUimossvasugd1BlK1N eKQzPrOWHjNafwtuu9RKN/yDcyvl/1gHCvrgqWEDaGW6CVtvQSN8xHQ1A21ZxJWH Va1qWLzSrkmzz34ibthI0XV3HEsCeud5ABNa2lq4YpT4nEXxnkf+w5y1lIlrT//j D9jq7rWHRkOTSvUcaymfJkNZC346YC1WWXR2lYCZpCWT/vTBKZH2RxvwkYOC4ry8 zEI5B9SfXEUgy5pI5OwrPe9oLDiA6uG88sXTM7oP6Tu5a++EWXVAH8sI33UvwS4C jzEyj4Ws1Qs/DWb5NU7T8YIIQuA8AYGVDDkTTf3CzwbFnyZXe/gizmo374PQvgUK WZfF+3xfpQr4B7nq79cy0oDSzVSWHS7CPlLoe6OHvvouokna6A6z6jdYo0mxVkZ/ jWuHXITgb1iz0NNUYC0bmVM9abITQJBiuq7ORiwSGLEr8nz64i2aMmiW489Idnox MeFA6aVLWPFZVtsRBpIOdhkQSJY7+BatTWTf39YBBuxpB9lbkP0= =/zi1 -----END PGP SIGNATURE----- --Op2eOY30ajKi9Hso--