Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sCmH8-0081ja-Va for pgsql-hackers@arkaria.postgresql.org; Thu, 30 May 2024 20:21:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sCmH6-005gxz-Nf for pgsql-hackers@arkaria.postgresql.org; Thu, 30 May 2024 20:21:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sCmH6-005gxq-Cs for pgsql-hackers@lists.postgresql.org; Thu, 30 May 2024 20:21:24 +0000 Received: from mx.post.pl ([89.161.252.35]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sCmH2-001Yyq-7k for pgsql-hackers@lists.postgresql.org; Thu, 30 May 2024 20:21:23 +0000 Received: from d172-016-014-006.wireless.sfu.ca (unknown [192.75.244.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx.post.pl (Postfix) with ESMTPSA id 95E6C3A3E8; Thu, 30 May 2024 22:21:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=post.pl; s=dkim; t=1717100478; bh=V0F5+bbWMHqYUht6HLzSoeiB9ZGQbLV+m88d+JHA9e4=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=H/Ct2CHK6u5Y594knlpqYli/7hq6cuQ8uk8A83+Sa3QZD6SsL0CAzQd2cGAzaDFPW hRs/3aS4GhWWKgeYwL/GWKMuK0HS84/u3z/YZ6ry3cuYvfSl6iioAiqIRgkbNmR9Sr KWgDMT88iRWbrU4LkEf7+Bxgu89PW3bz7v1vRq9I= Message-ID: <5641923793cef7706395a34e62538b75d05e498b.camel@post.pl> Subject: Re: Should consider materializing the cheapest inner path in consider_parallel_nestloop() From: Tomasz Rybak To: pgsql-hackers@lists.postgresql.org Cc: Tender Wang , "Andrey M. Borodin" Date: Thu, 30 May 2024 22:21:14 +0200 In-Reply-To: References: <9FBD029B-3E71-4D47-AB54-938C73A4668F@yandex-team.ru> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.1-4 MIME-Version: 1.0 X-CLIENT-IP: 192.75.244.5 X-CLIENT-HOSTNAME: 192.75.244.5 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrvdekgedgudeghecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepkffuhffvveffjghftgfgfgggsehtqhertddtreejnecuhfhrohhmpefvohhmrghsiicutfihsggrkhcuoehtohhmrghsiidrrhihsggrkhesphhoshhtrdhplheqnecuggftrfgrthhtvghrnheptdduveegieegkeehhefggeejfeeugeffhedtffevieffgeefheetgfekffekhfehnecukfhppeduledvrdejhedrvdeggedrheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduledvrdejhedrvdeggedrhedphhgvlhhopeguudejvddqtdduiedqtddugedqtddtiedrfihirhgvlhgvshhsrdhsfhhurdgtrgdpmhgrihhlfhhrohhmpefvohhmrghsiicutfihsggrkhcuoehtohhmrghsiidrrhihsggrkhesphhoshhtrdhplheqpdhnsggprhgtphhtthhopeefpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepthhnughrfigrnhhgsehgmhgrihhlrdgtohhmpdhrtghpthhtohepgiegmhhmmheshigrnhguvgigqdhtvggrmhdrrhhu X-DCC--Metrics: mail02.home.net.pl 1024; Body=3 Fuz1=3 Fuz2=3 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 2024-04-23 at 16:59 +0800, Tender Wang wrote: >=20 [ cut ] >=20 > I have rebased master and fixed a plan diff case. We (me, Paul Jungwirth, and Yuki Fujii) reviewed this patch at PgConf.dev Patch Review Workshop. Here are our findings. Patch tries to allow for using materialization together with parallel subqueries. It applies cleanly on 8fea1bd5411b793697a4c9087c403887e050c4ac (current HEAD). Tests pass locally on macOS and Linux in VM under Windows. Tests are also green in cfbot (for last 2 weeks; they were red previously, probably because of need to rebase). Please add more tests. Especially please add some negative tests; current patch checks that it is safe to apply materialization. It would be helpful to add tests checking that materialization is not applied in both checked cases: 1. when inner join path is not parallel safe 2. when matpath is not parallel safe This patch tries to apply materialization only when join type is not JOIN_UNIQUE_INNER. Comment mentions this, but does not explain why. So please either add comment describing reason for that or try enabling materialization in such a case. Best regards. --=20 Tomasz Rybak, Debian Developer GPG: A565 CE64 F866 A258 4DDC=C2=A0F9C7 ECB7 3E37 E887 AA8C