pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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 18:21:10 -0400
Message-ID: <24309.1465856470@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoYZd6sgM4e=2O1EWvLyBVxrvWksnAp=8s_kQcRK-k2xzg@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>
	<20391.1465850779@sss.pgh.pa.us>
	<CA+TgmoZwJB9EaiBj-MEeAQ913WkKOz4aQ7VQnCfrDLs9WYhZdQ@mail.gmail.com>
	<22832.1465854401@sss.pgh.pa.us>
	<CA+TgmoYZd6sgM4e=2O1EWvLyBVxrvWksnAp=8s_kQcRK-k2xzg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Robert Haas <robertmhaas@gmail.com> 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



view thread (66+ messages)  latest in thread

Message-ID: <24309.1465856470@sss.pgh.pa.us>
Permalink:  ../24309.1465856470@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/24309.1465856470@sss.pgh.pa.us

 · 

reply

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: <24309.1465856470@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> <CA+TgmoZwJB9EaiBj-MEeAQ913WkKOz4aQ7VQnCfrDLs9WYhZdQ@mail.gmail.com> <22832.1465854401@sss.pgh.pa.us> <CA+TgmoYZd6sgM4e=2O1EWvLyBVxrvWksnAp=8s_kQcRK-k2xzg@mail.gmail.com> <24309.1465856470@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