Thread: planner failure with ProjectSet + aggregation + parallel query

planner failure with ProjectSet + aggregation + parallel query

From
Robert Haas
Date:
While trying to track down a bug today, I found a different bug.

As of 6946280cded903b6f5269fcce105f8ab1d455d33:

rhaas=# create table foo (a int);
CREATE TABLE
rhaas=# set min_parallel_table_scan_size = 0;
SET
rhaas=# set parallel_setup_cost = 0;
SET
rhaas=# set parallel_tuple_cost = 0;
SET
rhaas=# select generate_series(1, a) from foo group by a;
ERROR:  ORDER/GROUP BY expression not found in targetlist

Without the SET commands, or without the GROUP BY, or without the SRF,
it successfully constructs a plan.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: planner failure with ProjectSet + aggregation + parallel query

From
Robert Haas
Date:
On Mon, Mar 5, 2018 at 10:38 AM, Robert Haas <robertmhaas@gmail.com> wrote:
> While trying to track down a bug today, I found a different bug.
>
> As of 6946280cded903b6f5269fcce105f8ab1d455d33:
>
> rhaas=# create table foo (a int);
> CREATE TABLE
> rhaas=# set min_parallel_table_scan_size = 0;
> SET
> rhaas=# set parallel_setup_cost = 0;
> SET
> rhaas=# set parallel_tuple_cost = 0;
> SET
> rhaas=# select generate_series(1, a) from foo group by a;
> ERROR:  ORDER/GROUP BY expression not found in targetlist
>
> Without the SET commands, or without the GROUP BY, or without the SRF,
> it successfully constructs a plan.

I am able to reproduce this on commit
69f4b9c85f168ae006929eec44fc44d569e846b9 (Move targetlist SRF handling
from expression evaluation to new executor node) with the following
modification for a GUC rename:

create table foo (a int);
--set min_parallel_table_scan_size = 0;
set min_parallel_relation_size = 0;
set parallel_setup_cost = 0;
set parallel_tuple_cost = 0;
select generate_series(1, a) from foo group by a;

But on the previous commit I can't reproduce it.  So it looks to me
like that's when it got broken.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company