Quanlong Huang has posted comments on this change. ( http://gerrit.cloudera.org:8080/19682 )
Change subject: IMPALA-12006: Improve cardinality estimation for joins involving multiple conjuncts ...................................................................... Patch Set 3: (2 comments) http://gerrit.cloudera.org:8080/#/c/19682/3//COMMIT_MSG Commit Message: http://gerrit.cloudera.org:8080/#/c/19682/3//COMMIT_MSG@30 PS3, Line 30: consider per join hints but in a complex query (or a view that is It might also be hard to tune the query option when the query has hundreds of joins. Some estimation might be better and some might be worse. I think we do need per join or per predicate hints to have more control. This patch might help: https://gerrit.cloudera.org/c/18023/ It adds hints for predicate selectivity which can also be used on compounded predicates. E.g. SELECT * FROM t1 inner join (SELECT a2, MAX(b2) as max_b2 FROM t2 GROUP BY a2) s2 ON (t1.a1 = s2.a2 AND t1.b1 = s2.max_b2) /* +SELECTIVITY(0.5) */ http://gerrit.cloudera.org:8080/#/c/19682/3/fe/src/main/java/org/apache/impala/planner/JoinNode.java File fe/src/main/java/org/apache/impala/planner/JoinNode.java: http://gerrit.cloudera.org:8080/#/c/19682/3/fe/src/main/java/org/apache/impala/planner/JoinNode.java@487 PS3, Line 487: result = Math.min(result, joinCard); Should we consider multiply the selectivity here too? (if the query option is set) -- To view, visit http://gerrit.cloudera.org:8080/19682 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I845d778a58404af834f7501fc8157a5a4b4bcc35 Gerrit-Change-Number: 19682 Gerrit-PatchSet: 3 Gerrit-Owner: Aman Sinha <[email protected]> Gerrit-Reviewer: Aman Sinha <[email protected]> Gerrit-Reviewer: Csaba Ringhofer <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Kurt Deschler <[email protected]> Gerrit-Reviewer: Quanlong Huang <[email protected]> Gerrit-Comment-Date: Fri, 07 Apr 2023 00:33:11 +0000 Gerrit-HasComments: Yes
