Re: ERROR: ORDER/GROUP BY expression not found in targetlist

From: Tatsuro Yamada <yamada(dot)tatsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila(at)enterprisedb(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ERROR: ORDER/GROUP BY expression not found in targetlist
Date: 2016-06-13 08:16:38
Message-ID: 575E6BE6.8040006@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I applied your patch and run tpc-h.
Then I got new errors on Q4,12,17 and 19.

ERROR: Aggref found in non-Agg plan node.
See bellow,

----------------------------------
postgres=# \i queries/4.explain.sql
ERROR: Aggref found in non-Agg plan node
STATEMENT: explain analyze select
o_orderpriority,
count(*) as order_count
from
orders
where
o_orderdate >= date '1993-10-01'
and o_orderdate < date '1993-10-01' + interval '3' month
and exists (
select
*
from
lineitem
where
l_orderkey = o_orderkey
and l_commitdate < l_receiptdate
)
group by
o_orderpriority
order by
o_orderpriority
LIMIT 1;
----------------------------------

Regards,
Tatsuro Yamada
NTT OSS Center

On 2016/06/13 16:18, Amit Kapila wrote:
> On Mon, Jun 13, 2016 at 11:05 AM, David Rowley <david(dot)rowley(at)2ndquadrant(dot)com <mailto:david(dot)rowley(at)2ndquadrant(dot)com>> wrote:
> >
> > On 13 June 2016 at 15:39, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com <mailto:thomas(dot)munro(at)enterprisedb(dot)com>> wrote:
> > > What is going on here?
> >
> > ...
> >
> > >
> > > postgres=# set max_parallel_workers_per_gather = 2;
> > > SET
> > > postgres=# explain select length(data) from logs group by length(data);
> > > ERROR: ORDER/GROUP BY expression not found in targetlist
> >
> > Seems like this was caused by 04ae11f62e643e07c411c4935ea6af46cb112aa9
> >
>
> In create_grouping_paths(), we are building partial_grouping_path and same is used for gather path and other grouping paths (for partial paths). However, we don't use it for partial path list and sort path due to which path target for Sort path is different from what we have expected. Is there a problem in applying partial_grouping_path for partial pathlist? Attached patch just does that and I don't see error with patch.
>
> With Regards,
> Amit Kapila.
> EnterpriseDB: http://www.enterprisedb.com <http://www.enterprisedb.com/>
>
>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Julien Rouhaud 2016-06-13 09:42:31 Re: Rename max_parallel_degree?
Previous Message Tatsuro Yamada 2016-06-13 07:25:20 Re: ERROR: ORDER/GROUP BY expression not found in targetlist