From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Amit Kapila <amit.kapila@enterprisedb.com>
Cc: David Rowley <david.rowley@2ndquadrant.com>
Cc: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: ERROR: ORDER/GROUP BY expression not found in targetlist
Date: Mon, 13 Jun 2016 16:46:19 -0400
Message-ID: <20391.1465850779@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoZ7wvMPMTSNtk+dfDUNWmc8kK5pUtLDnzOLvJ9DVeAF_A@mail.gmail.com>
References: <CAEepm=1P94ca18KdQK_uLyAG521mqfF4My5MkFSftCxYuJZYgw@mail.gmail.com>
<CAKJS1f9vi6V9Fh=sHkOxXuLkmY7V8nUdQe27ELwWwxXv9Z6g8Q@mail.gmail.com>
<CAA4eK1Jm6HrJAPX26xyLGWes++r5=dOyOGRWeTa4q8NKd-UhVQ@mail.gmail.com>
<CA+TgmobBRacuT1JRpG5kH0UZCL5XXKb7wEXhe7EcX9VQdqqWkA@mail.gmail.com>
<15695.1465827695@sss.pgh.pa.us>
<CA+kptmAGnsCOQR6LvfPpiF7iBN79No6jXpkvcCJ2v9GGbrtu2Q@mail.gmail.com>
<17170.1465830165@sss.pgh.pa.us>
<20756.1465834072@sss.pgh.pa.us>
<1597.1465846969@sss.pgh.pa.us>
<CA+TgmoZ7wvMPMTSNtk+dfDUNWmc8kK5pUtLDnzOLvJ9DVeAF_A@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Robert Haas <robertmhaas@gmail.com> 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
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackersAttachments:allow-consider-parallel-for-subquery-rte.patch (text/x-diff, 1.4K) downloaddiff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.cindex 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:
/*
! * 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;
case RTE_JOIN:
/* Shouldn't happen; we're only considering baserels here. */
--- 560,574 ----
case RTE_SUBQUERY:
/*
! * 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;
case RTE_JOIN:
/* Shouldn't happen; we're only considering baserels here. */
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, amit.kapila@enterprisedb.com, david.rowley@2ndquadrant.com, thomas.munro@enterprisedb.com
Subject: Re: ERROR: ORDER/GROUP BY expression not found in targetlist
In-Reply-To: <20391.1465850779@sss.pgh.pa.us>
References: <CAEepm=1P94ca18KdQK_uLyAG521mqfF4My5MkFSftCxYuJZYgw@mail.gmail.com> <CAKJS1f9vi6V9Fh=sHkOxXuLkmY7V8nUdQe27ELwWwxXv9Z6g8Q@mail.gmail.com> <CAA4eK1Jm6HrJAPX26xyLGWes++r5=dOyOGRWeTa4q8NKd-UhVQ@mail.gmail.com> <CA+TgmobBRacuT1JRpG5kH0UZCL5XXKb7wEXhe7EcX9VQdqqWkA@mail.gmail.com> <15695.1465827695@sss.pgh.pa.us> <CA+kptmAGnsCOQR6LvfPpiF7iBN79No6jXpkvcCJ2v9GGbrtu2Q@mail.gmail.com> <17170.1465830165@sss.pgh.pa.us> <20756.1465834072@sss.pgh.pa.us> <1597.1465846969@sss.pgh.pa.us> <CA+TgmoZ7wvMPMTSNtk+dfDUNWmc8kK5pUtLDnzOLvJ9DVeAF_A@mail.gmail.com> <20391.1465850779@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox