Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fiYdO-000881-40 for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Jul 2018 05:16:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fiYdL-0001gu-U2 for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Jul 2018 05:16:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fiYdL-0001gn-N3 for pgsql-hackers@lists.postgresql.org; Thu, 26 Jul 2018 05:16:15 +0000 Received: from tama500.ecl.ntt.co.jp ([129.60.39.148]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fiYdC-00081f-IP for pgsql-hackers@postgresql.org; Thu, 26 Jul 2018 05:16:15 +0000 Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id w6Q5FpJo028980; Thu, 26 Jul 2018 14:15:51 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id AE016638BBC; Thu, 26 Jul 2018 14:15:51 +0900 (JST) Received: from jcms-pop21.ecl.ntt.co.jp (jcms-pop21.ecl.ntt.co.jp [129.60.87.134]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id A2D2A638A63; Thu, 26 Jul 2018 14:15:51 +0900 (JST) Received: from [IPv6:::1] (unknown [129.60.241.75]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id 85E34400C0E; Thu, 26 Jul 2018 14:15:51 +0900 (JST) Message-ID: <5B5958D2.7060805@lab.ntt.co.jp> Date: Thu, 26 Jul 2018 14:14:58 +0900 From: Etsuro Fujita User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 Subject: Re: print_path is missing GatherMerge and CustomScan support References: <20180718062202.GC8565@paquier.xyz> <20180719000722.GA3411@paquier.xyz> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CC-Mail-RelayStamp: 1 To: Ashutosh Bapat Cc: Michael Paquier , Masahiko Sawada , PostgreSQL-development , Robert Haas X-TM-AS-MML: disable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk (2018/07/19 14:11), Ashutosh Bapat wrote: > On Thu, Jul 19, 2018 at 5:37 AM, Michael Paquier wrote: >> On Wed, Jul 18, 2018 at 12:15:25PM +0530, Ashutosh Bapat wrote: >>> Yes that's right. Thanks for taking care of it. >> >> Okay, I have pushed a fix for this one as that's wrong and >> back-patched to v11. The coverage of reparameterize_path_by_child is >> actually quite poor if you look at the reports: >> https://coverage.postgresql.org/src/backend/optimizer/util/pathnode.c.gcov.html >> >> Could it be possible to stress that more? This way mistakes like this >> one could have been avoided from the start. > > I had extensive testcases in my original patch-set to exercise that > code but 1. that testset was too extensive; even today > partition_join.sql is a separate testcase and it's quite large. 2. > that function returns NULL rather than throwing an error, if it can > not produce a parameterized path. So, unless we check whether each of > those paths get created no test is useful and that can only be done > through an EXPLAIN OUTPUT which means that the testcase becomes > fragile. I fine if we want to add more tests just to cover the code if > those are not as fragile and do not blow up partition_join too much. It would not be possible to cover these cases: case T_GatherPath: { GatherPath *gpath; FLAT_COPY_PATH(gpath, path, GatherPath); REPARAMETERIZE_CHILD_PATH(gpath->subpath); new_path = (Path *) gpath; } break; case T_GatherMergePath: { GatherMergePath *gmpath; FLAT_COPY_PATH(gmpath, path, GatherMergePath); REPARAMETERIZE_CHILD_PATH(gmpath->subpath); new_path = (Path *) gmpath; } break; because we currently don't consider gathering partial child-scan or child-join paths. I think we might consider that in future, though. Best regards, Etsuro Fujita