Re: Targetlist lost when CTE join - Mailing list pgsql-hackers

From Zhang Mingli
Subject Re: Targetlist lost when CTE join
Date
Msg-id 8b7e3302-2077-4514-89f3-cf652302135e@Spark
Whole thread Raw
In response to Targetlist lost when CTE join  (Zhang Mingli <zmlpostgres@gmail.com>)
List pgsql-hackers
Hi,

Explain verbose, seems HashJoin node drop that column.


gpadmin=# explain(verbose) with cte1 as (insert into t2 values (1, 2) returning *) select * from cte1 join t1 using(c1);
 QUERY PLAN
-------------------------------------------------------------------
 Hash Join (cost=0.04..41.23 rows=11 width=12)
 Output: cte1.c1, cte1.c2, t1.c2
 Hash Cond: (t1.c1 = cte1.c1)
 CTE cte1
 -> Insert on public.t2 (cost=0.00..0.01 rows=1 width=8)
 Output: t2.c1, t2.c2
 -> Result (cost=0.00..0.01 rows=1 width=8)
 Output: 1, 2
 -> Seq Scan on public.t1 (cost=0.00..32.60 rows=2260 width=8)
 Output: t1.c1, t1.c2
 -> Hash (cost=0.02..0.02 rows=1 width=8)
 Output: cte1.c1, cte1.c2
 -> CTE Scan on cte1 (cost=0.00..0.02 rows=1 width=8)
 Output: cte1.c1, cte1.c2
(14 rows)


Regards,
Zhang Mingli

pgsql-hackers by date:

Previous
From: Zhang Mingli
Date:
Subject: Targetlist lost when CTE join
Next
From: Julien Rouhaud
Date:
Subject: Re: Targetlist lost when CTE join