pan3793 opened a new pull request #35438: URL: https://github.com/apache/spark/pull/35438
### What changes were proposed in this pull request? This PR propose to materialize `QueryPlan#subqueries` and pruning by `PLAN_EXPRESSION` on search to improve the performance. ### Why are the changes needed? We found a query in production that cost lots of time in optimize phase (also include AQE optimize phase) when enable DPP, the SQL pattern likes ``` select <cols...> from a left join b on a.<col> = b.<col> left join c on b.<col> = c.<col> left join d on c.<col> = d.<col> left join e on d.<col> = e.<col> left join f on e.<col> = f.<col> left join g on f.<col> = g.<col> left join h on g.<col> = h.<col> ... ``` SPARK-36444 significantly reduces the optimize time (exclude AQE phase), see detail at #35431, but there are still lots of time costs in `PlanDynamicPruningFilters` on AQE optimize phase. Before this change, the query costs 658s, after this change only costs 65s. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing UTs. -- 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]
