`simplify_const_expr` does unnecessary recursive work
Even after https://github.com/apache/datafusion/pull/20111, simplify_const_expr does unnecessary work, it can be pulled outside of the recursive transformation loop, and only calculated once for every expression subtree.
The current implementation runs through the whole tree for every node that is evaluated in the main recursion in the loop, every time.
take
Hi, I’d like to work on this if it’s still available.
From my understanding, the current implementation ends up re-traversing the entire expression tree for each node during the main recursion. I’m planning to restructure this so simplify_const_expr is computed once per expression subtree and reused, instead of being recalculated inside the recursive transformation loop.
I’ll aim to keep the behavior identical while reducing redundant work, and add tests to cover the change. Please let me know if this approach sounds reasonable before I start.
Thanks!