jiaqizho commented on PR #1126: URL: https://github.com/apache/cloudberry/pull/1126#issuecomment-2917983147
> Just tried, it doesn't dedup for following query. Is it by purpose? > > ``` > postgres=# explain verbose select * from pt1 where v1 in (select v3 + 1 from pt2) and v1 in (select v3 + 1 from pt2 where v3 = 12); > QUERY PLAN > ------------------------------------------------------------------------------------------------------------------- > Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..1293.01 rows=1 width=8) > Output: pt1.v1, pt1.v2 > -> Hash Semi Join (cost=0.00..1293.01 rows=1 width=8) > Output: pt1.v1, pt1.v2 > Hash Cond: (pt1.v1 = ((pt2_1.v3 + 1))) > -> Hash Semi Join (cost=0.00..862.01 rows=1 width=8) > Output: pt1.v1, pt1.v2 > Hash Cond: (pt1.v1 = ((pt2.v3 + 1))) > -> Dynamic Seq Scan on public.pt1 (cost=0.00..431.00 rows=1 width=8) > Output: pt1.v1, pt1.v2 > Number of partitions to scan: 4 (out of 4) > -> Hash (cost=431.00..431.00 rows=34 width=4) > Output: ((pt2.v3 + 1)) > -> Partition Selector (selector id: $1) (cost=0.00..431.00 rows=34 width=4) > Output: ((pt2.v3 + 1)) > -> Redistribute Motion 3:3 (slice2; segments: 3) (cost=0.00..431.00 rows=34 width=4) > Output: ((pt2.v3 + 1)) > Hash Key: ((pt2.v3 + 1)) > -> Dynamic Seq Scan on public.pt2 (cost=0.00..431.00 rows=34 width=4) > Output: (pt2.v3 + 1) > Number of partitions to scan: 4 (out of 4) > -> Hash (cost=431.00..431.00 rows=1 width=4) > Output: ((pt2_1.v3 + 1)) > -> Partition Selector (selector id: $0) (cost=0.00..431.00 rows=1 width=4) > Output: ((pt2_1.v3 + 1)) > -> Redistribute Motion 3:3 (slice3; segments: 3) (cost=0.00..431.00 rows=1 width=4) > Output: ((pt2_1.v3 + 1)) > Hash Key: ((pt2_1.v3 + 1)) > -> Dynamic Seq Scan on public.pt2 pt2_1 (cost=0.00..431.00 rows=1 width=4) > Output: (pt2_1.v3 + 1) > Number of partitions to scan: 1 (out of 4) > Filter: (pt2_1.v3 = 12) > Optimizer: GPORCA > (33 rows) > ``` Yes, there are no constant expressions involved, otherwise the situation will become complicated. If we add support for constant expressions, the number of logical branches will become large. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
