Search in sources :

Example 1 with RecordQueryInValuesJoinPlan

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

the class QueryPlanStructuralInstrumentationTest method in.

@Test
public void in() {
    final String indexName = "a_field";
    final IndexScanParameters scan = IndexScanComparisons.byValue(new ScanComparisons(Arrays.asList(new Comparisons.ParameterComparison(Comparisons.Type.EQUALS, "another_field")), Collections.emptySet()));
    final RecordQueryPlan plan = new RecordQueryInValuesJoinPlan(new RecordQueryIndexPlan(indexName, scan, false), "another_field", Bindings.Internal.IN, Arrays.asList(2, 4), false, false);
    assertUsesIndexes(plan, Lists.newArrayList(indexName));
    final StoreTimer timer = new FDBStoreTimer();
    plan.logPlanStructure(timer);
    assertEquals(timer.getCount(FDBStoreTimer.Counts.PLAN_IN_VALUES), 1);
    assertEquals(timer.getCount(FDBStoreTimer.Counts.PLAN_INDEX), 1);
}
Also used : RecordQueryPlan(com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan) IndexScanParameters(com.apple.foundationdb.record.provider.foundationdb.IndexScanParameters) StoreTimer(com.apple.foundationdb.record.provider.common.StoreTimer) FDBStoreTimer(com.apple.foundationdb.record.provider.foundationdb.FDBStoreTimer) IndexScanComparisons(com.apple.foundationdb.record.provider.foundationdb.IndexScanComparisons) Comparisons(com.apple.foundationdb.record.query.expressions.Comparisons) IndexScanComparisons(com.apple.foundationdb.record.provider.foundationdb.IndexScanComparisons) FDBStoreTimer(com.apple.foundationdb.record.provider.foundationdb.FDBStoreTimer) RecordQueryIndexPlan(com.apple.foundationdb.record.query.plan.plans.RecordQueryIndexPlan) RecordQueryInValuesJoinPlan(com.apple.foundationdb.record.query.plan.plans.RecordQueryInValuesJoinPlan) Test(org.junit.jupiter.api.Test)

Example 2 with RecordQueryInValuesJoinPlan

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

the class QueryPlanCursorTest method in.

@Test
public void in() throws Exception {
    final IndexScanParameters scan = IndexScanComparisons.byValue(new ScanComparisons(Arrays.asList(new Comparisons.ParameterComparison(Comparisons.Type.EQUALS, "in_num")), Collections.emptySet()));
    final RecordQueryPlan plan = new RecordQueryInValuesJoinPlan(new RecordQueryIndexPlan("MySimpleRecord$num_value_3_indexed", scan, false), "in_num", Bindings.Internal.IN, Arrays.asList(2, 4), false, false);
    compareSkipsAndCursors(plan);
}
Also used : RecordQueryPlan(com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan) ScanComparisons(com.apple.foundationdb.record.query.plan.ScanComparisons) ScanComparisons(com.apple.foundationdb.record.query.plan.ScanComparisons) Comparisons(com.apple.foundationdb.record.query.expressions.Comparisons) RecordQueryIndexPlan(com.apple.foundationdb.record.query.plan.plans.RecordQueryIndexPlan) RecordQueryInValuesJoinPlan(com.apple.foundationdb.record.query.plan.plans.RecordQueryInValuesJoinPlan) Test(org.junit.jupiter.api.Test)

Aggregations

Comparisons (com.apple.foundationdb.record.query.expressions.Comparisons)2 RecordQueryInValuesJoinPlan (com.apple.foundationdb.record.query.plan.plans.RecordQueryInValuesJoinPlan)2 RecordQueryIndexPlan (com.apple.foundationdb.record.query.plan.plans.RecordQueryIndexPlan)2 RecordQueryPlan (com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan)2 Test (org.junit.jupiter.api.Test)2 StoreTimer (com.apple.foundationdb.record.provider.common.StoreTimer)1 FDBStoreTimer (com.apple.foundationdb.record.provider.foundationdb.FDBStoreTimer)1 IndexScanComparisons (com.apple.foundationdb.record.provider.foundationdb.IndexScanComparisons)1 IndexScanParameters (com.apple.foundationdb.record.provider.foundationdb.IndexScanParameters)1 ScanComparisons (com.apple.foundationdb.record.query.plan.ScanComparisons)1