[Bug] Plan with parameterized path may always be wrong #671
Labels
priority: Low
This issue can probably be picked up by anyone looking to contribute to the project, as an entry fix
type: Bug
Something isn't working
type: Orca
only orca has the issue
Cloudberry Database version
All versions affected
Also GP7 have the same issue.
What happened
This case has nothing to do with the table itself and the custom function. Only relative the parameterized path.
ORCA also will got the same issue with other sql.
So the SQL
select (select sameout(v) t) from t1;
plan isAs u can see we do have a
Motion
node exist in subplan. Then inResult
node won't get any tuple in this path.I guess this case is caused by optimizer. The optimizer should not create the parameterized path with the motion.
What you think should happen instead
this sql can change to the
select sameout(v) from t1;
or a subqueryselect sameout(v) from (select v from t1) t;
The corrent plan should flat the parameterized path or become a subquery
or no motion inside
How to reproduce
above
Operating System
any
Anything else
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: