alamb commented on PR #25688:
URL: https://github.com/apache/datafusion/pull/25688#issuecomment-5811572752

   > an enforce -> optimize -> enforce alternation (enforcement still runs on 
both sides, since rules depend on it in each direction), with each enforcement 
pass gated on check_invariants so one whose requirements already hold is 
skipped by a cheap semantic check instead of a full re-derivation — repeated 
enforcement stays correct but cheap. Happy to capture all of this (topology, 
the invariant gate, and the deprecated shim) in an epic so this PR stays a 
small prerequisite — I can open it if you agree.
   
   I think we should consider aiming eventually for the invariant that each 
PhysicalOptimzierRule leaves the plan in a valid shape (so we don't have run 
multiple enforcement passes). That would be the simplest to reason about -- and 
would let each PhysicalOptimizerRule assume it got a valid plan as input which 
would also likely simplify the logic
   
   I am not sure how far away from this invariant the existing rules are
   
   > repeated enforcement stays correct but cheap
   
   I think it would be even cheaper if we didn't have to re-run Enforcement


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