Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bBNn3-0006pY-Fg for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jun 2016 14:52:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bBNn2-0004gD-V1 for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jun 2016 14:52:04 +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 1bBNlg-0001Yo-Fs for pgsql-hackers@postgresql.org; Fri, 10 Jun 2016 14:50:40 +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 1bBNle-0005TL-2J for pgsql-hackers@postgresql.org; Fri, 10 Jun 2016 14:50:39 +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 u5AEoa3m024052; Fri, 10 Jun 2016 10:50:36 -0400 From: Tom Lane To: Amit Kapila cc: Robert Haas , "pgsql-hackers@postgresql.org" Subject: Re: [COMMITTERS] pgsql: Don't generate parallel paths for rels with parallel-restricted In-reply-to: References: <5569.1465491729@sss.pgh.pa.us> <7106.1465494284@sss.pgh.pa.us> <7992.1465495683@sss.pgh.pa.us> Comments: In-reply-to Amit Kapila message dated "Fri, 10 Jun 2016 18:52:26 +0530" Date: Fri, 10 Jun 2016 10:50:36 -0400 Message-ID: <24051.1465570236@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-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Amit Kapila writes: > On Thu, Jun 9, 2016 at 11:38 PM, Tom Lane wrote: >> Robert Haas writes: >>> Could you answer my question about whether adjust_appendrel_attrs() >>> might translate Vars into non-Vars? >> Yes, absolutely. > Isn't this true only for UNION ALL cases and not for inheritance child > relations (at least that is what seems to be mentioned in comments > for translated_vars in AppendRelInfo)? Correct. > If that is right, then I think > there shouldn't be a problem w.r.t parallel plans even if > adjust_appendrel_attrs() translate Vars into non-Vars, because for UNION > ALL it seems parent rels rtekind is RTE_SUBQUERY and we consider such rels > as parallel unsafe (see set_rel_consider_parallel()). Hm, that would explain why you haven't been able to exhibit a bug on HEAD as it stands; but it doesn't make the code any less broken on its own terms, or any less of a risk for future bugs when we try to relax the no-subqueries restriction. I am still of the opinion that reltarget_has_non_vars is simply a bad idea. It's wrong as-committed, it will be a permanent maintenance hazard, and there is no evidence that it saves anything meaningful even as the code stood yesterday, let alone after cae1c788b. I think we should just remove it and allow those has_parallel_hazard calls to occur unconditionally, and will go do that unless I hear some really good argument to the contrary. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers