Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bE7zZ-0002Xl-QV for pgsql-committers@arkaria.postgresql.org; Sat, 18 Jun 2016 04:36:21 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bE7zZ-0000qz-2R for pgsql-committers@arkaria.postgresql.org; Sat, 18 Jun 2016 04:36:21 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bE7zY-0000qc-Fl for pgsql-committers@postgresql.org; Sat, 18 Jun 2016 04:36:20 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bE7zR-0001iL-RI; Sat, 18 Jun 2016 04:36:19 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u5I4aC24019202; Sat, 18 Jun 2016 00:36:12 -0400 From: Tom Lane To: Amit Kapila cc: Robert Haas , pgsql-committers Subject: Re: pgsql: Try again to fix the way the scanjoin_target is used with partia In-reply-to: References: <20853.1466210514@sss.pgh.pa.us> <27684.1466213813@sss.pgh.pa.us> <9539.1466220369@sss.pgh.pa.us> Comments: In-reply-to Amit Kapila message dated "Sat, 18 Jun 2016 09:18:21 +0530" Date: Sat, 18 Jun 2016 00:36:12 -0400 Message-ID: <19201.1466224572@sss.pgh.pa.us> X-Pg-Spam-Score: -3.3 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org Amit Kapila writes: > On Sat, Jun 18, 2016 at 8:56 AM, Tom Lane wrote: >> I think the two lines in question are just a poorly-thought-through case >> of premature optimization. If removing them makes the failures go away >> for me, that's what I plan to do. > That should make the failure go-away. Well, it did make the errors go away, but it also made the first test case in select_parallel.sql change plan, because the parallel plan is only a whisker cheaper than non-parallel, and the extra charge for the nonexistent Result node changed the decision. I'm not exactly convinced that that test case represents behavior we need to preserve, but for the moment I rejiggered the cost adjustment so the test case stays the same. If we keep it like this, we definitely ought to refactor things so that fewer places are aware of the possibility of the Result getting omitted. Maybe push that logic into create_projection_path? If we did, we might not need a separate apply_projection_to_path function at all? Too tired to decide about it right now. regards, tom lane -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers