gpdb
gpdb copied to clipboard
EXCEPT over no columns reports ERROR: unexpected gang size
Bug Report
postgres=# create table tt2(id int);
postgres=# insert into tt2 select generate_series(1,5);
postgres=# set optimizer=off;
SET
postgres=# explain select from generate_series(1,10) except select from tt2;
ERROR: unexpected gang size: 3 (nodeMotion.c:732)
This only happens when none of the columns are hashable.
postgres=# explain select * from generate_series(1,10) except select * from tt2;
QUERY PLAN
----------------------------------------------------------------------------------------------------
Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..917.51 rows=30 width=8)
-> HashSetOp Except (cost=0.00..917.11 rows=10 width=8)
-> Append (cost=0.00..836.85 rows=32103 width=8)
-> Redistribute Motion 1:3 (slice2; segments: 1) (cost=0.00..0.34 rows=3 width=8)
Hash Key: "*SELECT* 1".generate_series
-> Subquery Scan on "*SELECT* 1" (cost=0.00..0.20 rows=10 width=8)
-> Function Scan on generate_series (cost=0.00..0.10 rows=10 width=4)
-> Subquery Scan on "*SELECT* 2" (cost=0.00..676.00 rows=32100 width=8)
-> Seq Scan on tt2 (cost=0.00..355.00 rows=32100 width=4)
Optimizer: Postgres-based planner
(10 rows)
Greenplum version or build
Greenplum Database 7.1.0-addcol+dev.15.gb8411c0 build dev
OS version and uname -a
RHEL7