Search in sources :

Example 1 with RecordQueryPlanWithChild

use of com.apple.foundationdb.record.query.plan.plans.RecordQueryPlanWithChild in project fdb-record-layer by FoundationDB.

the class PushInJoinThroughFetchRule method onMatch.

@Override
public void onMatch(@Nonnull PlannerRuleCall call) {
    final PlannerBindings bindings = call.getBindings();
    final RecordQueryInJoinPlan inJoinPlan = bindings.get(getMatcher());
    final RecordQueryFetchFromPartialRecordPlan fetchPlan = bindings.get(fetchPlanMatcher);
    final RecordQueryPlan innerPlan = bindings.get(innerPlanMatcher);
    final RecordQueryPlanWithChild pushedInJoinPlan = inJoinPlan.withChild(innerPlan);
    final var newFetchPlan = new RecordQueryFetchFromPartialRecordPlan(pushedInJoinPlan, fetchPlan.getPushValueFunction());
    call.yield(call.ref(newFetchPlan));
}
Also used : RecordQueryPlan(com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan) RecordQueryFetchFromPartialRecordPlan(com.apple.foundationdb.record.query.plan.plans.RecordQueryFetchFromPartialRecordPlan) PlannerBindings(com.apple.foundationdb.record.query.plan.temp.matchers.PlannerBindings) RecordQueryPlanWithChild(com.apple.foundationdb.record.query.plan.plans.RecordQueryPlanWithChild) RecordQueryInJoinPlan(com.apple.foundationdb.record.query.plan.plans.RecordQueryInJoinPlan)

Aggregations

RecordQueryFetchFromPartialRecordPlan (com.apple.foundationdb.record.query.plan.plans.RecordQueryFetchFromPartialRecordPlan)1 RecordQueryInJoinPlan (com.apple.foundationdb.record.query.plan.plans.RecordQueryInJoinPlan)1 RecordQueryPlan (com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan)1 RecordQueryPlanWithChild (com.apple.foundationdb.record.query.plan.plans.RecordQueryPlanWithChild)1 PlannerBindings (com.apple.foundationdb.record.query.plan.temp.matchers.PlannerBindings)1