adriangb commented on PR #26271:
URL: https://github.com/apache/datafusion/pull/26271#issuecomment-6429027114

   @asolimando Thank you for the review. I agree with your point about the 
statistics. I propose this:
   
   1. Merge #26428 into this PR.
   2. Optimize each CTE body one time, before the rest of the plan. Then give 
each scan the statistics, ordering and partitioning of the optimized body. Do 
not optimize the body again.
   3. Optimize the rest of the plan.
   
   This way, the scan always reports the correct properties of the body. #26428 
does not need its check and its fallback. The extra planning time is small, 
about 0.04 ms for one CTE (measured with #26428). I will keep the statistics 
and the properties in separate commits. Do you agree?


-- 
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]

Reply via email to