Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCaFp-0003HG-50 for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Jun 2016 22:22:45 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bCaFo-0001Cw-4x for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Jun 2016 22:22:44 +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.84_2) (envelope-from ) id 1bCaER-00089x-Bc for pgsql-hackers@postgresql.org; Mon, 13 Jun 2016 22:21:19 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bCaEN-0001cf-Vz for pgsql-hackers@postgresql.org; Mon, 13 Jun 2016 22:21:18 +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 u5DMLAVU024310; Mon, 13 Jun 2016 18:21:10 -0400 From: Tom Lane To: Robert Haas cc: Amit Kapila , David Rowley , Thomas Munro , Pg Hackers Subject: Re: ERROR: ORDER/GROUP BY expression not found in targetlist In-reply-to: References: <15695.1465827695@sss.pgh.pa.us> <17170.1465830165@sss.pgh.pa.us> <20756.1465834072@sss.pgh.pa.us> <1597.1465846969@sss.pgh.pa.us> <20391.1465850779@sss.pgh.pa.us> <22832.1465854401@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Mon, 13 Jun 2016 18:09:16 -0400" Date: Mon, 13 Jun 2016 18:21:10 -0400 Message-ID: <24309.1465856470@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 Robert Haas writes: > Again, please have a look at the patch and see if it seems unsuitable > to you for some reason. I'm not confident of my ability to get all of > this path stuff right without a bit of help from the guy who designed > it. I'm kind of in a bind right now because Tomas has produced an FK-selectivity patch rewrite on schedule, and I already committed to review that before beta2, so I better go do that first. If you can wait awhile I will try to help out more with parallel query. Having said that, the main thing I noticed in your draft patch is that you'd removed set_grouped_rel_consider_parallel() in favor of hard-wiring this in create_grouping_paths(): + if (input_rel->consider_parallel && + !has_parallel_hazard((Node *) target->exprs, false) && + !has_parallel_hazard((Node *) parse->havingQual, false)) + grouped_rel->consider_parallel = true; I think this is bad because it forces any external creators of UPPERREL_GROUP_AGG to duplicate that code --- and heaven help everybody if anyone is out of sync on whether to set the flag. So I'd rather keep set_grouped_rel_consider_parallel(), even if all it does is the above. And make it global not static. Ditto for the other upperrels. Also, I wonder whether we could reduce that test to just the has_parallel_hazard tests, so as to avoid the ordering dependency of needing to create the top scan/join rel (and set its consider_parallel flag) before we can create the UPPERREL_GROUP_AGG rel. This would mean putting more dependency on per-path parallel_safe flags to detect whether you can't parallelize a given step for lack of parallel-safe input, but I'm not sure that that's a bad thing. 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