use of org.apache.jackrabbit.oak.query.plan.JoinExecutionPlan in project jackrabbit-oak by apache.
the class JoinImpl method prepare.
@Override
public void prepare(ExecutionPlan p) {
if (!(p instanceof JoinExecutionPlan)) {
throw new IllegalArgumentException("Not a join plan");
}
JoinExecutionPlan joinPlan = (JoinExecutionPlan) p;
if (joinPlan.getJoin() != this) {
throw new IllegalArgumentException("Not a plan for this join");
}
this.plan = joinPlan;
applyJoinConditions();
left.prepare(joinPlan.getLeftPlan());
right.prepare(joinPlan.getRightPlan());
}
use of org.apache.jackrabbit.oak.query.plan.JoinExecutionPlan in project jackrabbit-oak by apache.
the class JoinImpl method prepare.
@Override
public ExecutionPlan prepare() {
if (plan != null) {
return plan;
}
applyJoinConditions();
// the estimated cost is the cost of the left selector,
// plus twice the cost of the right selector (we expect
// two rows for the right selector for each node
// on the left selector)
ExecutionPlan leftPlan = left.prepare();
ExecutionPlan rightPlan = right.prepare();
double cost = leftPlan.getEstimatedCost() + 2 * rightPlan.getEstimatedCost();
plan = new JoinExecutionPlan(this, leftPlan, rightPlan, cost);
return plan;
}
Aggregations