DaZuiZui commented on PR #17960:
URL: https://github.com/apache/iotdb/pull/17960#issuecomment-4861941714

   Thanks for the detailed review and the measurements.
   
   I’ve addressed the performance/robustness issue you pointed out in the 
latest commit. The LCA rewrite no longer deep-copies/inlines the 
already-expanded expression from the previous alias. Instead, the planner 
reuses previous LCA projections through symbol mappings and appends SELECT 
projections in batches, so deep chained aliases should no longer cause the 
O(N^2) plan-expression / EXPLAIN JSON blowup.
   
   I also added regression tests for this case, including:
   - reusing a previous `CAST(...) AS x` projection without duplicating the 
Cast expression
   - a 200-column chained LCA case that keeps plan expressions shallow and the 
plan JSON bounded
   
   Verified with:
   
   ./mvnw test -pl iotdb-core/datanode -Dtest=SelectAliasReuseTest
   
   All 40 tests passed. Please take another look when you have time.


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

Reply via email to