Alex Behm has posted comments on this change.

Change subject: IMPALA-2805: Order conjuncts based on selectivity and cost
......................................................................


Patch Set 13:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/2598/13/fe/src/main/java/com/cloudera/impala/planner/PlanNode.java
File fe/src/main/java/com/cloudera/impala/planner/PlanNode.java:

Line 657:       double backoff_exp = 1.0 / (double) (sortedConjuncts.size() + 
1);
> i think you need the backoff, because in the cost calculation you estimate 
I follow the intuition, but I think we'd need a more complex algorithm to truly 
capture it.

Here were are choosing one predicate at a time, and in every iteration we apply 
a constant backoff to all remaining candidates. If we look at line 670 and 
expand it to explicitly include the backoff we get something like this:

// e.getCost() is constant for ever e
// totalCost is constant in this loop
for(T e: remaining)
  double cost = e.getCost() + (totalCost - e.getCost()) * Math.pow(sel, 
backoff);
  // maintain e with lowest cost
}

All candidates in one iteration get the same backoff, so I don't see how the 
backoff can affect the relative ordering.


-- 
To view, visit http://gerrit.cloudera.org:8080/2598
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I02279a26fbc6308ac5eb819d78345fc010469034
Gerrit-PatchSet: 13
Gerrit-Project: Impala
Gerrit-Branch: cdh5-trunk
Gerrit-Owner: Thomas Tauber-Marshall <[email protected]>
Gerrit-Reviewer: Alex Behm <[email protected]>
Gerrit-Reviewer: Henry Robinson <[email protected]>
Gerrit-Reviewer: Marcel Kornacker <[email protected]>
Gerrit-Reviewer: Matthew Jacobs <[email protected]>
Gerrit-Reviewer: Mostafa Mokhtar <[email protected]>
Gerrit-Reviewer: Thomas Tauber-Marshall <[email protected]>
Gerrit-HasComments: Yes

Reply via email to