Zach Amsden has posted comments on this change. Change subject: IMPALA-5547: Rework FK/PK join detection. ......................................................................
Patch Set 1: (1 comment) http://gerrit.cloudera.org:8080/#/c/7257/1/fe/src/main/java/org/apache/impala/planner/JoinNode.java File fe/src/main/java/org/apache/impala/planner/JoinNode.java: Line 253: return getFkPkJoinCardinality(eqJoinConjunctSlots, lhsCard, rhsCard); > 1. Changed the code to only pass those FK/PK conjuncts because that makes t My concern was that if we have compelling evidence that a FK/PK relationship is not present, we shouldn't pass those eqJoin conjuncts to the FK/PK cardinality estimation - e.g., SELECT orders.customer_id, shipments.ship_id from orders, shipments, WHERE orders.order_date = shipments.ship_date where the highly selective non-PK ship_date should not reduce the cardinality of the join - ideally, we multiply the cardinality by (|shipments| / NDV(shipments.ship_date)) -- To view, visit http://gerrit.cloudera.org:8080/7257 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I49074fe743a28573cff541ef7dbd0edd88892067 Gerrit-PatchSet: 1 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Alex Behm <alex.b...@cloudera.com> Gerrit-Reviewer: Alex Behm <alex.b...@cloudera.com> Gerrit-Reviewer: Dimitris Tsirogiannis <dtsirogian...@cloudera.com> Gerrit-Reviewer: Mostafa Mokhtar <mmokh...@cloudera.com> Gerrit-Reviewer: Zach Amsden <zams...@cloudera.com> Gerrit-HasComments: Yes