Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCYkf-000796-AG for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Jun 2016 20:46:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bCYke-0001yu-EG for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Jun 2016 20:46:28 +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 1bCYkc-0001vT-QC for pgsql-hackers@postgresql.org; Mon, 13 Jun 2016 20:46:26 +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 1bCYka-0002is-Ap for pgsql-hackers@postgresql.org; Mon, 13 Jun 2016 20:46:25 +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 u5DKkJGt020392; Mon, 13 Jun 2016 16:46:19 -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> Comments: In-reply-to Robert Haas message dated "Mon, 13 Jun 2016 15:52:59 -0400" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <20175.1465850463.0@sss.pgh.pa.us> Date: Mon, 13 Jun 2016 16:46:19 -0400 Message-ID: <20391.1465850779@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 ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20175.1465850463.1@sss.pgh.pa.us> Robert Haas writes: > In practice, we don't yet have the ability for > parallel-safe paths from subqueries to affect planning at higher query > levels, but that's because the pathification stuff landed too late in > the cycle for me to fully react to it. I wonder if that's not just from confusion between subplans and subqueries. I don't believe any of the claims made in the comment adjusted in the patch below (other than "Subplans currently aren't passed to workers", which is true but irrelevant). Nested Gather nodes is something that you would need, and already have, a defense for anyway. regards, tom lane ------- =_aaaaaaaaaa0 Content-Type: text/x-diff; name="allow-consider-parallel-for-subquery-rte.patch"; charset="us-ascii" Content-ID: <20175.1465850463.2@sss.pgh.pa.us> Content-Description: allow-consider-parallel-for-subquery-rte.patch Content-Transfer-Encoding: quoted-printable diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/= path/allpaths.c index cc8ba61..8ab049c 100644 *** a/src/backend/optimizer/path/allpaths.c --- b/src/backend/optimizer/path/allpaths.c *************** set_rel_consider_parallel(PlannerInfo *r *** 560,574 **** case RTE_SUBQUERY: =20=20 /* ! * Subplans currently aren't passed to workers. Even if they ! * were, the subplan might be using parallelism internally, and we ! * can't support nested Gather nodes at present. Finally, we ! * don't have a good way of knowing whether the subplan involves ! * any parallel-restricted operations. It would be nice to relax ! * this restriction some day, but it's going to take a fair amount ! * of work. */ ! return; =20=20 case RTE_JOIN: /* Shouldn't happen; we're only considering baserels here. */ --- 560,574 ---- case RTE_SUBQUERY: =20=20 /* ! * If the subquery doesn't have anything parallel-restricted, we ! * can consider parallel scans. Note that this does not mean that ! * all (or even any) of the paths produced for the subquery will ! * actually be parallel-safe; but that's true for paths produced ! * for regular tables, too. */ ! if (has_parallel_hazard((Node *) rte->subquery, false)) ! return; ! break; =20=20 case RTE_JOIN: /* Shouldn't happen; we're only considering baserels here. */ ------- =_aaaaaaaaaa0 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers ------- =_aaaaaaaaaa0--