Github user ioana-delaney commented on the issue: https://github.com/apache/spark/pull/15363 @davies Thank you for reviewing the code! I see this work as evolving and improving with the support of CBO. Without statistics and features such as cardinality and selectivity, we cannot provide an optimal join reordering. There were two types of regressions. The first type was caused by reordering a non-selective star join. The query did not apply any local predicate on the dimension tables and the join between two large fact tables happen to be very selective. To fix this category of queries, the algorithm will not attempt to reorder a non-selective join. A non-selective join is a join that does not apply local predicates on dimension tables. The other category of problem was caused by the more general issue of lacking predicate selectivity. To overcome this problem, we introduced the âpredicate selectivity hintâ feature, to allow the user to specify the selectivity of the predicate. With that, we are able to plan selective dimension first. The JIRA for predicate selectivity was not yet opened. Then, to further guard against bad plans, we put the feature under the starJoinOptimization option. I was thinking that, to be more conservatives, I can further enforce a certain number of joins in the star. In general, a star join consist of a fact table and at least two dimensions. I can add this restriction to the algorithm.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org