diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/combinatorics/EnumeratingIterable.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/combinatorics/EnumeratingIterable.java index 2ba9c3cff0..084c704916 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/combinatorics/EnumeratingIterable.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/combinatorics/EnumeratingIterable.java @@ -44,6 +44,10 @@ static EnumeratingIterable singleIterable(@Nonnull final T singleElement) return new SingleIterable<>(singleElement); } + static EnumeratingIterable emptyOnEmptyIterable() { + return new SingleIterable<>(); + } + /** * An implementation of {@link EnumeratingIterable} that is optimized to work for empty * input sets. @@ -84,13 +88,17 @@ public EnumeratingIterator iterator() { * @param type */ class SingleIterable implements EnumeratingIterable { - @Nonnull + @Nullable private final T singleElement; private SingleIterable(@Nonnull final T singleElement) { this.singleElement = singleElement; } + private SingleIterable() { + this.singleElement = null; + } + @Nonnull @Override public EnumeratingIterator iterator() { @@ -103,12 +111,12 @@ public EnumeratingIterator iterator() { * @param type of the element */ class SingleIterator extends AbstractIterator> implements EnumeratingIterator { - @Nonnull + @Nullable private final T singleElement; boolean atFirst = true; - private SingleIterator(@Nonnull final T singleElement) { + private SingleIterator(@Nullable final T singleElement) { this.singleElement = singleElement; } @@ -128,6 +136,9 @@ protected List computeNext() { atFirst = false; + if (singleElement == null) { + return ImmutableList.of(); + } return ImmutableList.of(singleElement); } } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/combinatorics/TopologicalSort.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/combinatorics/TopologicalSort.java index 02c1ce76e3..ab21893476 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/combinatorics/TopologicalSort.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/combinatorics/TopologicalSort.java @@ -537,10 +537,6 @@ public static Iterable> satisfyingPermutations(@Nonnull final Par @Nonnull final List

targetPermutation, @Nonnull final Function domainMapper, @Nonnull final Function, Integer> satisfiabilityFunction) { - if (partiallyOrderedSet.isEmpty()) { - return ImmutableList.of(); - } - if (partiallyOrderedSet.size() < targetPermutation.size()) { return ImmutableList.of(); } @@ -565,9 +561,11 @@ protected Iterator domain(final int t) { } } }; - } else { - Verify.verify(partiallyOrderedSet.size() == 1); + } else if (partiallyOrderedSet.size() == 1) { enumeratingIterator = EnumeratingIterable.singleIterable(Iterables.getOnlyElement(partiallyOrderedSet.getSet())).iterator(); + } else { + Verify.verify(partiallyOrderedSet.isEmpty()); + enumeratingIterator = EnumeratingIterable.emptyOnEmptyIterable().iterator(); } return () -> new AbstractIterator<>() { diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/QueryPlanConstraint.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/QueryPlanConstraint.java index 421eefc6b6..1dbb1611af 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/QueryPlanConstraint.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/QueryPlanConstraint.java @@ -62,6 +62,10 @@ public QueryPredicate getPredicate() { return predicate; } + public boolean isTautology() { + return predicate.isTautology(); + } + public boolean isConstrained() { return !getPredicate().isTautology(); } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/AggregateIndexExpansionVisitor.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/AggregateIndexExpansionVisitor.java index 74d1725305..902dffb5ed 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/AggregateIndexExpansionVisitor.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/AggregateIndexExpansionVisitor.java @@ -34,6 +34,7 @@ import com.apple.foundationdb.record.query.plan.cascades.expressions.SelectExpression; import com.apple.foundationdb.record.query.plan.cascades.predicates.Placeholder; import com.apple.foundationdb.record.query.plan.cascades.predicates.PredicateWithValueAndRanges; +import com.apple.foundationdb.record.query.plan.cascades.values.AggregateValue; import com.apple.foundationdb.record.query.plan.cascades.values.ArithmeticValue; import com.apple.foundationdb.record.query.plan.cascades.values.CountValue; import com.apple.foundationdb.record.query.plan.cascades.values.EmptyValue; @@ -57,10 +58,10 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.Collection; -import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Optional; import java.util.function.Supplier; import java.util.stream.Stream; @@ -72,7 +73,12 @@ public class AggregateIndexExpansionVisitor extends KeyExpressionExpansionVisitor implements ExpansionVisitor { @Nonnull - static final Supplier>> aggregateMap = Suppliers.memoize(AggregateIndexExpansionVisitor::computeAggregateMap); + static final Supplier>> aggregateMap = + Suppliers.memoize(AggregateIndexExpansionVisitor::computeAggregateMap); + + @Nonnull + static final Supplier>> rollUpAggregateMap = + Suppliers.memoize(AggregateIndexExpansionVisitor::computeRollUpAggregateMap); @Nonnull protected final Index index; @@ -92,7 +98,8 @@ public class AggregateIndexExpansionVisitor extends KeyExpressionExpansionVisito * @param recordTypes The indexed record types. */ public AggregateIndexExpansionVisitor(@Nonnull final Index index, @Nonnull final Collection recordTypes) { - Preconditions.checkArgument(IndexTypes.BITMAP_VALUE.equals(index.getType()) || aggregateMap.get().containsKey(index.getType())); + Preconditions.checkArgument(IndexTypes.BITMAP_VALUE.equals(index.getType()) || + aggregateMap.get().containsKey(index.getType())); Preconditions.checkArgument(index.getRootExpression() instanceof GroupingKeyExpression); this.index = index; this.groupingKeyExpression = ((GroupingKeyExpression)index.getRootExpression()); @@ -139,9 +146,9 @@ public MatchCandidate expand(@Nonnull final Supplier baseQua .addAll(groupByPlaceholders).build(); // 3. construct SELECT-HAVING with SORT on top. - final var selectHavingAndPlaceholderAliases = constructSelectHaving(groupByQun, placeholders); - final var selectHaving = selectHavingAndPlaceholderAliases.getLeft(); - final var placeHolderAliases = selectHavingAndPlaceholderAliases.getRight(); + final var constructSelectHavingResult = constructSelectHaving(groupByQun, placeholders); + final var selectHaving = constructSelectHavingResult.getSelectExpression(); + final var placeHolderAliases = constructSelectHavingResult.getPlaceholderAliases(); // 4. add sort on top, if necessary, this will be absorbed later on as an ordering property of the match candidate. final var maybeWithSort = placeHolderAliases.isEmpty() @@ -278,19 +285,25 @@ protected NonnullPair> constructGroupBy(@Nonnull f } @Nonnull - private NonnullPair> constructSelectHaving(@Nonnull final Quantifier groupByQun, - @Nonnull final List selectWherePlaceholders) { + private ConstructSelectHavingResult constructSelectHaving(@Nonnull final Quantifier groupByQun, + @Nonnull final List selectWherePlaceholders) { + final var rangesOverExpression = groupByQun.getRangesOver().get(); + Verify.verify(rangesOverExpression instanceof GroupByExpression); + final var groupByExpression = (GroupByExpression)rangesOverExpression; + // the grouping value in GroupByExpression comes first (if set). @Nullable final var groupingValueReference = - (groupByQun.getRangesOver().get() instanceof GroupByExpression && ((GroupByExpression)groupByQun.getRangesOver().get()).getGroupingValue() == null) - ? null - : FieldValue.ofOrdinalNumber(groupByQun.getFlowedObjectValue(), 0); + groupByExpression.getGroupingValue() == null + ? null : FieldValue.ofOrdinalNumber(groupByQun.getFlowedObjectValue(), 0); - final var aggregateValueReference = FieldValue.ofOrdinalNumberAndFuseIfPossible(FieldValue.ofOrdinalNumber(groupByQun.getFlowedObjectValue(), groupingValueReference == null ? 0 : 1), 0); + final var aggregateValueReference = + FieldValue.ofOrdinalNumberAndFuseIfPossible(FieldValue.ofOrdinalNumber(groupByQun.getFlowedObjectValue(), + groupingValueReference == null ? 0 : 1), 0); final var placeholderAliases = ImmutableList.builder(); final var selectHavingGraphExpansionBuilder = GraphExpansion.builder().addQuantifier(groupByQun); - final List groupingValues = groupingValueReference == null ? Collections.emptyList() : Values.deconstructRecord(groupingValueReference); + final List groupingValues = groupingValueReference == null + ? ImmutableList.of() : Values.deconstructRecord(groupingValueReference); if (groupingValueReference != null) { int i = 0; for (final var groupingValue : groupingValues) { @@ -322,7 +335,15 @@ private NonnullPair> constructSele } else { finalPlaceholders = placeholderAliases.build(); } - return NonnullPair.of(selectHavingGraphExpansionBuilder.build().buildSelect(), finalPlaceholders); + + return new ConstructSelectHavingResult(selectHavingGraphExpansionBuilder.build().buildSelect(), + finalPlaceholders); + } + + @Nonnull + public static Optional aggregateValue(@Nonnull final Index index, @Nonnull final Value argument) { + return Optional.of((AggregateValue)aggregateMap.get() + .get(index.getType()).encapsulate(ImmutableList.of(argument))); } @Nonnull @@ -339,4 +360,53 @@ private static Map> computeAggregateMap mapBuilder.put(IndexTypes.PERMUTED_MIN, new NumericAggregationValue.MinFn()); return mapBuilder.build(); } + + public static boolean canBeRolledUp(@Nonnull final String indexType) { + return rollUpAggregateMap.get().containsKey(indexType); + } + + @Nonnull + public static Optional rollUpAggregateValueMaybe(@Nonnull final String indexType, @Nonnull final Value argument) { + return Optional.ofNullable(rollUpAggregateMap.get() + .get(indexType)) + .map(fn -> (AggregateValue)fn.encapsulate(ImmutableList.of(argument))); + } + + @Nonnull + private static Map> computeRollUpAggregateMap() { + final ImmutableMap.Builder> mapBuilder = ImmutableMap.builder(); + mapBuilder.put(IndexTypes.MAX_EVER_LONG, new NumericAggregationValue.MaxFn()); + mapBuilder.put(IndexTypes.MIN_EVER_LONG, new NumericAggregationValue.MinFn()); + mapBuilder.put(IndexTypes.MAX_EVER_TUPLE, new NumericAggregationValue.MaxFn()); + mapBuilder.put(IndexTypes.MIN_EVER_TUPLE, new NumericAggregationValue.MinFn()); + mapBuilder.put(IndexTypes.SUM, new NumericAggregationValue.SumFn()); + mapBuilder.put(IndexTypes.COUNT, new NumericAggregationValue.SumFn()); + mapBuilder.put(IndexTypes.COUNT_NOT_NULL, new NumericAggregationValue.SumFn()); + mapBuilder.put(IndexTypes.PERMUTED_MAX, new NumericAggregationValue.MaxFn()); + mapBuilder.put(IndexTypes.PERMUTED_MIN, new NumericAggregationValue.MinFn()); + return mapBuilder.build(); + } + + private static class ConstructSelectHavingResult { + @Nonnull + private final SelectExpression selectExpression; + @Nonnull + private final List placeholderAliases; + + private ConstructSelectHavingResult(@Nonnull final SelectExpression selectExpression, + @Nonnull final List placeholderAliases) { + this.selectExpression = selectExpression; + this.placeholderAliases = placeholderAliases; + } + + @Nonnull + public SelectExpression getSelectExpression() { + return selectExpression; + } + + @Nonnull + public List getPlaceholderAliases() { + return placeholderAliases; + } + } } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/AggregateIndexMatchCandidate.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/AggregateIndexMatchCandidate.java index f1dced4c25..037b6a3dbe 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/AggregateIndexMatchCandidate.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/AggregateIndexMatchCandidate.java @@ -43,13 +43,17 @@ import com.apple.foundationdb.record.query.plan.cascades.typing.TypeRepository; import com.apple.foundationdb.record.query.plan.cascades.values.FieldValue; import com.apple.foundationdb.record.query.plan.cascades.values.QuantifiedObjectValue; +import com.apple.foundationdb.record.query.plan.cascades.values.RecordConstructorValue; import com.apple.foundationdb.record.query.plan.cascades.values.Value; import com.apple.foundationdb.record.query.plan.cascades.values.Values; import com.apple.foundationdb.record.query.plan.cascades.values.simplification.OrderingValueComputationRuleSet; +import com.apple.foundationdb.record.query.plan.cascades.values.translation.PullUp; import com.apple.foundationdb.record.query.plan.plans.RecordQueryAggregateIndexPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryFetchFromPartialRecordPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryIndexPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan; +import com.apple.foundationdb.record.query.plan.plans.RecordQueryStreamingAggregationPlan; +import com.apple.foundationdb.record.util.pair.NonnullPair; import com.google.common.base.Preconditions; import com.google.common.base.Verify; import com.google.common.collect.ImmutableList; @@ -156,7 +160,7 @@ public KeyExpression getFullKeyExpression() { @Override public String toString() { - return "Agg[" + getName() + "; " + index.getType() + "]"; + return "AGG[" + getName() + "; " + index.getType() + "]"; } @Override @@ -188,8 +192,8 @@ private int getPermutedCount() { public List computeMatchedOrderingParts(@Nonnull final MatchInfo matchInfo, @Nonnull final List sortParameterIds, final boolean isReverse) { - final var parameterBindingMap = - matchInfo.getRegularMatchInfo().getParameterBindingMap(); + final var regularMatchInfo = matchInfo.getRegularMatchInfo(); + final var parameterBindingMap = regularMatchInfo.getParameterBindingMap(); final var normalizedKeyExpressions = getFullKeyExpression().normalizeKeyForPositions(); @@ -197,9 +201,12 @@ public List computeMatchedOrderingParts(@Nonnull final Matc final var candidateParameterIds = getOrderingAliases(); final var normalizedValues = Sets.newHashSetWithExpectedSize(normalizedKeyExpressions.size()); - final var selectHavingResultValue = selectHavingExpression.getResultValue(); - final var deconstructedValue = Values.deconstructRecord(selectHavingResultValue); - final var aliasMap = AliasMap.ofAliases(Iterables.getOnlyElement(selectHavingResultValue.getCorrelatedTo()), Quantifier.current()); + final var selectHavingResultType = selectHavingExpression.getResultValue().getResultType(); + final var deconstructedValues = + Values.deconstructRecord(QuantifiedObjectValue.of(Quantifier.current(), selectHavingResultType)); + + final var rollUpToGroupingValues = regularMatchInfo.getRollUpToGroupingValues(); + final int orderSize = rollUpToGroupingValues != null ? rollUpToGroupingValues.size() : sortParameterIds.size(); // Compute the ordering for this index by collecting the result values of the selectHaving statement // associated with each sortParameterId. Note that for most aggregate indexes, the aggregate value is @@ -207,7 +214,8 @@ public List computeMatchedOrderingParts(@Nonnull final Matc // corresponding to it. For the PERMUTED_MIN and PERMUTED_MAX indexes, the aggregate _does_ have a corresponding // sortParameterId. Its position is determined by the permutedSize option, handled below by adjusting the // sortParameterId's index before looking it up in the original key expression - for (final var parameterId : sortParameterIds) { + for (int i = 0; i < orderSize; i++) { + final var parameterId = sortParameterIds.get(i); final var ordinalInCandidate = candidateParameterIds.indexOf(parameterId); Verify.verify(ordinalInCandidate >= 0); int permutedIndex = indexWithPermutation(ordinalInCandidate); @@ -230,7 +238,7 @@ public List computeMatchedOrderingParts(@Nonnull final Matc } // Grab the value for this sortParameterID from the selectHaving result columns - final var value = deconstructedValue.get(permutedIndex).rebase(aliasMap); + final var value = deconstructedValues.get(permutedIndex); if (normalizedValues.add(value)) { final var matchedOrderingPart = @@ -282,7 +290,6 @@ public Ordering computeOrderingFromScanComparisons(@Nonnull final ScanComparison final int groupingCount = ((GroupingKeyExpression)index.getRootExpression()).getGroupingCount(); if (!isPermuted() && groupingCount == 0) { - // TODO this should be something like anything-order. return Ordering.empty(); } @@ -358,6 +365,33 @@ public Ordering computeOrderingFromScanComparisons(@Nonnull final ScanComparison return Ordering.ofOrderingSequence(bindingMapBuilder.build(), orderingSequenceBuilder.build(), isDistinct); } + @Nullable + @Override + public PullUp.UnificationPullUp prepareForUnification(@Nonnull final PartialMatch partialMatch, + @Nonnull final CorrelationIdentifier topAlias, + @Nonnull final CorrelationIdentifier topCandidateAlias) { + final var regularMatchInfo = partialMatch.getRegularMatchInfo(); + if (regularMatchInfo.getRollUpToGroupingValues() != null) { + final var groupingAndAggregateAccessors = + getGroupingAndAggregateAccessors(topCandidateAlias); + final var groupingAccessorValues = groupingAndAggregateAccessors.getLeft(); + final var aggregateAccessorValue = groupingAndAggregateAccessors.getRight(); + final var allFields = + ((Type.Record)selectHavingExpression.getResultValue().getResultType()).getFields(); + final var rollUpColumnsBuilder = + ImmutableList.>builder(); + final var numGroupings = regularMatchInfo.getRollUpToGroupingValues().size(); + for (int i = 0; i < numGroupings; i++) { + final var field = allFields.get(i); + rollUpColumnsBuilder.add(Column.of(field, groupingAccessorValues.get(i))); + } + rollUpColumnsBuilder.add(Column.of(allFields.get(allFields.size() - 1), aggregateAccessorValue)); + return PullUp.forUnification(topAlias, RecordConstructorValue.ofColumns(rollUpColumnsBuilder.build()), + ImmutableSet.of(topCandidateAlias)); + } + return null; + } + @Nonnull @Override public RecordQueryPlan toEquivalentPlan(@Nonnull final PartialMatch partialMatch, @@ -368,13 +402,14 @@ public RecordQueryPlan toEquivalentPlan(@Nonnull final PartialMatch partialMatch final var baseRecordType = Type.Record.fromFieldDescriptorsMap(RecordMetaData.getFieldDescriptorMapFromTypes(recordTypes)); final var selectHavingResultValue = selectHavingExpression.getResultValue(); - final var resultType = selectHavingResultValue.getResultType(); + final var resultType = (Type.Record)selectHavingResultValue.getResultType(); final var messageDescriptor = Objects.requireNonNull(TypeRepository.newBuilder() .addTypeIfNeeded(resultType) .build() .getMessageDescriptor(resultType)); - final var constraintMaybe = partialMatch.getRegularMatchInfo().getConstraint(); + final var regularMatchInfo = partialMatch.getRegularMatchInfo(); + final var constraintMaybe = regularMatchInfo.getConstraint(); final var indexEntryConverter = createIndexEntryConverter(messageDescriptor); final var aggregateIndexScan = new RecordQueryIndexPlan(index.getName(), @@ -388,12 +423,46 @@ public RecordQueryPlan toEquivalentPlan(@Nonnull final PartialMatch partialMatch baseRecordType, QueryPlanConstraint.noConstraint()); - return new RecordQueryAggregateIndexPlan(aggregateIndexScan, + var plan = new RecordQueryAggregateIndexPlan(aggregateIndexScan, recordTypes.get(0).getName(), indexEntryConverter, selectHavingResultValue, groupByResultValue, constraintMaybe); + + if (regularMatchInfo.getRollUpToGroupingValues() != null) { + // + // We need to perform a roll up. + // + final var aggregateIndexScanReference = memoizer.memoizePlan(plan); + final var aggregateIndexScanAlias = Quantifier.uniqueId(); + + //final var recordValues = Values.deconstructRecord(recordValue); + final var groupingAndAggregateAccessors = + getGroupingAndAggregateAccessors(getGroupingCount(), aggregateIndexScanAlias); + final var groupingAccessorValues = groupingAndAggregateAccessors.getLeft(); + final var aggregateAccessorValue = groupingAndAggregateAccessors.getRight(); + final var allFields = resultType.getFields(); + final var rollUpGroupingColumnsBuilder = + ImmutableList.>builder(); + for (int i = 0; i < regularMatchInfo.getRollUpToGroupingValues().size(); i++) { + final var field = allFields.get(i); + rollUpGroupingColumnsBuilder.add(Column.of(field, groupingAccessorValues.get(i))); + } + + final var rollUpAggregateValueOptional = + AggregateIndexExpansionVisitor.rollUpAggregateValueMaybe(index.getType(), + aggregateAccessorValue); + + final var aggregateIndexScanQuantifier = + Quantifier.physical(aggregateIndexScanReference, aggregateIndexScanAlias); + + return RecordQueryStreamingAggregationPlan.ofFlattened(aggregateIndexScanQuantifier, + RecordConstructorValue.ofColumns(rollUpGroupingColumnsBuilder.build(), resultType.isNullable()), + rollUpAggregateValueOptional.orElseThrow(() -> new RecordCoreException("unknown rollup operation")), + RecordQueryStreamingAggregationPlan.SerializationMode.TO_NEW); + } + return plan; } @Nonnull @@ -409,6 +478,26 @@ protected int getGroupingCount() { : keyExpressionGroupingCount; } + @Nonnull + public NonnullPair, Value> getGroupingAndAggregateAccessors(@Nonnull final CorrelationIdentifier alias) { + return getGroupingAndAggregateAccessors(getGroupingCount(), alias); + } + + @Nonnull + public NonnullPair, Value> getGroupingAndAggregateAccessors(final int numGroupings, + @Nonnull final CorrelationIdentifier alias) { + final var selectHavingResultValue = selectHavingExpression.getResultValue(); + final var selectHavingResultType = (Type.Record)selectHavingResultValue.getResultType(); + final var unbasedResultValue = + QuantifiedObjectValue.of(alias, selectHavingResultType); + final var deconstructedRecord = Values.deconstructRecord(unbasedResultValue); + Verify.verify(deconstructedRecord.size() > numGroupings); + final var groupingAccessorValues = + ImmutableList.copyOf(deconstructedRecord.subList(0, numGroupings)); + final var aggregateAccessorValue = deconstructedRecord.get(numGroupings); + return NonnullPair.of(groupingAccessorValues, aggregateAccessorValue); + } + /** * Creates a new {@link IndexKeyValueToPartialRecord} to facilitate the correct copying of information from the * index-tuple structure to a partial record (which in this case is dynamically-typed). diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/BitmapAggregateIndexExpansionVisitor.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/BitmapAggregateIndexExpansionVisitor.java index f65dd9c0cd..44b5ffb846 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/BitmapAggregateIndexExpansionVisitor.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/BitmapAggregateIndexExpansionVisitor.java @@ -87,7 +87,6 @@ protected NonnullPair> constructGroupBy(@Nonnull f throw new UnsupportedOperationException("unable to plan group by with non-field value " + groupedValue); } - final var bitmapConstructAggFunc = BuiltInFunctionCatalog.getFunctionSingleton(NumericAggregationValue.BitmapConstructAggFn.class).orElseThrow(); final var bitmapBitPositionFunc = BuiltInFunctionCatalog.getFunctionSingleton(ArithmeticValue.BitmapBitPositionFn.class).orElseThrow(); final String sizeArgument = index.getOption(IndexOptions.BITMAP_VALUE_ENTRY_SIZE_OPTION); @@ -98,7 +97,6 @@ protected NonnullPair> constructGroupBy(@Nonnull f // add an RCV column representing the grouping columns as the first result set column // also, make sure to set the field type names correctly for each field value in the grouping keys RCV. - final var groupingValues = baseExpansion.getResultColumns().subList(0, groupingKeyExpression.getGroupingCount()) .stream() .map(Column::getValue) diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/Compensation.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/Compensation.java index a881ad6c0f..294824d1cb 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/Compensation.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/Compensation.java @@ -26,9 +26,11 @@ import com.apple.foundationdb.record.query.plan.cascades.expressions.LogicalFilterExpression; import com.apple.foundationdb.record.query.plan.cascades.expressions.RelationalExpression; import com.apple.foundationdb.record.query.plan.cascades.predicates.QueryPredicate; -import com.apple.foundationdb.record.query.plan.cascades.rules.DataAccessRule; +import com.apple.foundationdb.record.query.plan.cascades.values.Value; +import com.apple.foundationdb.record.query.plan.cascades.values.translation.TranslationMap; import com.google.common.base.Suppliers; import com.google.common.base.Verify; +import com.google.common.collect.ImmutableBiMap; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; @@ -38,6 +40,7 @@ import java.util.Collection; import java.util.Map; import java.util.Set; +import java.util.function.Function; import java.util.function.Supplier; /** @@ -103,9 +106,8 @@ *
* Compensation is computed either during the matching process or is computed after a complete match has been found * utilizing helper structures such as {@link PartialMatch} and {@link MatchInfo}, which are themselves - * built during matching. Logic in - * {@link DataAccessRule} computes and applies compensation - * as needed when a complete index match has been found. + * built during matching. Logic in the data access rules computes and applies compensation as needed when a complete + * index match has been found. *
* A query sub graph can have multiple matches that could be utilized. In the example above, another index on {@code b} * would also match but use {@code b} for the index scan and a predicate {@code WHERE a = 3}. Both match the query, @@ -144,14 +146,16 @@ public Compensation intersect(@Nonnull final Compensation otherCompensation) { @Nonnull @Override public RelationalExpression apply(@Nonnull final Memoizer memoizer, - @Nonnull final RelationalExpression relationalExpression) { + @Nonnull final RelationalExpression relationalExpression, + @Nonnull Function matchedToRealizedTranslationMapFunction) { throw new RecordCoreException("this method should not be called"); } @Nonnull @Override public RelationalExpression applyFinal(@Nonnull final Memoizer memoizer, - @Nonnull final RelationalExpression relationalExpression) { + @Nonnull final RelationalExpression relationalExpression, + @Nonnull Function matchedToRealizedTranslationMapFunction) { throw new RecordCoreException("this method should not be called"); } }; @@ -188,26 +192,29 @@ public Compensation intersect(@Nonnull final Compensation otherCompensation) { @Nonnull @Override public RelationalExpression apply(@Nonnull final Memoizer memoizer, - @Nonnull final RelationalExpression relationalExpression) { + @Nonnull final RelationalExpression relationalExpression, + @Nonnull Function matchedToRealizedTranslationMapFunction) { throw new RecordCoreException("this method should not be called"); } @Nonnull @Override public RelationalExpression applyFinal(@Nonnull final Memoizer memoizer, - @Nonnull final RelationalExpression relationalExpression) { + @Nonnull final RelationalExpression relationalExpression, + @Nonnull Function matchedToRealizedTranslationMapFunction) { throw new RecordCoreException("this method should not be called"); } }; @Nonnull default RelationalExpression applyAllNeededCompensations(@Nonnull final Memoizer memoizer, - @Nonnull RelationalExpression relationalExpression) { + @Nonnull RelationalExpression relationalExpression, + @Nonnull Function matchedToRealizedTranslationMapFunction) { if (isNeededForFiltering()) { - relationalExpression = apply(memoizer, relationalExpression); + relationalExpression = apply(memoizer, relationalExpression, matchedToRealizedTranslationMapFunction); } if (isFinalNeeded()) { - relationalExpression = applyFinal(memoizer, relationalExpression); + relationalExpression = applyFinal(memoizer, relationalExpression, matchedToRealizedTranslationMapFunction); } return relationalExpression; @@ -219,11 +226,15 @@ default RelationalExpression applyAllNeededCompensations(@Nonnull final Memoizer * {@link WithSelectCompensation}. * @param memoizer the memoizer for new {@link Reference}s * @param relationalExpression root of graph to apply compensation to + * @param matchedToRealizedTranslationMapFunction a function that given an alias for the quantifier over the + * realized compensation, returns a {@link TranslationMap} that is then used to translate + * from {@link QueryPredicate}s and {@link Value}s using matched aliases to the realized alias * @return a new relational expression that corrects the result of {@code reference} by applying appropriate * filters and/or transformations */ @Nonnull - RelationalExpression apply(@Nonnull Memoizer memoizer, @Nonnull RelationalExpression relationalExpression); + RelationalExpression apply(@Nonnull Memoizer memoizer, @Nonnull RelationalExpression relationalExpression, + @Nonnull Function matchedToRealizedTranslationMapFunction); /** * When applied to a reference this method returns a {@link RelationalExpression} consuming the @@ -231,11 +242,15 @@ default RelationalExpression applyAllNeededCompensations(@Nonnull final Memoizer * {@link WithSelectCompensation}. * @param memoizer the memoizer for new {@link Reference}s * @param relationalExpression root of graph to apply compensation to + * @param matchedToRealizedTranslationMapFunction a function that given an alias for the quantifier over the + * realized compensation, returns a {@link TranslationMap} that is then used to translate + * from {@link QueryPredicate}s and {@link Value}s using matched aliases to the realized alias * @return a new relational expression that corrects the result of {@code reference} by applying a final shape * correction of the resulting records. */ @Nonnull - RelationalExpression applyFinal(@Nonnull Memoizer memoizer, @Nonnull RelationalExpression relationalExpression); + RelationalExpression applyFinal(@Nonnull Memoizer memoizer, @Nonnull RelationalExpression relationalExpression, + @Nonnull Function matchedToRealizedTranslationMapFunction); /** * Returns if this compensation object needs to be applied in order to correct the result of a match. @@ -316,15 +331,20 @@ default Compensation union(@Nonnull Compensation otherCompensation) { @Nonnull @Override public RelationalExpression apply(@Nonnull final Memoizer memoizer, - @Nonnull final RelationalExpression relationalExpression) { - return Compensation.this.apply(memoizer, otherCompensation.apply(memoizer, relationalExpression)); + @Nonnull final RelationalExpression relationalExpression, + @Nonnull Function matchedToRealizedTranslationMapFunction) { + return Compensation.this.apply(memoizer, otherCompensation.apply(memoizer, relationalExpression, + matchedToRealizedTranslationMapFunction), matchedToRealizedTranslationMapFunction); } @Nonnull @Override public RelationalExpression applyFinal(@Nonnull final Memoizer memoizer, - @Nonnull final RelationalExpression relationalExpression) { - return Compensation.this.apply(memoizer, otherCompensation.apply(memoizer, relationalExpression)); + @Nonnull final RelationalExpression relationalExpression, + @Nonnull Function matchedToRealizedTranslationMapFunction) { + return Compensation.this.applyFinal(memoizer, otherCompensation.applyFinal(memoizer, + relationalExpression, matchedToRealizedTranslationMapFunction), + matchedToRealizedTranslationMapFunction); } }; } @@ -344,17 +364,21 @@ default Compensation intersect(@Nonnull Compensation otherCompensation) { @Nonnull @Override public RelationalExpression apply(@Nonnull final Memoizer memoizer, - @Nonnull final RelationalExpression relationalExpression) { + @Nonnull final RelationalExpression relationalExpression, + @Nonnull Function matchedToRealizedTranslationMapFunction) { return Compensation.this.apply(memoizer, - otherCompensation.apply(memoizer, relationalExpression)); + otherCompensation.apply(memoizer, relationalExpression, + matchedToRealizedTranslationMapFunction), matchedToRealizedTranslationMapFunction); } @Nonnull @Override public RelationalExpression applyFinal(@Nonnull final Memoizer memoizer, - @Nonnull final RelationalExpression relationalExpression) { - return Compensation.this.apply(memoizer, - otherCompensation.apply(memoizer, relationalExpression)); + @Nonnull final RelationalExpression relationalExpression, + @Nonnull Function matchedToRealizedTranslationMapFunction) { + return Compensation.this.applyFinal(memoizer, + otherCompensation.applyFinal(memoizer, relationalExpression, + matchedToRealizedTranslationMapFunction), matchedToRealizedTranslationMapFunction); } }; } @@ -388,7 +412,8 @@ default ForMatch derived(final boolean isImpossible, @Nonnull final Collection matchedQuantifiers, @Nonnull final Set unmatchedQuantifiers, @Nonnull final Set compensatedAliases, - @Nonnull final ResultCompensationFunction resultCompensationFunction) { + @Nonnull final ResultCompensationFunction resultCompensationFunction, + @Nonnull final GroupByMappings groupByMappings) { // // At least one of these conditions must be true: // - it is an impossible compensation (in which case the predicate compensation map may be empty) @@ -401,7 +426,7 @@ default ForMatch derived(final boolean isImpossible, !predicateCompensationMap.isEmpty() || resultCompensationFunction.isNeeded() || isNeededForFiltering()); return new ForMatch(isImpossible, this, predicateCompensationMap, matchedQuantifiers, - unmatchedQuantifiers, compensatedAliases, resultCompensationFunction); + unmatchedQuantifiers, compensatedAliases, resultCompensationFunction, groupByMappings); } /** @@ -451,6 +476,9 @@ default boolean isFinalNeeded() { @Nonnull ResultCompensationFunction getResultCompensationFunction(); + @Nonnull + GroupByMappings getGroupByMappings(); + /** * Specific implementation of union-ing two compensations both of type {@link WithSelectCompensation}. * This implementation delegates to its super method if {@code otherCompensation} is not of type @@ -488,6 +516,11 @@ default Compensation union(@Nonnull Compensation otherCompensation) { return impossibleCompensation(); } + final Compensation unionedChildCompensation = getChildCompensation().union(otherWithSelectCompensation.getChildCompensation()); + if (unionedChildCompensation.isImpossible() || !unionedChildCompensation.canBeDeferred()) { + return Compensation.impossibleCompensation(); + } + final ResultCompensationFunction newResultResultCompensationFunction; final var resultCompensationFunction = getResultCompensationFunction(); final var otherResultCompensationFunction = otherWithSelectCompensation.getResultCompensationFunction(); @@ -501,7 +534,8 @@ default Compensation union(@Nonnull Compensation otherCompensation) { newResultResultCompensationFunction = resultCompensationFunction; } - final var otherCompensationMap = otherWithSelectCompensation.getPredicateCompensationMap(); + final var otherCompensationMap = + otherWithSelectCompensation.getPredicateCompensationMap(); final var combinedPredicateMap = new LinkedIdentityMap(); combinedPredicateMap.putAll(getPredicateCompensationMap()); @@ -524,11 +558,6 @@ default Compensation union(@Nonnull Compensation otherCompensation) { combinedPredicateMap.put(otherEntry.getKey(), otherEntry.getValue()); } - final Compensation unionedChildCompensation = getChildCompensation().union(otherWithSelectCompensation.getChildCompensation()); - if (unionedChildCompensation.isImpossible() || !unionedChildCompensation.canBeDeferred()) { - return Compensation.impossibleCompensation(); - } - if (!unionedChildCompensation.isNeededForFiltering() && !newResultResultCompensationFunction.isNeeded() && combinedPredicateMap.isEmpty()) { return Compensation.noCompensation(); @@ -543,7 +572,8 @@ default Compensation union(@Nonnull Compensation otherCompensation) { unionedMatchedQuantifiers, ImmutableSet.of(), Sets.union(getCompensatedAliases(), otherWithSelectCompensation.getCompensatedAliases()), - newResultResultCompensationFunction); + newResultResultCompensationFunction, + GroupByMappings.empty()); } /** @@ -564,6 +594,53 @@ default Compensation intersect(@Nonnull Compensation otherCompensation) { } final var otherWithSelectCompensation = (WithSelectCompensation)otherCompensation; + final Compensation childCompensation = getChildCompensation(); + Verify.verify(!(childCompensation instanceof WithSelectCompensation) || + ((WithSelectCompensation)childCompensation).getUnmatchedForEachQuantifiers().isEmpty()); + + final Compensation intersectedChildCompensation = + childCompensation.intersect(otherWithSelectCompensation.getChildCompensation()); + if (intersectedChildCompensation.isImpossible() || !intersectedChildCompensation.canBeDeferred()) { + return Compensation.impossibleCompensation(); + } + + final var newMatchedGroupingsMapBuilder = ImmutableBiMap.builder(); + final var matchedGroupingsMap = getGroupByMappings().getMatchedGroupingsMap(); + newMatchedGroupingsMapBuilder.putAll(matchedGroupingsMap); + for (final var entry : otherWithSelectCompensation.getGroupByMappings().getMatchedGroupingsMap().entrySet()) { + if (!matchedGroupingsMap.containsKey(entry.getKey())) { + newMatchedGroupingsMapBuilder.put(entry); + } + } + + final var newMatchedAggregatesMapBuilder = ImmutableBiMap.builder(); + final var matchedAggregatesMap = getGroupByMappings().getMatchedAggregatesMap(); + newMatchedAggregatesMapBuilder.putAll(matchedAggregatesMap); + for (final var entry : otherWithSelectCompensation.getGroupByMappings().getMatchedAggregatesMap().entrySet()) { + if (!matchedAggregatesMap.containsKey(entry.getKey())) { + newMatchedAggregatesMapBuilder.put(entry); + } + } + final var newMatchedAggregatesMap = newMatchedAggregatesMapBuilder.build(); + final var newUnmatchedAggregatesMapBuilder = + ImmutableBiMap.builder(); + final var unmatchedAggregateMap = getGroupByMappings().getUnmatchedAggregatesMap(); + for (final var entry : unmatchedAggregateMap.entrySet()) { + if (!newMatchedAggregatesMap.containsKey(entry.getValue())) { + newUnmatchedAggregatesMapBuilder.put(entry); + } + } + for (final var entry : otherWithSelectCompensation.getGroupByMappings().getUnmatchedAggregatesMap().entrySet()) { + if (!newMatchedAggregatesMap.containsKey(entry.getValue()) && + !unmatchedAggregateMap.inverse().containsKey(entry.getValue())) { + newUnmatchedAggregatesMapBuilder.put(entry); + } + } + final var newGroupByMappings = GroupByMappings.of(newMatchedGroupingsMapBuilder.build(), + newMatchedAggregatesMap, newUnmatchedAggregatesMapBuilder.build()); + + boolean isImpossible = false; + final ResultCompensationFunction newResultResultCompensationFunction; final var resultCompensationFunction = getResultCompensationFunction(); final var otherResultCompensationFunction = otherWithSelectCompensation.getResultCompensationFunction(); @@ -574,33 +651,33 @@ default Compensation intersect(@Nonnull Compensation otherCompensation) { Verify.verify(resultCompensationFunction.isNeeded()); Verify.verify(otherResultCompensationFunction.isNeeded()); // pick the one from this side -- it does not matter as both candidates have the same shape - newResultResultCompensationFunction = resultCompensationFunction; + newResultResultCompensationFunction = + resultCompensationFunction.amend(unmatchedAggregateMap, newMatchedAggregatesMap); + isImpossible |= newResultResultCompensationFunction.isImpossible(); } - final var otherCompensationMap = otherWithSelectCompensation.getPredicateCompensationMap(); + final var otherCompensationMap = + otherWithSelectCompensation.getPredicateCompensationMap(); final var combinedPredicateMap = new LinkedIdentityMap(); for (final var entry : getPredicateCompensationMap().entrySet()) { // if the other side does not have compensation for this key, we don't need compensation - if (otherCompensationMap.containsKey(entry.getKey())) { + final var otherPredicateCompensationFunction = otherCompensationMap.get(entry.getKey()); + if (otherPredicateCompensationFunction != null) { // Both compensations have a compensation for this particular predicate which is essentially - // reapplying the predicate. At this point it doesn't matter which side we take as both create - // the same compensating filter. If at any point in the future one data access has a better - // reapplication we need to generate plan variants with either compensation and let the planner - // figure out which one wins. - // We just pick one side here. - combinedPredicateMap.put(entry.getKey(), entry.getValue()); + // reapplying the predicate. Two cases arise: + // 1. Both predicate compensation functions are needed and possible. At this point it doesn't + // matter which side we take as both create the same compensating filter. If at any point in the + // future one data access has a better reapplication we need to generate plan variants with + // either compensation and let the planner figure out which one wins. We just pick one side here. + // 2. Either one or both compensation functions are impossible, but thee intersection is possible. + // We take the compensation function from this side and amend it with the compensation function + // from the other side. + final var newPredicateCompensationFunction = entry.getValue().amend(unmatchedAggregateMap, newMatchedAggregatesMap); + combinedPredicateMap.put(entry.getKey(), newPredicateCompensationFunction); + isImpossible |= newPredicateCompensationFunction.isImpossible(); } } - final Compensation childCompensation = getChildCompensation(); - Verify.verify(!(childCompensation instanceof WithSelectCompensation) || - ((WithSelectCompensation)childCompensation).getUnmatchedForEachQuantifiers().isEmpty()); - - final Compensation intersectedChildCompensation = childCompensation.intersect(otherWithSelectCompensation.getChildCompensation()); - if (intersectedChildCompensation.isImpossible() || !intersectedChildCompensation.canBeDeferred()) { - return Compensation.impossibleCompensation(); - } - if (!intersectedChildCompensation.isNeededForFiltering() && !newResultResultCompensationFunction.isNeeded() && combinedPredicateMap.isEmpty()) { return Compensation.noCompensation(); @@ -620,17 +697,20 @@ default Compensation intersect(@Nonnull Compensation otherCompensation) { final var unmatchedQuantifiers = Sets.intersection(this.getUnmatchedQuantifiers(), otherWithSelectCompensation.getUnmatchedQuantifiers()); final var unmatchedQuantifierAliases = unmatchedQuantifiers.stream().map(Quantifier::getAlias).collect(ImmutableList.toImmutableList()); - final var isImpossible = combinedPredicateMap.keySet() - .stream() - .flatMap(queryPredicate -> queryPredicate.getCorrelatedTo().stream()) - .anyMatch(unmatchedQuantifierAliases::contains); + if (!isImpossible) { + isImpossible = combinedPredicateMap.keySet() + .stream() + .flatMap(queryPredicate -> queryPredicate.getCorrelatedTo().stream()) + .anyMatch(unmatchedQuantifierAliases::contains); + } return intersectedChildCompensation.derived(isImpossible, combinedPredicateMap, intersectedMatchedQuantifiers, intersectedUnmatchedQuantifiers, getCompensatedAliases(), // both compensated aliases must be identical, but too expensive to check - newResultResultCompensationFunction); + newResultResultCompensationFunction, + newGroupByMappings); } } @@ -659,6 +739,8 @@ class ForMatch implements WithSelectCompensation { private final Set compensatedAliases; @Nonnull private final ResultCompensationFunction resultCompensationFunction; + @Nonnull + private final GroupByMappings groupByMappings; @Nonnull private final Supplier> unmatchedForEachQuantifiersSupplier; @@ -669,7 +751,8 @@ private ForMatch(final boolean isImpossible, @Nonnull final Collection matchedQuantifiers, @Nonnull final Collection unmatchedQuantifiers, @Nonnull final Set compensatedAliases, - @Nonnull final ResultCompensationFunction resultCompensationFunction) { + @Nonnull final ResultCompensationFunction resultCompensationFunction, + @Nonnull final GroupByMappings groupByMappings) { this.isImpossible = isImpossible; this.childCompensation = childCompensation; this.predicateCompensationMap = new LinkedIdentityMap<>(); @@ -680,6 +763,7 @@ private ForMatch(final boolean isImpossible, this.unmatchedQuantifiers.addAll(unmatchedQuantifiers); this.compensatedAliases = ImmutableSet.copyOf(compensatedAliases); this.resultCompensationFunction = resultCompensationFunction; + this.groupByMappings = groupByMappings; this.unmatchedForEachQuantifiersSupplier = Suppliers.memoize(this::computeUnmatchedForEachQuantifiers); } @@ -700,7 +784,6 @@ public Set getMatchedQuantifiers() { return matchedQuantifiers; } - @Nonnull @Override public Set getUnmatchedQuantifiers() { @@ -738,12 +821,21 @@ public ResultCompensationFunction getResultCompensationFunction() { return resultCompensationFunction; } + @Nonnull + @Override + public GroupByMappings getGroupByMappings() { + return groupByMappings; + } + /** * When applied to a reference this method returns a {@link RelationalExpression} consuming the * reference passed in that applies additional predicates as expressed by the predicate compensation map. * * @param memoizer the memoizer for new {@link Reference}s * @param relationalExpression root of graph to apply compensation to + * @param matchedToRealizedTranslationMapFunction a function that given an alias for the quantifier over the + * realized compensation, returns a {@link TranslationMap} that is then used to translate + * from {@link QueryPredicate}s and {@link Value}s using matched aliases to the realized alias * * @return a new relational expression that corrects the result of {@code reference} by applying appropriate * filters and/or transformations @@ -751,21 +843,25 @@ public ResultCompensationFunction getResultCompensationFunction() { @Nonnull @Override public RelationalExpression apply(@Nonnull final Memoizer memoizer, - @Nonnull RelationalExpression relationalExpression) { + @Nonnull RelationalExpression relationalExpression, + @Nonnull final Function matchedToRealizedTranslationMapFunction) { Verify.verify(!isImpossible()); // apply the child as needed if (childCompensation.isNeededForFiltering()) { - relationalExpression = childCompensation.apply(memoizer, relationalExpression); + relationalExpression = childCompensation.apply(memoizer, relationalExpression, + matchedToRealizedTranslationMapFunction); } final var matchedForEachAlias = getMatchedForEachAlias(); + final var matchedToRealizedTranslationMap = matchedToRealizedTranslationMapFunction.apply(matchedForEachAlias); final var compensatedPredicates = new LinkedIdentitySet(); final var injectCompensationFunctions = predicateCompensationMap.values(); for (final var predicateCompensationFunction : injectCompensationFunctions) { // TODO construct a translation map using matchedForEachAlias as target - compensatedPredicates.addAll(predicateCompensationFunction.applyCompensationForPredicate(matchedForEachAlias)); + compensatedPredicates.addAll( + predicateCompensationFunction.applyCompensationForPredicate(matchedToRealizedTranslationMap)); } final var compensatedPredicatesCorrelatedTo = @@ -864,13 +960,16 @@ private CorrelationIdentifier getMatchedForEachAlias() { @Nonnull @Override public RelationalExpression applyFinal(@Nonnull final Memoizer memoizer, - @Nonnull RelationalExpression relationalExpression) { + @Nonnull RelationalExpression relationalExpression, + @Nonnull Function matchedToRealizedTranslationMapFunction) { Verify.verify(!isImpossible()); Verify.verify(resultCompensationFunction.isNeeded()); final var matchedForEachAlias = getMatchedForEachAlias(); - final var resultValue = resultCompensationFunction.applyCompensationForResult(matchedForEachAlias); + final var resultValue = + resultCompensationFunction.applyCompensationForResult( + matchedToRealizedTranslationMapFunction.apply(matchedForEachAlias)); // // At this point we definitely need a new SELECT expression. @@ -884,5 +983,22 @@ public RelationalExpression applyFinal(@Nonnull final Memoizer memoizer, .build() .buildSelectWithResultValue(resultValue); } + + @Nonnull + @Override + public String toString() { + final var result = new StringBuilder(); + if (isNeeded()) { + result.append("needed; "); + } else { + result.append("not needed; "); + } + if (isImpossible()) { + result.append("impossible"); + } else { + result.append("possible"); + } + return result.toString(); + } } } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/CorrelationIdentifier.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/CorrelationIdentifier.java index 72dc45bcb8..26604b4b0d 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/CorrelationIdentifier.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/CorrelationIdentifier.java @@ -61,8 +61,8 @@ public static CorrelationIdentifier of(@Nonnull final String id) { * @return a new unique {@link CorrelationIdentifier} */ @Nonnull - public static CorrelationIdentifier uniqueID() { - return uniqueID(CorrelationIdentifier.class); + public static CorrelationIdentifier uniqueId() { + return uniqueId(CorrelationIdentifier.class); } /** @@ -73,8 +73,8 @@ public static CorrelationIdentifier uniqueID() { * @return a new unique {@link CorrelationIdentifier} */ @Nonnull - public static CorrelationIdentifier uniqueID(@Nonnull final Class clazz) { - return uniqueID(clazz, clazz.getSimpleName().substring(0, 1).toLowerCase(Locale.ROOT)); + public static CorrelationIdentifier uniqueId(@Nonnull final Class clazz) { + return uniqueId(clazz, clazz.getSimpleName().substring(0, 1).toLowerCase(Locale.ROOT)); } /** @@ -86,7 +86,7 @@ public static CorrelationIdentifier uniqueID(@Nonnull final Class clazz) { * @return a new unique {@link CorrelationIdentifier} */ @Nonnull - public static CorrelationIdentifier uniqueID(@Nonnull final Class clazz, @Nonnull final String prefix) { + public static CorrelationIdentifier uniqueId(@Nonnull final Class clazz, @Nonnull final String prefix) { final CorrelationIdentifier id = Debugger.getIndexOptional(clazz) .map(i -> CorrelationIdentifier.of(prefix + i)) diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/GroupByMappings.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/GroupByMappings.java new file mode 100644 index 0000000000..d5999287d0 --- /dev/null +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/GroupByMappings.java @@ -0,0 +1,73 @@ +/* + * GroupByMappings.java + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2015-2025 Apple Inc. and the FoundationDB project authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.apple.foundationdb.record.query.plan.cascades; + +import com.apple.foundationdb.record.query.plan.cascades.values.Value; +import com.google.common.collect.BiMap; +import com.google.common.collect.ImmutableBiMap; + +import javax.annotation.Nonnull; + +public class GroupByMappings { + @Nonnull + private final BiMap matchedGroupingsMap; + @Nonnull + private final BiMap matchedAggregatesMap; + + @Nonnull + private final BiMap unmatchedAggregatesMap; + + private GroupByMappings(@Nonnull final BiMap matchedGroupingsMap, + @Nonnull final BiMap matchedAggregatesMap, + @Nonnull final BiMap unmatchedAggregatesMap) { + this.matchedGroupingsMap = matchedGroupingsMap; + this.matchedAggregatesMap = matchedAggregatesMap; + this.unmatchedAggregatesMap = unmatchedAggregatesMap; + } + + @Nonnull + public BiMap getMatchedGroupingsMap() { + return matchedGroupingsMap; + } + + @Nonnull + public BiMap getMatchedAggregatesMap() { + return matchedAggregatesMap; + } + + @Nonnull + public BiMap getUnmatchedAggregatesMap() { + return unmatchedAggregatesMap; + } + + public static GroupByMappings empty() { + return of(ImmutableBiMap.of(), ImmutableBiMap.of(), ImmutableBiMap.of()); + } + + @Nonnull + public static GroupByMappings of(@Nonnull final BiMap matchedGroupingsMap, + @Nonnull final BiMap matchedAggregateMap, + @Nonnull final BiMap unmatchedAggregatesMap) { + return new GroupByMappings(ImmutableBiMap.copyOf(matchedGroupingsMap), + ImmutableBiMap.copyOf(matchedAggregateMap), + ImmutableBiMap.copyOf(unmatchedAggregatesMap)); + } +} diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/KeyExpressionExpansionVisitor.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/KeyExpressionExpansionVisitor.java index f27513a3b6..bba18aff6f 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/KeyExpressionExpansionVisitor.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/KeyExpressionExpansionVisitor.java @@ -404,7 +404,7 @@ public GraphExpansion visitExpression(@Nonnull final ListKeyExpression listKeyEx * a unique alias based on an increasing number that is human-readable otherwise. */ protected static CorrelationIdentifier newParameterAlias() { - return CorrelationIdentifier.uniqueID(PredicateWithValueAndRanges.class); + return CorrelationIdentifier.uniqueId(PredicateWithValueAndRanges.class); } /** diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/MatchCandidate.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/MatchCandidate.java index 8d7fbcef2e..4990e88a93 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/MatchCandidate.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/MatchCandidate.java @@ -37,6 +37,7 @@ import com.apple.foundationdb.record.query.plan.cascades.typing.Type; import com.apple.foundationdb.record.query.plan.cascades.values.Value; import com.apple.foundationdb.record.query.plan.cascades.values.simplification.OrderingValueComputationRuleSet; +import com.apple.foundationdb.record.query.plan.cascades.values.translation.PullUp; import com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan; import com.apple.foundationdb.record.util.pair.NonnullPair; import com.google.common.base.Verify; @@ -182,6 +183,13 @@ Ordering computeOrderingFromScanComparisons(@Nonnull ScanComparisons scanCompari boolean isReverse, boolean isDistinct); + @Nullable + default PullUp.UnificationPullUp prepareForUnification(@Nonnull final PartialMatch partialMatch, + @Nonnull final CorrelationIdentifier topAlias, + @Nonnull final CorrelationIdentifier topCandidateAlias) { + return null; + } + /** * Creates a {@link RecordQueryPlan} that represents a scan over the materialized candidate data. * @param partialMatch the match to be used diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/MatchInfo.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/MatchInfo.java index ed5c0dc87d..17b6ba8842 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/MatchInfo.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/MatchInfo.java @@ -20,15 +20,19 @@ package com.apple.foundationdb.record.query.plan.cascades; +import com.apple.foundationdb.record.EvaluationContext; import com.apple.foundationdb.record.query.plan.QueryPlanConstraint; import com.apple.foundationdb.record.query.plan.cascades.OrderingPart.MatchedOrderingPart; import com.apple.foundationdb.record.query.plan.cascades.PredicateMultiMap.PredicateMapping; import com.apple.foundationdb.record.query.plan.cascades.expressions.RelationalExpression; import com.apple.foundationdb.record.query.plan.cascades.predicates.QueryPredicate; +import com.apple.foundationdb.record.query.plan.cascades.values.Value; import com.apple.foundationdb.record.query.plan.cascades.values.translation.MaxMatchMap; import com.apple.foundationdb.record.query.plan.cascades.values.translation.PullUp; import com.google.common.base.Equivalence; import com.google.common.base.Suppliers; +import com.google.common.collect.BiMap; +import com.google.common.collect.ImmutableBiMap; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Iterables; @@ -36,6 +40,7 @@ import com.google.common.collect.Sets; import javax.annotation.Nonnull; +import javax.annotation.Nullable; import java.util.Collection; import java.util.List; import java.util.Map; @@ -68,11 +73,59 @@ default boolean isRegular() { Map collectPulledUpPredicateMappings(@Nonnull RelationalExpression candidateExpression, @Nonnull Set interestingPredicates); + @Nonnull + GroupByMappings getGroupByMappings(); + @Nonnull default AdjustedBuilder adjustedBuilder() { return new AdjustedBuilder(this, getMatchedOrderingParts(), - getMaxMatchMap()); + getMaxMatchMap(), + getGroupByMappings()); + } + + @Nonnull + default GroupByMappings adjustGroupByMappings(@Nonnull final Quantifier candidateQuantifier) { + return adjustGroupByMappings(candidateQuantifier.getAlias(), candidateQuantifier.getRangesOver().get()); + } + + @Nonnull + default GroupByMappings adjustGroupByMappings(@Nonnull final CorrelationIdentifier candidateAlias, + @Nonnull final RelationalExpression candidateLowerExpression) { + final var groupByMappings = getGroupByMappings(); + + final var matchedGroupingsMap = groupByMappings.getMatchedGroupingsMap(); + final var adjustedMatchedGroupingsMap = + adjustMatchedValueMap(candidateAlias, candidateLowerExpression, matchedGroupingsMap); + final var matchedAggregatesMap = groupByMappings.getMatchedAggregatesMap(); + final var adjustedMatchedAggregatesMap = + adjustMatchedValueMap(candidateAlias, candidateLowerExpression, matchedAggregatesMap); + return GroupByMappings.of(adjustedMatchedGroupingsMap, adjustedMatchedAggregatesMap, + groupByMappings.getUnmatchedAggregatesMap()); + } + + @Nonnull + static ImmutableBiMap adjustMatchedValueMap(@Nonnull final CorrelationIdentifier candidateAlias, + @Nonnull final RelationalExpression candidateLowerExpression, + @Nonnull final Map matchedValueMap) { + final var adjustedMatchedAggregateMapBuilder = ImmutableBiMap.builder(); + for (final var matchedAggregateMapEntry : matchedValueMap.entrySet()) { + final var queryAggregateValue = matchedAggregateMapEntry.getKey(); + final var candidateAggregateValue = matchedAggregateMapEntry.getValue(); + final var candidateLowerResultValue = candidateLowerExpression.getResultValue(); + final var candidatePullUpMap = + candidateLowerResultValue.pullUp(ImmutableList.of(candidateAggregateValue), + EvaluationContext.empty(), + AliasMap.emptyMap(), + Sets.difference(candidateAggregateValue.getCorrelatedToWithoutChildren(), + candidateLowerExpression.getCorrelatedTo()), + candidateAlias); + final var pulledUpCandidateAggregateValue = candidatePullUpMap.get(candidateAggregateValue); + if (pulledUpCandidateAggregateValue != null) { + adjustedMatchedAggregateMapBuilder.put(queryAggregateValue, pulledUpCandidateAggregateValue); + } + } + return adjustedMatchedAggregateMapBuilder.build(); } /** @@ -113,6 +166,12 @@ class RegularMatchInfo implements MatchInfo { @Nonnull private final MaxMatchMap maxMatchMap; + @Nonnull + private final GroupByMappings groupByMappings; + + @Nullable + private final List rollUpToGroupingValues; + /** * Field to hold additional query plan constraints that need to be imposed on the potentially realized match. */ @@ -125,6 +184,8 @@ private RegularMatchInfo(@Nonnull final Map matchedOrderingParts, @Nonnull final MaxMatchMap maxMatchMap, + @Nonnull final GroupByMappings groupByMappings, + @Nullable final List rollUpToGroupingValues, @Nonnull final QueryPlanConstraint additionalPlanConstraint) { this.parameterBindingMap = ImmutableMap.copyOf(parameterBindingMap); this.bindingAliasMap = bindingAliasMap; @@ -138,6 +199,9 @@ private RegularMatchInfo(@Nonnull final Map collectPulledUpPredicateMappings(@N for (final var childPartialMatchEntry : partialMatchMap.entrySet()) { final var queryQuantifier = childPartialMatchEntry.getKey().get(); final PartialMatch childPartialMatch = Objects.requireNonNull(childPartialMatchEntry.getValue().get()); - final var nestingAlias = + final var candidateAlias = Objects.requireNonNull(bindingAliasMap.getTarget(queryQuantifier.getAlias())); - resultsMap.putAll(childPartialMatch.pullUpToParent(nestingAlias, interestingPredicates)); + resultsMap.putAll(childPartialMatch.pullUpToParent(candidateAlias, interestingPredicates)); } return resultsMap; } @@ -208,6 +272,17 @@ public MaxMatchMap getMaxMatchMap() { return maxMatchMap; } + @Nonnull + @Override + public GroupByMappings getGroupByMappings() { + return groupByMappings; + } + + @Nullable + public List getRollUpToGroupingValues() { + return rollUpToGroupingValues; + } + @Nonnull public QueryPlanConstraint getAdditionalPlanConstraint() { return additionalPlanConstraint; @@ -237,7 +312,7 @@ private QueryPlanConstraint computeConstraints() { ImmutableList.builder() .addAll(constraints) .addAll(childConstraints) - .add(additionalPlanConstraint) + .add(getAdditionalPlanConstraint()) .build(); return QueryPlanConstraint.composeConstraints(allConstraints); } @@ -247,7 +322,8 @@ public static Optional tryFromMatchMap(@Nonnull final AliasMap bindin @Nonnull final IdentityBiMap partialMatchMap, @Nonnull final MaxMatchMap maxMatchMap) { return tryMerge(bindingAliasMap, partialMatchMap, ImmutableMap.of(), PredicateMap.empty(), - maxMatchMap, maxMatchMap.getQueryPlanConstraint()); + maxMatchMap, GroupByMappings.empty(), null, + maxMatchMap.getQueryPlanConstraint()); } @Nonnull @@ -256,6 +332,8 @@ public static Optional tryMerge(@Nonnull final AliasMap bindingAliasM @Nonnull final Map parameterBindingMap, @Nonnull final PredicateMultiMap predicateMap, @Nonnull final MaxMatchMap maxMatchMap, + @Nonnull final GroupByMappings additionalGroupByMappings, + @Nullable final List rollUpToGroupingValues, @Nonnull final QueryPlanConstraint additionalPlanConstraint) { final var parameterMapsBuilder = ImmutableList.>builder(); final var matchInfos = PartialMatch.matchInfosFromMap(partialMatchMap); @@ -281,6 +359,35 @@ public static Optional tryMerge(@Nonnull final AliasMap bindingAliasM final Optional> mergedParameterBindingsOptional = tryMergeParameterBindings(parameterMapsBuilder.build()); + final var matchedAggregateValueMap = + pullUpAndMergeGroupByMappings(bindingAliasMap, partialMatchMap, + additionalGroupByMappings); + + final List resolvedRollUpToGroupingValues; + if (rollUpToGroupingValues != null) { + for (final var regularQuantifier : regularQuantifiers) { + final var partialMatch = Objects.requireNonNull(partialMatchMap.getUnwrapped(regularQuantifier)); + if (partialMatch.getRegularMatchInfo().getRollUpToGroupingValues() != null) { + return Optional.empty(); + } + } + resolvedRollUpToGroupingValues = rollUpToGroupingValues; + } else { + List onlyRollUpToGroupingValues = null; + for (final var regularQuantifier : regularQuantifiers) { + final var partialMatch = Objects.requireNonNull(partialMatchMap.getUnwrapped(regularQuantifier)); + final var currentRollUpToGroupingValues = partialMatch.getRegularMatchInfo().getRollUpToGroupingValues(); + if (currentRollUpToGroupingValues != null) { + if (onlyRollUpToGroupingValues == null) { + onlyRollUpToGroupingValues = currentRollUpToGroupingValues; + } else { + return Optional.empty(); + } + } + } + resolvedRollUpToGroupingValues = onlyRollUpToGroupingValues; + } + return mergedParameterBindingsOptional .map(mergedParameterBindings -> new RegularMatchInfo(mergedParameterBindings, bindingAliasMap, @@ -288,6 +395,8 @@ public static Optional tryMerge(@Nonnull final AliasMap bindingAliasM predicateMap, orderingParts, maxMatchMap, + matchedAggregateValueMap, + resolvedRollUpToGroupingValues, additionalPlanConstraint)); } @@ -312,6 +421,136 @@ public static Optional> tryMergePara return Optional.of(resultMap); } + + @Nonnull + private static GroupByMappings pullUpAndMergeGroupByMappings(@Nonnull final AliasMap bindingAliasMap, + @Nonnull final IdentityBiMap partialMatchMap, + @Nonnull final GroupByMappings additionalGroupByMappings) { + final var matchedGroupingsMapBuilder = ImmutableBiMap.builder(); + matchedGroupingsMapBuilder.putAll(additionalGroupByMappings.getMatchedGroupingsMap()); + final var matchedAggregateMapBuilder = ImmutableBiMap.builder(); + matchedAggregateMapBuilder.putAll(additionalGroupByMappings.getMatchedAggregatesMap()); + final var unatchedAggregateMapBuilder = ImmutableBiMap.builder(); + unatchedAggregateMapBuilder.putAll(additionalGroupByMappings.getUnmatchedAggregatesMap()); + for (final var partialMatchMapEntry : partialMatchMap.entrySet()) { + final var partialMatchMapEntryKey = partialMatchMapEntry.getKey(); + final var quantifier = partialMatchMapEntryKey.get(); + if (quantifier instanceof Quantifier.ForEach) { + final var partialMatch = partialMatchMapEntry.getValue().get(); + final var pulledUpGroupByMappings = + pullUpGroupByMappings(partialMatch, + quantifier.getAlias(), + Objects.requireNonNull(bindingAliasMap.getTarget(quantifier.getAlias()))); + + matchedGroupingsMapBuilder.putAll(pulledUpGroupByMappings.getMatchedGroupingsMap()); + matchedAggregateMapBuilder.putAll(pulledUpGroupByMappings.getMatchedAggregatesMap()); + unatchedAggregateMapBuilder.putAll(pulledUpGroupByMappings.getUnmatchedAggregatesMap()); + } + } + return GroupByMappings.of(matchedGroupingsMapBuilder.build(), + matchedAggregateMapBuilder.build(), unatchedAggregateMapBuilder.build()); + } + + @Nonnull + public static GroupByMappings pullUpAggregateCandidateMappings(@Nonnull final PartialMatch partialMatch, + @Nonnull final PullUp pullUp) { + final var matchInfo = partialMatch.getMatchInfo(); + final var groupByMappings = matchInfo.getGroupByMappings(); + + final var matchedGroupingsMapBuilder = ImmutableBiMap.builder(); + for (final var matchedGroupingsMapEntry : groupByMappings.getMatchedGroupingsMap().entrySet()) { + final var candidateGroupingValue = matchedGroupingsMapEntry.getValue(); + final var pulledUpCandidateGroupingValueOptional = + pullUp.pullUpCandidateValueMaybe(candidateGroupingValue); + pulledUpCandidateGroupingValueOptional.ifPresent( + value -> matchedGroupingsMapBuilder.put(matchedGroupingsMapEntry.getKey(), value)); + } + + final var matchedAggregatesMapBuilder = ImmutableBiMap.builder(); + for (final var matchedAggregatesMapEntry : groupByMappings.getMatchedAggregatesMap().entrySet()) { + final var candidateAggregateValue = matchedAggregatesMapEntry.getValue(); + final var pulledUpCandidateAggregateValueOptional = + pullUp.pullUpCandidateValueMaybe(candidateAggregateValue); + pulledUpCandidateAggregateValueOptional.ifPresent( + value -> matchedAggregatesMapBuilder.put(matchedAggregatesMapEntry.getKey(), value)); + } + + return GroupByMappings.of(matchedGroupingsMapBuilder.build(), + matchedAggregatesMapBuilder.build(), groupByMappings.getUnmatchedAggregatesMap()); + } + + @Nonnull + public static GroupByMappings pullUpGroupByMappings(@Nonnull final PartialMatch partialMatch, + @Nonnull final CorrelationIdentifier queryAlias, + @Nonnull final CorrelationIdentifier candidateAlias) { + final var matchInfo = partialMatch.getMatchInfo(); + final var queryExpression = partialMatch.getQueryExpression(); + final var resultValue = queryExpression.getResultValue(); + final var groupByMappings = matchInfo.getGroupByMappings(); + final var constantAliases = Sets.difference(resultValue.getCorrelatedTo(), + queryExpression.getCorrelatedTo()); + final var matchedGroupingsMap = + pullUpMatchedValueMap(partialMatch, groupByMappings.getMatchedGroupingsMap(), resultValue, + queryAlias, candidateAlias, constantAliases); + + final var matchedAggregatesMap = + pullUpMatchedValueMap(partialMatch, groupByMappings.getMatchedAggregatesMap(), resultValue, + queryAlias, candidateAlias, constantAliases); + + final var unmatchedAggregateMapBuilder = ImmutableBiMap.builder(); + for (final var unmatchedAggregateMapEntry : groupByMappings.getUnmatchedAggregatesMap().entrySet()) { + final var queryAggregateValue = unmatchedAggregateMapEntry.getValue(); + final var pullUpMap = + resultValue.pullUp(ImmutableList.of(queryAggregateValue), EvaluationContext.empty(), + AliasMap.emptyMap(), + Sets.difference(queryAggregateValue.getCorrelatedToWithoutChildren(), + queryExpression.getCorrelatedTo()), queryAlias); + final var pulledUpQueryAggregateValue = pullUpMap.get(queryAggregateValue); + if (pulledUpQueryAggregateValue == null) { + return GroupByMappings.empty(); + } + unmatchedAggregateMapBuilder.put(unmatchedAggregateMapEntry.getKey(), pulledUpQueryAggregateValue); + } + + return GroupByMappings.of(matchedGroupingsMap, matchedAggregatesMap, unmatchedAggregateMapBuilder.build()); + } + + private static ImmutableBiMap pullUpMatchedValueMap(@Nonnull final PartialMatch partialMatch, + @Nonnull final BiMap matchedValueMap, + @Nonnull final Value queryResultValue, + @Nonnull final CorrelationIdentifier queryAlias, + @Nonnull final CorrelationIdentifier candidateAlias, + @Nonnull final Set constantAliases) { + final var matchedAggregatesMapBuilder = ImmutableBiMap.builder(); + for (final var entry : matchedValueMap.entrySet()) { + final var queryValue = entry.getKey(); + final var pullUpMap = + queryResultValue.pullUp(ImmutableList.of(queryValue), EvaluationContext.empty(), + AliasMap.emptyMap(), constantAliases, queryAlias); + final Value pulledUpQueryValue = pullUpMap.get(queryValue); + if (pulledUpQueryValue == null) { + continue; + } + + final var candidateAggregateValue = entry.getValue(); + final var candidateLowerExpression = + Iterables.getOnlyElement(partialMatch.getCandidateRef().getAllMemberExpressions()); + final var candidateLowerResultValue = candidateLowerExpression.getResultValue(); + final var candidatePullUpMap = + candidateLowerResultValue.pullUp(ImmutableList.of(candidateAggregateValue), + EvaluationContext.empty(), + AliasMap.emptyMap(), + Sets.difference(candidateAggregateValue.getCorrelatedToWithoutChildren(), + candidateLowerExpression.getCorrelatedTo()), + candidateAlias); + final var pulledUpCandidateAggregateValue = candidatePullUpMap.get(candidateAggregateValue); + if (pulledUpCandidateAggregateValue == null) { + continue; + } + matchedAggregatesMapBuilder.put(pulledUpQueryValue, pulledUpCandidateAggregateValue); + } + return matchedAggregatesMapBuilder.build(); + } } /** @@ -346,12 +585,17 @@ class AdjustedMatchInfo implements MatchInfo { @Nonnull private final MaxMatchMap maxMatchMap; - public AdjustedMatchInfo(@Nonnull final MatchInfo underlying, - @Nonnull final List matchedOrderingParts, - @Nonnull final MaxMatchMap maxMatchMap) { + @Nonnull + private final GroupByMappings groupByMappings; + + private AdjustedMatchInfo(@Nonnull final MatchInfo underlying, + @Nonnull final List matchedOrderingParts, + @Nonnull final MaxMatchMap maxMatchMap, + @Nonnull final GroupByMappings groupByMappings) { this.underlying = underlying; this.matchedOrderingParts = matchedOrderingParts; this.maxMatchMap = maxMatchMap; + this.groupByMappings = groupByMappings; } @Nonnull @@ -371,6 +615,12 @@ public MaxMatchMap getMaxMatchMap() { return maxMatchMap; } + @Nonnull + @Override + public GroupByMappings getGroupByMappings() { + return groupByMappings; + } + @Override public boolean isAdjusted() { return true; @@ -403,7 +653,7 @@ public Map collectPulledUpPredicateMappings(@N final var originalQueryPredicate = childPredicateMappingEntry.getKey(); final var childPredicateMapping = childPredicateMappingEntry.getValue(); final var pulledUpPredicateOptional = - childPredicateMapping.getTranslatedQueryPredicate().replaceValuesMaybe(pullUp::pullUpMaybe); + childPredicateMapping.getTranslatedQueryPredicate().replaceValuesMaybe(pullUp::pullUpValueMaybe); pulledUpPredicateOptional.ifPresent(queryPredicate -> resultsMap.put(originalQueryPredicate, childPredicateMapping.withTranslatedQueryPredicate(queryPredicate))); @@ -431,12 +681,17 @@ class AdjustedBuilder { @Nonnull private MaxMatchMap maxMatchMap; + @Nonnull + private GroupByMappings groupByMappings; + private AdjustedBuilder(@Nonnull final MatchInfo underlying, @Nonnull final List matchedOrderingParts, - @Nonnull final MaxMatchMap maxMatchMap) { + @Nonnull final MaxMatchMap maxMatchMap, + @Nonnull final GroupByMappings groupByMappings) { this.underlying = underlying; this.matchedOrderingParts = matchedOrderingParts; this.maxMatchMap = maxMatchMap; + this.groupByMappings = groupByMappings; } @Nonnull @@ -449,22 +704,35 @@ public AdjustedBuilder setMatchedOrderingParts(@Nonnull final List pullUpToParent(@Nonnull final CorrelationIdentifier nestingAlias, + public Map pullUpToParent(@Nonnull final CorrelationIdentifier candidateAlias, @Nonnull final Predicate predicateFilter) { final var interestingPredicates = getAccumulatedPredicateMap().getMap() @@ -313,22 +314,22 @@ public Map pullUpToParent(@Nonnull final Corre .filter(predicateFilter) .collect(LinkedIdentitySet.toLinkedIdentitySet()); - return pullUpToParent(nestingAlias, interestingPredicates); + return pullUpToParent(candidateAlias, interestingPredicates); } @Nonnull - public Map pullUpToParent(@Nonnull final CorrelationIdentifier nestingAlias, + public Map pullUpToParent(@Nonnull final CorrelationIdentifier candidateAlias, @Nonnull final Set interestingPredicates) { final var childPredicateMappings = getPulledUpPredicateMappings(interestingPredicates); final var resultsMap = new LinkedIdentityMap(); - final var pullUp = pullUp(nestingAlias); + final var pullUp = pullUp(candidateAlias); for (final var childPredicateMappingEntry : childPredicateMappings.entrySet()) { final var originalQueryPredicate = childPredicateMappingEntry.getKey(); final var childPredicateMapping = childPredicateMappingEntry.getValue(); final var pulledUpPredicateOptional = - childPredicateMapping.getTranslatedQueryPredicate().replaceValuesMaybe(pullUp::pullUpMaybe); + childPredicateMapping.getTranslatedQueryPredicate().replaceValuesMaybe(pullUp::pullUpValueMaybe); pulledUpPredicateOptional.ifPresent(queryPredicate -> resultsMap.put(originalQueryPredicate, childPredicateMapping.withTranslatedQueryPredicate(queryPredicate))); @@ -336,18 +337,6 @@ public Map pullUpToParent(@Nonnull final Corre return resultsMap; } - @Nonnull - public Map getPulledUpPredicateMappings(@Nonnull final Predicate predicateFilter) { - final var interestingPredicates = - getAccumulatedPredicateMap().getMap() - .keySet() - .stream() - .filter(predicateFilter) - .collect(LinkedIdentitySet.toLinkedIdentitySet()); - - return getPulledUpPredicateMappings(interestingPredicates); - } - @Nonnull public Map getPulledUpPredicateMappings(@Nonnull final Set interestingPredicates) { final var resultMap = new LinkedIdentityMap(); @@ -380,38 +369,55 @@ public Map getPulledUpPredicateMappings(@Nonnu } @Nonnull - public Compensation compensateCompleteMatch() { - return queryExpression.compensate(this, getBoundParameterPrefixMap(), null, Quantifier.uniqueID()); + public Compensation compensateCompleteMatch(@Nonnull final CorrelationIdentifier candidateTopAlias) { + return compensateCompleteMatch(null, candidateTopAlias); + } + + @Nonnull + public Compensation compensateCompleteMatch(@Nullable PullUp unificationPullUp, + @Nonnull final CorrelationIdentifier candidateTopAlias) { + return queryExpression.compensate(this, getBoundParameterPrefixMap(), unificationPullUp, candidateTopAlias); } @Nonnull public Compensation compensate(@Nonnull final Map boundParameterPrefixMap, @Nonnull final PullUp pullUp, - @Nonnull final CorrelationIdentifier nestingAlias) { - return queryExpression.compensate(this, boundParameterPrefixMap, pullUp, nestingAlias); + @Nonnull final CorrelationIdentifier candidateAlias) { + return queryExpression.compensate(this, boundParameterPrefixMap, pullUp, candidateAlias); } @Nonnull public Compensation compensateExistential(@Nonnull final Map boundParameterPrefixMap) { - return queryExpression.compensate(this, boundParameterPrefixMap, null, Quantifier.uniqueID()); + return queryExpression.compensate(this, boundParameterPrefixMap, null, Quantifier.uniqueId()); + } + + @Nullable + public PullUp.UnificationPullUp prepareForUnification(@Nonnull final CorrelationIdentifier topAlias, + @Nonnull final CorrelationIdentifier topCandidateAlias) { + return getMatchCandidate().prepareForUnification(this, topAlias, topCandidateAlias); } @Nonnull - public PullUp pullUp(@Nonnull final CorrelationIdentifier nestingAlias) { - return nestPullUp(null, nestingAlias); + public PullUp pullUp(@Nonnull final CorrelationIdentifier candidateAlias) { + return Objects.requireNonNull(nestPullUp(null, candidateAlias).getRight()); } @Nonnull - public PullUp nestPullUp(@Nullable final PullUp pullUp, @Nonnull final CorrelationIdentifier nestingAlias) { + public Pair nestPullUp(@Nullable final PullUp pullUp, + @Nonnull final CorrelationIdentifier candidateAlias) { + PullUp rootOfMatchPullUp = null; var currentMatchInfo = getMatchInfo(); var currentCandidateRef = candidateRef; var currentPullUp = pullUp; - var currentNestingAlias = nestingAlias; + var currentCandidateAlias = candidateAlias; while (true) { final var nestingVisitor = - PullUp.visitor(currentPullUp, currentNestingAlias); + PullUp.visitor(currentPullUp, currentCandidateAlias); final var currentCandidateExpression = currentCandidateRef.get(); currentPullUp = nestingVisitor.visit(currentCandidateRef.get()); + if (!(pullUp instanceof PullUp.MatchPullUp) && rootOfMatchPullUp == null) { + rootOfMatchPullUp = currentPullUp; + } if (!currentMatchInfo.isAdjusted()) { break; } @@ -419,12 +425,12 @@ public PullUp nestPullUp(@Nullable final PullUp pullUp, @Nonnull final Correlati final List currentQuantifiers = currentCandidateExpression.getQuantifiers(); Verify.verify(currentQuantifiers.size() == 1); final Quantifier currentQuantifier = currentQuantifiers.get(0); - currentNestingAlias = currentQuantifier.getAlias(); + currentCandidateAlias = currentQuantifier.getAlias(); currentCandidateRef = currentQuantifier.getRangesOver(); currentMatchInfo = ((MatchInfo.AdjustedMatchInfo)currentMatchInfo).getUnderlying(); } - return currentPullUp; + return Pair.of(rootOfMatchPullUp, currentPullUp); } /** diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/PlanningRuleSet.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/PlanningRuleSet.java index 23f92b270a..3eb333f3f7 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/PlanningRuleSet.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/PlanningRuleSet.java @@ -24,7 +24,8 @@ import com.apple.foundationdb.annotation.SpotBugsSuppressWarnings; import com.apple.foundationdb.record.query.plan.cascades.expressions.RelationalExpression; import com.apple.foundationdb.record.query.plan.cascades.rules.AdjustMatchRule; -import com.apple.foundationdb.record.query.plan.cascades.rules.DataAccessRule; +import com.apple.foundationdb.record.query.plan.cascades.rules.AggregateDataAccessRule; +import com.apple.foundationdb.record.query.plan.cascades.rules.WithPrimaryKeyDataAccessRule; import com.apple.foundationdb.record.query.plan.cascades.rules.ImplementDeleteRule; import com.apple.foundationdb.record.query.plan.cascades.rules.ImplementDistinctRule; import com.apple.foundationdb.record.query.plan.cascades.rules.ImplementDistinctUnionRule; @@ -81,7 +82,6 @@ import com.apple.foundationdb.record.query.plan.cascades.rules.PushTypeFilterBelowFilterRule; import com.apple.foundationdb.record.query.plan.cascades.rules.RemoveProjectionRule; import com.apple.foundationdb.record.query.plan.cascades.rules.RemoveSortRule; -import com.apple.foundationdb.record.query.plan.cascades.rules.SelectDataAccessRule; import com.apple.foundationdb.record.query.plan.cascades.rules.SplitSelectExtractIndependentQuantifiersRule; import com.apple.foundationdb.record.query.plan.plans.RecordQueryInParameterJoinPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryInUnionOnValuesPlan; @@ -182,8 +182,8 @@ public class PlanningRuleSet extends CascadesRuleSet { new AdjustMatchRule() ); private static final Set> MATCH_PARTITION_RULES = ImmutableSet.of( - new DataAccessRule(), - new SelectDataAccessRule(), + new WithPrimaryKeyDataAccessRule(), + new AggregateDataAccessRule(), new PredicateToLogicalUnionRule() ); private static final Set> ALL_RULES = diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/PredicateMultiMap.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/PredicateMultiMap.java index bbcbca3ee1..8ed66e8ef7 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/PredicateMultiMap.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/PredicateMultiMap.java @@ -20,11 +20,19 @@ package com.apple.foundationdb.record.query.plan.cascades; +import com.apple.foundationdb.record.query.expressions.Comparisons; import com.apple.foundationdb.record.query.plan.QueryPlanConstraint; +import com.apple.foundationdb.record.query.plan.cascades.expressions.GroupByExpression; +import com.apple.foundationdb.record.query.plan.cascades.predicates.ExistsPredicate; +import com.apple.foundationdb.record.query.plan.cascades.predicates.PredicateWithComparisons; +import com.apple.foundationdb.record.query.plan.cascades.predicates.PredicateWithValue; import com.apple.foundationdb.record.query.plan.cascades.predicates.QueryPredicate; import com.apple.foundationdb.record.query.plan.cascades.values.Value; import com.apple.foundationdb.record.query.plan.cascades.values.translation.PullUp; import com.apple.foundationdb.record.query.plan.cascades.values.translation.TranslationMap; +import com.google.common.base.Verify; +import com.google.common.collect.BiMap; +import com.google.common.collect.ImmutableList; import com.google.common.collect.Multimaps; import com.google.common.collect.SetMultimap; import com.google.common.collect.Sets; @@ -32,11 +40,12 @@ import javax.annotation.Nonnull; import java.util.Collection; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; import java.util.Set; -import java.util.function.Function; +import java.util.function.BiFunction; /** * Map that maps from a {@link QueryPredicate} of a query to a {@link QueryPredicate} of a {@link MatchCandidate}. @@ -55,6 +64,26 @@ public class PredicateMultiMap { @Nonnull private final SetMultimap map; + @Nonnull + private static Value replaceNewlyMatchedValues(@Nonnull final BiMap unmatchedAggregateMap, + @Nonnull final Map amendedMatchedAggregateMap, + @Nonnull final Value rootValue) { + return Objects.requireNonNull(rootValue.replace(currentValue -> { + if (currentValue instanceof GroupByExpression.UnmatchedAggregateValue) { + final var unmatchedId = + ((GroupByExpression.UnmatchedAggregateValue)currentValue).getUnmatchedId(); + final var queryValue = + Objects.requireNonNull(unmatchedAggregateMap.get(unmatchedId)); + final var translatedQueryValue = + amendedMatchedAggregateMap.get(queryValue); + if (translatedQueryValue != null) { + return translatedQueryValue; + } + } + return currentValue; + })); + } + /** * Functional interface to reapply a predicate if necessary. */ @@ -84,7 +113,14 @@ public boolean isImpossible() { @Nonnull @Override - public Set applyCompensationForPredicate(@Nonnull final CorrelationIdentifier baseAlias) { + public PredicateCompensationFunction amend(@Nonnull final BiMap unmatchedAggregateMap, + @Nonnull final Map amendedMatchedAggregateMap) { + return this; + } + + @Nonnull + @Override + public Set applyCompensationForPredicate(@Nonnull final TranslationMap translationMap) { throw new IllegalArgumentException("this method should not be called"); } }; @@ -103,7 +139,14 @@ public boolean isImpossible() { @Nonnull @Override - public Set applyCompensationForPredicate(@Nonnull final CorrelationIdentifier baseAlias) { + public PredicateCompensationFunction amend(@Nonnull final BiMap unmatchedAggregateMap, + @Nonnull final Map amendedMatchedAggregateMap) { + return this; + } + + @Nonnull + @Override + public Set applyCompensationForPredicate(@Nonnull final TranslationMap translationMap) { throw new IllegalArgumentException("this method should not be called"); } }; @@ -114,10 +157,81 @@ public Set applyCompensationForPredicate(@Nonnull final Correlat boolean isImpossible(); @Nonnull - Set applyCompensationForPredicate(@Nonnull CorrelationIdentifier baseAlias); + PredicateCompensationFunction amend(@Nonnull BiMap unmatchedAggregateMap, + @Nonnull Map amendedMatchedAggregateMap); + + @Nonnull + Set applyCompensationForPredicate(@Nonnull TranslationMap translationMap); + + @Nonnull + static PredicateCompensationFunction ofPredicate(@Nonnull final QueryPredicate predicate) { + return ofPredicate(predicate, false); + } @Nonnull - static PredicateCompensationFunction of(@Nonnull final Function> compensationFunction) { + static PredicateCompensationFunction ofPredicate(@Nonnull final QueryPredicate predicate, + final boolean shouldSimplifyValues) { + final var isImpossible = predicateContainsUnmatchedValues(predicate); + + return new PredicateCompensationFunction() { + @Override + public boolean isNeeded() { + return true; + } + + @Override + public boolean isImpossible() { + return isImpossible; + } + + @Nonnull + @Override + public PredicateCompensationFunction amend(@Nonnull final BiMap unmatchedAggregateMap, + @Nonnull final Map amendedMatchedAggregateMap) { + final var amendedTranslatedPredicateOptional = + predicate.replaceValuesMaybe(rootValue -> + Optional.of(replaceNewlyMatchedValues(unmatchedAggregateMap, amendedMatchedAggregateMap, + rootValue))); + Verify.verify(amendedTranslatedPredicateOptional.isPresent()); + return ofPredicate(amendedTranslatedPredicateOptional.get(), true); + } + + @Nonnull + @Override + public Set applyCompensationForPredicate(@Nonnull final TranslationMap translationMap) { + return LinkedIdentitySet.of(predicate.translateCorrelations(translationMap, shouldSimplifyValues)); + } + }; + } + + private static boolean predicateContainsUnmatchedValues(final @Nonnull QueryPredicate pulledUpPredicate) { + if (pulledUpPredicate instanceof PredicateWithValue) { + final var value = Objects.requireNonNull(((PredicateWithValue)pulledUpPredicate).getValue()); + if (value.preOrderStream() + .anyMatch(v -> v instanceof GroupByExpression.UnmatchedAggregateValue)) { + return true; + } + } + + if (pulledUpPredicate instanceof PredicateWithComparisons) { + final var comparisons = ((PredicateWithComparisons)pulledUpPredicate).getComparisons(); + for (final var comparison : comparisons) { + if (comparison instanceof Comparisons.ValueComparison) { + final var comparisonValue = comparison.getValue(); + if (comparisonValue.preOrderStream() + .anyMatch(v -> v instanceof GroupByExpression.UnmatchedAggregateValue)) { + return true; + } + } + } + } + return false; + } + + @Nonnull + static PredicateCompensationFunction ofExistentialPredicate(@Nonnull final ExistsPredicate existsPredicate) { + final var result = LinkedIdentitySet.of((QueryPredicate)existsPredicate); + return new PredicateCompensationFunction() { @Override public boolean isNeeded() { @@ -131,8 +245,50 @@ public boolean isImpossible() { @Nonnull @Override - public Set applyCompensationForPredicate(@Nonnull final CorrelationIdentifier baseAlias) { - return compensationFunction.apply(baseAlias); + public PredicateCompensationFunction amend(@Nonnull final BiMap unmatchedAggregateMap, + @Nonnull final Map amendedMatchedAggregateMap) { + return this; + } + + @Nonnull + @Override + public Set applyCompensationForPredicate(@Nonnull final TranslationMap translationMap) { + return result; + } + }; + } + + @Nonnull + static PredicateCompensationFunction ofChildrenCompensationFunctions(@Nonnull final List childrenCompensationFunctions, + @Nonnull final BiFunction, TranslationMap, Set> compensationFunction) { + return new PredicateCompensationFunction() { + @Override + public boolean isNeeded() { + return true; + } + + @Override + public boolean isImpossible() { + return childrenCompensationFunctions.stream().anyMatch(PredicateCompensationFunction::isImpossible); + } + + @Nonnull + @Override + public PredicateCompensationFunction amend(@Nonnull final BiMap unmatchedAggregateMap, + @Nonnull final Map amendedMatchedAggregateMap) { + final var amendedChildrenCompensationFunctions = + childrenCompensationFunctions.stream() + .map(childrenCompensationFunction -> + childrenCompensationFunction.amend(unmatchedAggregateMap, + amendedMatchedAggregateMap)) + .collect(ImmutableList.toImmutableList()); + return ofChildrenCompensationFunctions(amendedChildrenCompensationFunctions, compensationFunction); + } + + @Nonnull + @Override + public Set applyCompensationForPredicate(@Nonnull final TranslationMap translationMap) { + return compensationFunction.apply(childrenCompensationFunctions, translationMap); } }; } @@ -166,7 +322,14 @@ public boolean isImpossible() { @Nonnull @Override - public Value applyCompensationForResult(@Nonnull final CorrelationIdentifier baseAlias) { + public ResultCompensationFunction amend(@Nonnull final BiMap unmatchedAggregateMap, + @Nonnull final Map amendedMatchedAggregateMap) { + return this; + } + + @Nonnull + @Override + public Value applyCompensationForResult(@Nonnull final TranslationMap translationMap) { throw new IllegalArgumentException("this method should not be called"); } }; @@ -185,7 +348,14 @@ public boolean isImpossible() { @Nonnull @Override - public Value applyCompensationForResult(@Nonnull final CorrelationIdentifier baseAlias) { + public ResultCompensationFunction amend(@Nonnull final BiMap unmatchedAggregateMap, + @Nonnull final Map amendedMatchedAggregateMap) { + return this; + } + + @Nonnull + @Override + public Value applyCompensationForResult(@Nonnull final TranslationMap translationMap) { throw new IllegalArgumentException("this method should not be called"); } }; @@ -196,17 +366,21 @@ public Value applyCompensationForResult(@Nonnull final CorrelationIdentifier bas boolean isImpossible(); @Nonnull - Value applyCompensationForResult(@Nonnull CorrelationIdentifier baseAlias); + ResultCompensationFunction amend(@Nonnull BiMap unmatchedAggregateMap, + @Nonnull Map amendedMatchedAggregateMap); + + @Nonnull + Value applyCompensationForResult(@Nonnull TranslationMap translationMap); @Nonnull - static ResultCompensationFunction ofTranslation(@Nonnull final Value resultValue, - @Nonnull final CorrelationIdentifier nestingAlias) { - return of(baseAlias -> resultValue.translateCorrelations( - TranslationMap.ofAliases(nestingAlias, baseAlias), false)); + static ResultCompensationFunction ofValue(@Nonnull final Value value) { + return ofValue(value, false); } @Nonnull - static ResultCompensationFunction of(@Nonnull final Function compensationFunction) { + static ResultCompensationFunction ofValue(@Nonnull final Value value, final boolean shouldSimplifyValue) { + final var isImpossible = valueContainsUnmatchedValues(value); + return new ResultCompensationFunction() { @Override public boolean isNeeded() { @@ -215,13 +389,22 @@ public boolean isNeeded() { @Override public boolean isImpossible() { - return false; + return isImpossible; } @Nonnull @Override - public Value applyCompensationForResult(@Nonnull final CorrelationIdentifier baseAlias) { - return compensationFunction.apply(baseAlias); + public ResultCompensationFunction amend(@Nonnull final BiMap unmatchedAggregateMap, + @Nonnull final Map amendedMatchedAggregateMap) { + final var amendedTranslatedQueryValue = + replaceNewlyMatchedValues(unmatchedAggregateMap, amendedMatchedAggregateMap, value); + return ofValue(amendedTranslatedQueryValue, true); + } + + @Nonnull + @Override + public Value applyCompensationForResult(@Nonnull final TranslationMap translationMap) { + return value.translateCorrelations(translationMap, shouldSimplifyValue); } }; } @@ -235,6 +418,11 @@ static ResultCompensationFunction noCompensationNeeded() { static ResultCompensationFunction impossibleCompensation() { return IMPOSSIBLE_COMPENSATION; } + + private static boolean valueContainsUnmatchedValues(final @Nonnull Value pulledUpValue) { + return pulledUpValue.preOrderStream() + .anyMatch(v -> v instanceof GroupByExpression.UnmatchedAggregateValue); + } } /** diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/Quantifier.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/Quantifier.java index d40fdee0bd..f92d552493 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/Quantifier.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/Quantifier.java @@ -34,7 +34,6 @@ import com.apple.foundationdb.record.query.plan.cascades.values.translation.MaxMatchMap; import com.apple.foundationdb.record.query.plan.cascades.values.translation.RegularTranslationMap; import com.apple.foundationdb.record.query.plan.cascades.values.translation.TranslationMap; -import com.apple.foundationdb.record.query.plan.cascades.values.translation.TranslationMap.TranslationFunction; import com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan; import com.google.common.base.Suppliers; import com.google.common.base.Verify; @@ -171,7 +170,7 @@ public ForEachBuilder from(final ForEach quantifier) { @Nonnull @Override public ForEach build(@Nonnull final Reference rangesOver) { - return new ForEach(alias == null ? Quantifier.uniqueID() : alias, rangesOver, isNullOnEmpty); + return new ForEach(alias == null ? Quantifier.uniqueId() : alias, rangesOver, isNullOnEmpty); } } @@ -242,12 +241,7 @@ public List> computeFlowedColumns() { @Nonnull public Optional pullUpMaxMatchMapMaybe(@Nonnull final MaxMatchMap maxMatchMap, @Nonnull final CorrelationIdentifier candidateAlias) { - final var translatedQueryValueOptional = maxMatchMap.translateQueryValueMaybe(candidateAlias); - return translatedQueryValueOptional - .map(translatedQueryValue -> - TranslationMap.regularBuilder() - .when(getAlias()).then(TranslationFunction.adjustValueType(translatedQueryValue)) - .build()); + return maxMatchMap.pullUpMaybe(getAlias(), candidateAlias); } @SuppressWarnings("PMD.CompareObjectsWithEquals") @@ -360,7 +354,7 @@ public static class ExistentialBuilder extends Builder { @Nonnull @Override public Physical build(@Nonnull final Reference rangesOver) { - return new Physical(alias == null ? Quantifier.uniqueID() : alias, rangesOver); + return new Physical(alias == null ? Quantifier.uniqueId() : alias, rangesOver); } /** @@ -821,8 +815,8 @@ public Quantifier rebase(@Nonnull final AliasMap translationMap) { } @Nonnull - public static CorrelationIdentifier uniqueID() { - return CorrelationIdentifier.uniqueID(Quantifier.class); + public static CorrelationIdentifier uniqueId() { + return CorrelationIdentifier.uniqueId(Quantifier.class); } @Nonnull diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/RequestedOrdering.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/RequestedOrdering.java index 979da93ab5..583c719463 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/RequestedOrdering.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/RequestedOrdering.java @@ -29,6 +29,7 @@ import com.apple.foundationdb.record.query.plan.cascades.values.Values; import com.apple.foundationdb.record.query.plan.cascades.values.simplification.OrderingValueComputationRuleSet; import com.apple.foundationdb.record.query.plan.cascades.values.simplification.RequestedOrderingValueSimplificationRuleSet; +import com.apple.foundationdb.record.query.plan.cascades.values.translation.TranslationMap; import com.google.common.base.Suppliers; import com.google.common.base.Verify; import com.google.common.collect.ImmutableList; @@ -88,6 +89,7 @@ private RequestedOrdering(@Nonnull final List orderingPar this.valueRequestedSortOrderMapSupplier = Suppliers.memoize(this::computeValueSortOrderMap); } + @Nonnull public Distinctness getDistinctness() { return distinctness; } @@ -222,6 +224,20 @@ public RequestedOrdering pushDown(@Nonnull final Value value, return new RequestedOrdering(pushedDownOrderingPartsBuilder.build(), Distinctness.PRESERVE_DISTINCTNESS, isExhaustive()); } + @Nonnull + public RequestedOrdering translateCorrelations(@Nonnull TranslationMap translationMap, final boolean shouldSimplify) { + // + // Need to push every participating value of this requested ordering through the value. + // + final var pushedDownOrderingPartsBuilder = ImmutableList.builder(); + for (final var orderingPart : orderingParts) { + final var orderingValue = orderingPart.getValue(); + final var translatedOrderingValue = orderingValue.translateCorrelations(translationMap, shouldSimplify); + pushedDownOrderingPartsBuilder.add(new RequestedOrderingPart(translatedOrderingValue, orderingPart.getSortOrder())); + } + return new RequestedOrdering(pushedDownOrderingPartsBuilder.build(), Distinctness.PRESERVE_DISTINCTNESS, isExhaustive()); + } + @Nonnull private Map computeValueSortOrderMap() { return getOrderingParts() diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/WithPrimaryKeyMatchCandidate.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/WithPrimaryKeyMatchCandidate.java index d2419376d3..2759d701fe 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/WithPrimaryKeyMatchCandidate.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/WithPrimaryKeyMatchCandidate.java @@ -32,29 +32,4 @@ public interface WithPrimaryKeyMatchCandidate extends MatchCandidate { @Nonnull Optional> getPrimaryKeyValuesMaybe(); - - @Nonnull - static Optional> commonPrimaryKeyValuesMaybe(@Nonnull Iterable matchCandidates) { - List common = null; - var first = true; - for (final var matchCandidate : matchCandidates) { - if (matchCandidate instanceof WithPrimaryKeyMatchCandidate) { - final var withPrimaryKeyMatchCandidate = (WithPrimaryKeyMatchCandidate)matchCandidate; - final var primaryKeyMaybe = withPrimaryKeyMatchCandidate.getPrimaryKeyValuesMaybe(); - if (primaryKeyMaybe.isEmpty()) { - return Optional.empty(); - } - final var primaryKey = primaryKeyMaybe.get(); - if (first) { - common = primaryKey; - first = false; - } else if (!common.equals(primaryKey)) { - return Optional.empty(); - } - } else { - return Optional.empty(); - } - } - return Optional.ofNullable(common); // common can only be null if we didn't have any match candidates to start with - } } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/explain/ExplainPlanVisitor.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/explain/ExplainPlanVisitor.java index 0edb72c532..51bb831f82 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/explain/ExplainPlanVisitor.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/explain/ExplainPlanVisitor.java @@ -36,6 +36,7 @@ import com.apple.foundationdb.record.query.plan.explain.ExplainSymbolMap; import com.apple.foundationdb.record.query.plan.explain.ExplainTokens; import com.apple.foundationdb.record.query.plan.explain.PrettyExplainFormatter; +import com.apple.foundationdb.record.query.plan.cascades.Quantifier; import com.apple.foundationdb.record.query.plan.plans.RecordQueryAggregateIndexPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryComparatorPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryCoveringIndexPlan; @@ -60,6 +61,7 @@ import com.apple.foundationdb.record.query.plan.plans.RecordQueryIntersectionPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryLoadByKeysPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryMapPlan; +import com.apple.foundationdb.record.query.plan.plans.RecordQueryMultiIntersectionOnValuesPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryPlanVisitor; import com.apple.foundationdb.record.query.plan.plans.RecordQueryPlanWithExplain; @@ -89,6 +91,7 @@ import javax.annotation.Nonnull; import java.util.Arrays; +import java.util.List; import java.util.function.Supplier; /** @@ -338,6 +341,30 @@ public ExplainTokens visitInComparandJoinPlan(@Nonnull final RecordQueryInCompar return visitInJoinPlan(inComparandJoinPlan); } + @Nonnull + @Override + public ExplainTokens visitMultiIntersectionOnValuesPlan(@Nonnull final RecordQueryMultiIntersectionOnValuesPlan multiIntersectionOnValuesPlan) { + visitAndJoin(() -> new ExplainTokens().addWhitespace().addToString("∩").addWhitespace(), + multiIntersectionOnValuesPlan.getChildren()); + final var compareByExplainTokens = new ExplainTokens().addWhitespace().addKeyword("COMPARE") + .addWhitespace().addKeyword("BY").addWhitespace() + .addNested(multiIntersectionOnValuesPlan.getComparisonKeyFunction().explain().getExplainTokens()); + addNested(ExplainLevel.SOME_DETAILS, compareByExplainTokens); + + final List quantifiers = multiIntersectionOnValuesPlan.getQuantifiers(); + final var withExplainTokens = + new ExplainTokens().addWhitespace().addKeyword("WITH").addWhitespace() + .addSequence(() -> new ExplainTokens().addCommaAndWhiteSpace(), + () -> quantifiers.stream() + .map(quantifier -> new ExplainTokens() + .addAliasDefinition(quantifier.getAlias())) + .iterator()); + addNested(ExplainLevel.SOME_DETAILS, withExplainTokens); + final var returnExplainTokens = new ExplainTokens().addWhitespace().addKeyword("RETURN") + .addWhitespace().addNested(multiIntersectionOnValuesPlan.getResultValue().explain().getExplainTokens()); + return addNested(ExplainLevel.SOME_DETAILS, returnExplainTokens); + } + @Nonnull @Override public ExplainTokens visitInParameterJoinPlan(@Nonnull final RecordQueryInParameterJoinPlan inParameterJoinPlan) { @@ -445,10 +472,10 @@ public ExplainTokens visitTempTableInsertPlan(@Nonnull final TempTableInsertPlan private ExplainTokens visitIntersectionPlan(@Nonnull final RecordQueryIntersectionPlan intersectionPlan) { visitAndJoin(() -> new ExplainTokens().addWhitespace().addToString("∩").addWhitespace(), intersectionPlan.getChildren()); - final var comparyByExplainTokens = new ExplainTokens().addWhitespace().addKeyword("COMPARE") + final var compareByExplainTokens = new ExplainTokens().addWhitespace().addKeyword("COMPARE") .addWhitespace().addKeyword("BY").addWhitespace() .addNested(intersectionPlan.getComparisonKeyFunction().explain().getExplainTokens()); - return addNested(ExplainLevel.SOME_DETAILS, comparyByExplainTokens); + return addNested(ExplainLevel.SOME_DETAILS, compareByExplainTokens); } @Nonnull @@ -586,10 +613,10 @@ private ExplainTokens visitUnionPlan(@Nonnull final RecordQueryUnionPlan unionPl visitAndJoin(() -> new ExplainTokens().addWhitespace().addToString("∪").addWhitespace(), unionPlan.getChildren()); - final var comparyByExplainTokens = new ExplainTokens().addWhitespace().addKeyword("COMPARE") + final var compareByExplainTokens = new ExplainTokens().addWhitespace().addKeyword("COMPARE") .addWhitespace().addKeyword("BY").addWhitespace() .addNested(unionPlan.getComparisonKeyFunction().explain().getExplainTokens()); - return addNested(ExplainLevel.SOME_DETAILS, comparyByExplainTokens); + return addNested(ExplainLevel.SOME_DETAILS, compareByExplainTokens); } @Nonnull diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/ExplodeExpression.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/ExplodeExpression.java index 2e7532b612..b36498d5f9 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/ExplodeExpression.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/ExplodeExpression.java @@ -149,7 +149,7 @@ public Iterable subsumedBy(@Nonnull final RelationalExpression candid public Compensation compensate(@Nonnull final PartialMatch partialMatch, @Nonnull final Map boundParameterPrefixMap, @Nullable final PullUp pullUp, - @Nonnull final CorrelationIdentifier nestingAlias) { + @Nonnull final CorrelationIdentifier candidateAlias) { // subsumedBy() is based on equality and this expression is always a leaf, thus we return empty here as // if there is a match, it's exact return Compensation.noCompensation(); diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/FullUnorderedScanExpression.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/FullUnorderedScanExpression.java index c45efa0ba6..3210b8e05f 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/FullUnorderedScanExpression.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/FullUnorderedScanExpression.java @@ -182,7 +182,7 @@ public Iterable subsumedBy(@Nonnull final RelationalExpression candid public Compensation compensate(@Nonnull final PartialMatch partialMatch, @Nonnull final Map boundParameterPrefixMap, @Nullable final PullUp pullUp, - @Nonnull final CorrelationIdentifier nestingAlias) { + @Nonnull final CorrelationIdentifier candidateAlias) { return Compensation.noCompensation(); } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/GroupByExpression.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/GroupByExpression.java index 9de584b40a..f8eeec400b 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/GroupByExpression.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/GroupByExpression.java @@ -22,13 +22,17 @@ import com.apple.foundationdb.annotation.API; import com.apple.foundationdb.record.EvaluationContext; +import com.apple.foundationdb.record.PlanSerializationContext; +import com.apple.foundationdb.record.planprotos.PValue; import com.apple.foundationdb.record.query.expressions.Comparisons; +import com.apple.foundationdb.record.query.plan.cascades.AggregateIndexExpansionVisitor; import com.apple.foundationdb.record.query.plan.cascades.AliasMap; import com.apple.foundationdb.record.query.plan.cascades.Column; import com.apple.foundationdb.record.query.plan.cascades.ComparisonRange; import com.apple.foundationdb.record.query.plan.cascades.Compensation; import com.apple.foundationdb.record.query.plan.cascades.ConstrainedBoolean; import com.apple.foundationdb.record.query.plan.cascades.CorrelationIdentifier; +import com.apple.foundationdb.record.query.plan.cascades.GroupByMappings; import com.apple.foundationdb.record.query.plan.cascades.IdentityBiMap; import com.apple.foundationdb.record.query.plan.cascades.LinkedIdentityMap; import com.apple.foundationdb.record.query.plan.cascades.MatchInfo; @@ -49,21 +53,28 @@ import com.apple.foundationdb.record.query.plan.cascades.predicates.PredicateWithValue; import com.apple.foundationdb.record.query.plan.cascades.predicates.PredicateWithValueAndRanges; import com.apple.foundationdb.record.query.plan.cascades.typing.Type; +import com.apple.foundationdb.record.query.plan.cascades.values.AbstractValue; import com.apple.foundationdb.record.query.plan.cascades.values.AggregateValue; import com.apple.foundationdb.record.query.plan.cascades.values.FieldValue; import com.apple.foundationdb.record.query.plan.cascades.values.QuantifiedObjectValue; +import com.apple.foundationdb.record.query.plan.cascades.values.IndexableAggregateValue; import com.apple.foundationdb.record.query.plan.cascades.values.RecordConstructorValue; import com.apple.foundationdb.record.query.plan.cascades.values.Value; import com.apple.foundationdb.record.query.plan.cascades.values.Values; import com.apple.foundationdb.record.query.plan.cascades.values.translation.MaxMatchMap; import com.apple.foundationdb.record.query.plan.cascades.values.translation.PullUp; import com.apple.foundationdb.record.query.plan.cascades.values.translation.TranslationMap; +import com.apple.foundationdb.record.query.plan.explain.ExplainTokens; +import com.apple.foundationdb.record.query.plan.explain.ExplainTokensWithPrecedence; import com.google.common.base.Suppliers; import com.google.common.base.Verify; +import com.google.common.collect.BiMap; +import com.google.common.collect.ImmutableBiMap; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; +import com.google.protobuf.Message; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -76,9 +87,6 @@ import java.util.function.BiFunction; import java.util.function.Supplier; -import static com.apple.foundationdb.record.query.plan.cascades.ConstrainedBoolean.alwaysTrue; -import static com.apple.foundationdb.record.query.plan.cascades.ConstrainedBoolean.falseValue; - /** * A logical {@code group by} expression that represents grouping incoming tuples and aggregating each group. */ @@ -106,7 +114,8 @@ public class GroupByExpression implements RelationalExpressionWithChildren, Inte /** * Creates a new instance of {@link GroupByExpression}. * - * @param groupingValue The grouping {@code Value} used to determine individual groups, can be {@code null} indicating no grouping. + * @param groupingValue The grouping {@code Value} used to determine individual groups, can be {@code null} + * indicating no grouping. * @param aggregateValue The aggregation {@code Value} applied to each group. * @param resultValueFunction a bi-function that allows us to create the actual result value of this expression * @param innerQuantifier The underlying source of tuples to be grouped. @@ -311,15 +320,12 @@ public Iterable subsumedBy(@Nonnull final RelationalExpression candid ValueEquivalence.fromAliasMap(bindingAliasMap) .then(ValueEquivalence.constantEquivalenceWithEvaluationContext(evaluationContext)); - final var translatedAggregateValue = - aggregateValue.translateCorrelations(translationMap, true); - final var translatedAggregateValues = - Values.primitiveAccessorsForType(translatedAggregateValue.getResultType(), - () -> translatedAggregateValue).stream() - .map(primitiveGroupingValue -> primitiveGroupingValue.simplify(evaluationContext, + final var aggregateValues = + Values.primitiveAccessorsForType(aggregateValue.getResultType(), () -> aggregateValue).stream() + .map(primitiveAggregateValue -> primitiveAggregateValue.simplify(evaluationContext, AliasMap.emptyMap(), ImmutableSet.of())) .collect(ImmutableSet.toImmutableSet()); - if (translatedAggregateValues.size() != 1) { + if (aggregateValues.isEmpty()) { return ImmutableList.of(); } @@ -329,79 +335,143 @@ public Iterable subsumedBy(@Nonnull final RelationalExpression candid .map(primitiveAggregateValue -> primitiveAggregateValue.simplify(evaluationContext, AliasMap.emptyMap(), ImmutableSet.of())) .collect(ImmutableSet.toImmutableSet()); - if (translatedAggregateValues.size() != 1) { + if (otherAggregateValues.size() != 1) { return ImmutableList.of(); } + final var otherPrimitiveAggregateValue = (IndexableAggregateValue)Iterables.getOnlyElement(otherAggregateValues); + final var matchedAggregatesMapBuilder = ImmutableBiMap.builder(); + final var unmatchedAggregatesMapBuilder = + ImmutableBiMap.builder(); + final var unmatchedTranslatedAggregatesValueMapBuilder = + ImmutableMap.builder(); + var subsumedAggregations = ConstrainedBoolean.falseValue(); + for (final var primitiveAggregateValue : aggregateValues) { + final var translatedPrimitiveAggregateValue = + primitiveAggregateValue.translateCorrelations(translationMap, true); + + final var semanticEquals = + translatedPrimitiveAggregateValue.semanticEquals(otherPrimitiveAggregateValue, valueEquivalence); + if (semanticEquals.isTrue()) { + matchedAggregatesMapBuilder.put(primitiveAggregateValue, otherPrimitiveAggregateValue); + subsumedAggregations = semanticEquals; + } else { + final var unmatchedId = UnmatchedAggregateValue.uniqueId(); + unmatchedAggregatesMapBuilder.put(unmatchedId, primitiveAggregateValue); + unmatchedTranslatedAggregatesValueMapBuilder.put(translatedPrimitiveAggregateValue, unmatchedId); + } + } - final var subsumedAggregations = - Iterables.getOnlyElement(translatedAggregateValues).semanticEquals(Iterables.getOnlyElement(otherAggregateValues), - valueEquivalence); if (subsumedAggregations.isFalse()) { return ImmutableList.of(); } - final var subsumedGroupings = - subsumedAggregations - .compose(ignored -> groupingSubsumedBy(candidateInnerQuantifier, - Objects.requireNonNull(partialMatchMap.getUnwrapped(innerQuantifier)), - candidateGroupingValue, translationMap, valueEquivalence, evaluationContext)); - + final var subsumedGroupingsResult = + groupingSubsumedBy(candidateInnerQuantifier, + Objects.requireNonNull(partialMatchMap.getUnwrapped(innerQuantifier)), + candidateGroupingValue, translationMap, valueEquivalence, evaluationContext); + final var subsumedGroupings = Objects.requireNonNull(subsumedGroupingsResult.getSubsumedGroups()); if (subsumedGroupings.isFalse()) { return ImmutableList.of(); } + final var matchedGroupingsMap = subsumedGroupingsResult.getMatchedGroupingsMap(); + final var rollUpToGroupingValues = subsumedGroupingsResult.getRollUpToValues(); + + if (rollUpToGroupingValues != null && + !AggregateIndexExpansionVisitor.canBeRolledUp(otherPrimitiveAggregateValue.getIndexTypeName())) { + // We determined we need a roll up, but we cannot do it base on the aggregations. + return ImmutableList.of(); + } + final var unmatchedTranslatedAggregateValueMap = + unmatchedTranslatedAggregatesValueMapBuilder.buildKeepingLast(); final var translatedResultValue = getResultValue().translateCorrelations(translationMap, true); final var maxMatchMap = MaxMatchMap.compute(translatedResultValue, candidateExpression.getResultValue(), - Quantifiers.aliases(candidateExpression.getQuantifiers()), valueEquivalence); + Quantifiers.aliases(candidateExpression.getQuantifiers()), valueEquivalence, + translatedUnmatchedValue -> onUnmatchedValue(unmatchedTranslatedAggregateValueMap, + translatedUnmatchedValue)); final var queryPlanConstraint = subsumedGroupings.getConstraint().compose(maxMatchMap.getQueryPlanConstraint()); return RegularMatchInfo.tryMerge(bindingAliasMap, partialMatchMap, ImmutableMap.of(), PredicateMap.empty(), - maxMatchMap, queryPlanConstraint) + maxMatchMap, + GroupByMappings.of(matchedGroupingsMap, matchedAggregatesMapBuilder.build(), + unmatchedAggregatesMapBuilder.build()), + rollUpToGroupingValues, queryPlanConstraint) .map(ImmutableList::of) .orElse(ImmutableList.of()); } @Nonnull - private ConstrainedBoolean groupingSubsumedBy(@Nonnull final Quantifier candidateInnerQuantifier, - @Nonnull final PartialMatch childMatch, - @Nullable final Value candidateGroupingValue, - @Nonnull final TranslationMap translationMap, - @Nonnull final ValueEquivalence valueEquivalence, - @Nonnull final EvaluationContext evaluationContext) { + private Optional onUnmatchedValue(@Nonnull final Map unmatchedTranslatedAggregateValueMap, + @Nonnull final Value translatedUnmatchedValue) { + final var unmatchedId = unmatchedTranslatedAggregateValueMap.get(translatedUnmatchedValue); + if (unmatchedId == null) { + return Optional.empty(); + } + return Optional.of(new UnmatchedAggregateValue(unmatchedId)); + } + + @Nonnull + private SubsumedGroupingsResult groupingSubsumedBy(@Nonnull final Quantifier candidateInnerQuantifier, + @Nonnull final PartialMatch childMatch, + @Nullable final Value candidateGroupingValue, + @Nonnull final TranslationMap translationMap, + @Nonnull final ValueEquivalence valueEquivalence, + @Nonnull final EvaluationContext evaluationContext) { if (groupingValue == null && candidateGroupingValue == null) { - return alwaysTrue(); + return SubsumedGroupingsResult.withoutRollUp(ConstrainedBoolean.alwaysTrue(), ImmutableBiMap.of()); } if (candidateGroupingValue == null) { - return falseValue(); + return SubsumedGroupingsResult.noSubsumption(); } - final Set translatedGroupingValues; + final List translatedGroupingValues; // with duplicate groupings if present + final BiMap matchedGroupingsMap; if (groupingValue != null) { - final var translatedGroupingValue = groupingValue.translateCorrelations(translationMap, true); - translatedGroupingValues = - Values.primitiveAccessorsForType(translatedGroupingValue.getResultType(), - () -> translatedGroupingValue).stream() + final var translatedGroupingsValuesBuilder = ImmutableList.builder(); + final var matchedGroupingsMapBuilder = ImmutableMap.builder(); + final var groupingValues = + Values.primitiveAccessorsForType(groupingValue.getResultType(), () -> groupingValue).stream() .map(primitiveGroupingValue -> primitiveGroupingValue.simplify(evaluationContext, AliasMap.emptyMap(), ImmutableSet.of())) - .collect(ImmutableSet.toImmutableSet()); + .collect(ImmutableList.toImmutableList()); + for (final var primitiveGroupingValue : groupingValues) { + final var translatedPrimitiveGroupingValue = + primitiveGroupingValue.translateCorrelations(translationMap, true); + // TODO is this needed?.simplify(evaluationContext, AliasMap.emptyMap(), ImmutableSet.of()); + translatedGroupingsValuesBuilder.add(translatedPrimitiveGroupingValue); + matchedGroupingsMapBuilder.put(primitiveGroupingValue, translatedPrimitiveGroupingValue); + } + translatedGroupingValues = translatedGroupingsValuesBuilder.build(); + + // + // We know that if there are duplicates, they will be on the query side. Immutable bi-maps do not support + // duplicated keys at all while regular maps do. The simplest and also the cheapest solution is to just + // use an immutable map builder (which then is de-duped when built) and then use that map to build the + // bi-map. + // + matchedGroupingsMap = ImmutableBiMap.copyOf(matchedGroupingsMapBuilder.buildKeepingLast()); } else { - translatedGroupingValues = ImmutableSet.of(); + translatedGroupingValues = ImmutableList.of(); + matchedGroupingsMap = ImmutableBiMap.of(); } + final Set translatedGroupingValuesSet = ImmutableSet.copyOf(translatedGroupingValues); + final var candidateGroupingValues = Values.primitiveAccessorsForType(candidateGroupingValue.getResultType(), () -> candidateGroupingValue).stream() .map(primitiveGroupingValue -> primitiveGroupingValue.simplify(evaluationContext, AliasMap.emptyMap(), ImmutableSet.of())) - .collect(ImmutableSet.toImmutableSet()); + .collect(ImmutableList.toImmutableList()); // // If there are more groupingValues than candidateGroupingValues, we cannot match the index. // - if (translatedGroupingValues.size() > candidateGroupingValues.size()) { - return falseValue(); + final var unmatchedCandidateValues = new LinkedHashSet<>(candidateGroupingValues); + if (translatedGroupingValuesSet.size() > unmatchedCandidateValues.size()) { + return SubsumedGroupingsResult.noSubsumption(); } // @@ -417,15 +487,14 @@ private ConstrainedBoolean groupingSubsumedBy(@Nonnull final Quantifier candidat // 3. For each candidate grouping value in the set of (yet) unmatched candidate group values, try to find a // predicate that binds that groupingValue. // - final var unmatchedCandidateValues = new LinkedHashSet<>(candidateGroupingValues); - var booleanWithConstraint = alwaysTrue(); - for (final var groupingPartValue : translatedGroupingValues) { + var booleanWithConstraint = ConstrainedBoolean.alwaysTrue(); + for (final var translatedGroupingValue : translatedGroupingValuesSet) { var found = false; for (final var iterator = unmatchedCandidateValues.iterator(); iterator.hasNext(); ) { final var candidateGroupingPartValue = iterator.next(); final var semanticEquals = - groupingPartValue.semanticEquals(candidateGroupingPartValue, valueEquivalence); + translatedGroupingValue.semanticEquals(candidateGroupingPartValue, valueEquivalence); if (semanticEquals.isTrue()) { found = true; booleanWithConstraint = booleanWithConstraint.composeWithOther(semanticEquals); @@ -438,7 +507,7 @@ private ConstrainedBoolean groupingSubsumedBy(@Nonnull final Quantifier candidat } } if (!found) { - return falseValue(); + return SubsumedGroupingsResult.noSubsumption(); } if (unmatchedCandidateValues.isEmpty()) { break; @@ -447,7 +516,7 @@ private ConstrainedBoolean groupingSubsumedBy(@Nonnull final Quantifier candidat if (unmatchedCandidateValues.isEmpty()) { // return with a positive result if sets where in fact semantically equal - return booleanWithConstraint; + return SubsumedGroupingsResult.withoutRollUp(booleanWithConstraint, matchedGroupingsMap); } // @@ -503,7 +572,24 @@ private ConstrainedBoolean groupingSubsumedBy(@Nonnull final Quantifier candidat } } - return unmatchedCandidateValues.isEmpty() ? booleanWithConstraint : falseValue(); + if (!unmatchedCandidateValues.isEmpty()) { + Verify.verify(candidateGroupingValues.size() > translatedGroupingValuesSet.size()); + + // + // This is a potential roll-up case, but only if the query side's groupings are completely subsumed + // by the prefix of the candidate side. Iterate up to the smaller query side's grouping values to + // find out. + // + for (int i = 0; i < translatedGroupingValues.size(); i++) { + if (unmatchedCandidateValues.contains(candidateGroupingValues.get(i))) { + return SubsumedGroupingsResult.noSubsumption(); + } + } + + return SubsumedGroupingsResult.of(booleanWithConstraint, matchedGroupingsMap, translatedGroupingValues); + } + + return SubsumedGroupingsResult.withoutRollUp(booleanWithConstraint, matchedGroupingsMap); } @Nonnull @@ -525,17 +611,22 @@ private RequestedOrdering computeRequestedOrdering() { innerQuantifier.getCorrelatedTo()); } + @SuppressWarnings("ConstantValue") @Nonnull @Override public Compensation compensate(@Nonnull final PartialMatch partialMatch, @Nonnull final Map boundParameterPrefixMap, @Nullable final PullUp pullUp, - @Nonnull final CorrelationIdentifier nestingAlias) { + @Nonnull final CorrelationIdentifier candidateAlias) { final var matchInfo = partialMatch.getMatchInfo(); final var regularMatchInfo = partialMatch.getRegularMatchInfo(); final var quantifier = Iterables.getOnlyElement(getQuantifiers()); - final var adjustedPullUp = partialMatch.nestPullUp(pullUp, nestingAlias); + final var nestedPullUpPair = + partialMatch.nestPullUp(pullUp, candidateAlias); + final var rootOfMatchPullUp = nestedPullUpPair.getKey(); + final var adjustedPullUp = Objects.requireNonNull(nestedPullUpPair.getRight()); + // if the match requires, for the moment, any, compensation, we reject it. final Optional childCompensationOptional = regularMatchInfo.getChildPartialMatchMaybe(quantifier) @@ -551,36 +642,42 @@ public Compensation compensate(@Nonnull final PartialMatch partialMatch, final var childCompensation = childCompensationOptional.get(); - if (childCompensation.isImpossible() || - // - // TODO This needs some improvement as GB a, b, c WHERE a= AND c= needs to reapply the - // predicate on c which is currently refused here. - // - childCompensation.isNeededForFiltering()) { + if (childCompensation.isImpossible()) { + // + // Note that it may be better to just return the child compensation verbatim as that compensation + // may be combinable with something else to make it possible while the statically impossible compensation + // can never combine into anything that is possible. + // return Compensation.impossibleCompensation(); } + boolean isCompensationImpossible = false; final ResultCompensationFunction resultCompensationFunction; - if (pullUp != null) { + final GroupByMappings pulledUpGroupByMappings; + if (rootOfMatchPullUp == null) { resultCompensationFunction = ResultCompensationFunction.noCompensationNeeded(); + pulledUpGroupByMappings = GroupByMappings.empty(); } else { - final var rootPullUp = adjustedPullUp.getRootPullUp(); final var maxMatchMap = matchInfo.getMaxMatchMap(); - final var pulledUpResultValueOptional = - rootPullUp.pullUpMaybe(maxMatchMap.getQueryValue()); - if (pulledUpResultValueOptional.isEmpty()) { + final var pulledUpTranslatedResultValueOptional = + rootOfMatchPullUp.pullUpValueMaybe(maxMatchMap.getQueryValue()); + if (pulledUpTranslatedResultValueOptional.isEmpty()) { return Compensation.impossibleCompensation(); } - final var pulledUpResultValue = pulledUpResultValueOptional.get(); + final var pulledUpTranslatedResultValue = pulledUpTranslatedResultValueOptional.get(); - if (QuantifiedObjectValue.isSimpleQuantifiedObjectValueOver(pulledUpResultValue, - rootPullUp.getNestingAlias())) { + if (QuantifiedObjectValue.isSimpleQuantifiedObjectValueOver(pulledUpTranslatedResultValue, + rootOfMatchPullUp.getCandidateAlias())) { resultCompensationFunction = ResultCompensationFunction.noCompensationNeeded(); } else { resultCompensationFunction = - ResultCompensationFunction.ofTranslation(pulledUpResultValue, rootPullUp.getNestingAlias()); + ResultCompensationFunction.ofValue(pulledUpTranslatedResultValue); } + isCompensationImpossible |= resultCompensationFunction.isImpossible(); + + pulledUpGroupByMappings = + RegularMatchInfo.pullUpAggregateCandidateMappings(partialMatch, rootOfMatchPullUp); } final var unmatchedQuantifiers = partialMatch.getUnmatchedQuantifiers(); @@ -590,12 +687,13 @@ public Compensation compensate(@Nonnull final PartialMatch partialMatch, return Compensation.noCompensation(); } - return childCompensation.derived(false, + return childCompensation.derived(isCompensationImpossible, new LinkedIdentityMap<>(), getMatchedQuantifiers(partialMatch), unmatchedQuantifiers, partialMatch.getCompensatedAliases(), - resultCompensationFunction); + resultCompensationFunction, + pulledUpGroupByMappings); } @Nonnull @@ -643,4 +741,117 @@ public static Value flattenedResults(@Nullable final Value groupingKeyValue, return rcv.simplify(EvaluationContext.empty(), AliasMap.identitiesFor(rcv.getCorrelatedTo()), ImmutableSet.of()); } + + public static class UnmatchedAggregateValue extends AbstractValue implements Value.NonEvaluableValue { + @Nonnull + private final CorrelationIdentifier unmatchedId; + + public UnmatchedAggregateValue(@Nonnull final CorrelationIdentifier unmatchedId) { + this.unmatchedId = unmatchedId; + } + + @Nonnull + public CorrelationIdentifier getUnmatchedId() { + return unmatchedId; + } + + @Nonnull + @Override + protected Iterable computeChildren() { + return ImmutableList.of(); + } + + @Nonnull + @Override + public ExplainTokensWithPrecedence explain(@Nonnull final Iterable> explainSuppliers) { + Verify.verify(Iterables.isEmpty(explainSuppliers)); + return ExplainTokensWithPrecedence.of(new ExplainTokens().addFunctionCall("unmatched", + new ExplainTokens().addIdentifier(unmatchedId.getId()))); + } + + @Override + public int hashCodeWithoutChildren() { + return 0; + } + + @Nonnull + @Override + public PValue toValueProto(@Nonnull final PlanSerializationContext serializationContext) { + throw new UnsupportedOperationException(); + } + + @Override + public int planHash(@Nonnull final PlanHashMode hashMode) { + return 0; + } + + @Nonnull + @Override + public Message toProto(@Nonnull final PlanSerializationContext serializationContext) { + throw new UnsupportedOperationException(); + } + + @Nonnull + @Override + public Value withChildren(final Iterable newChildren) { + Verify.verify(Iterables.isEmpty(newChildren)); + return new UnmatchedAggregateValue(getUnmatchedId()); + } + + @Nonnull + public static CorrelationIdentifier uniqueId() { + return CorrelationIdentifier.uniqueId(UnmatchedAggregateValue.class); + } + } + + private static class SubsumedGroupingsResult { + @Nonnull + private final ConstrainedBoolean subsumedGroups; + @Nonnull + private final BiMap matchedGroupingsMap; + @Nullable + private final List rollUpToValues; + + private SubsumedGroupingsResult(@Nonnull final ConstrainedBoolean subsumedGroups, + @Nonnull final BiMap matchedGroupingsMap, + @Nullable final List rollUpToValues) { + this.subsumedGroups = subsumedGroups; + this.matchedGroupingsMap = matchedGroupingsMap; + this.rollUpToValues = rollUpToValues; + } + + @Nonnull + public ConstrainedBoolean getSubsumedGroups() { + return subsumedGroups; + } + + @Nonnull + public BiMap getMatchedGroupingsMap() { + return matchedGroupingsMap; + } + + @Nullable + public List getRollUpToValues() { + return rollUpToValues; + } + + @Nonnull + public static SubsumedGroupingsResult noSubsumption() { + return of(ConstrainedBoolean.falseValue(), ImmutableBiMap.of(), null); + } + + @Nonnull + public static SubsumedGroupingsResult withoutRollUp(@Nonnull final ConstrainedBoolean subsumedGroups, + @Nonnull final BiMap matchedGroupingsMap) { + return of(subsumedGroups, matchedGroupingsMap, null); + } + + @Nonnull + public static SubsumedGroupingsResult of(@Nonnull final ConstrainedBoolean subsumedGroups, + @Nonnull final BiMap matchedGroupingsMap, + @Nullable final List rollUpToValues) { + return new SubsumedGroupingsResult(subsumedGroups, ImmutableBiMap.copyOf(matchedGroupingsMap), + rollUpToValues == null ? null : ImmutableList.copyOf(rollUpToValues)); + } + } } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/LogicalTypeFilterExpression.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/LogicalTypeFilterExpression.java index ca4fb9a455..669140b29d 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/LogicalTypeFilterExpression.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/LogicalTypeFilterExpression.java @@ -30,6 +30,8 @@ import com.apple.foundationdb.record.query.plan.cascades.IdentityBiMap; import com.apple.foundationdb.record.query.plan.cascades.LinkedIdentityMap; import com.apple.foundationdb.record.query.plan.cascades.MatchInfo; +import com.apple.foundationdb.record.query.plan.cascades.GroupByMappings; +import com.apple.foundationdb.record.query.plan.cascades.MatchInfo.RegularMatchInfo; import com.apple.foundationdb.record.query.plan.cascades.PartialMatch; import com.apple.foundationdb.record.query.plan.cascades.PredicateMultiMap.ResultCompensationFunction; import com.apple.foundationdb.record.query.plan.cascades.Quantifier; @@ -174,15 +176,19 @@ public Iterable subsumedBy(@Nonnull final RelationalExpression candid return exactlySubsumedBy(candidateExpression, bindingAliasMap, partialMatchMap, translationMapOptional.get()); } + @SuppressWarnings("ConstantValue") @Nonnull @Override public Compensation compensate(@Nonnull final PartialMatch partialMatch, @Nonnull final Map boundParameterPrefixMap, @Nullable final PullUp pullUp, - @Nonnull final CorrelationIdentifier nestingAlias) { + @Nonnull final CorrelationIdentifier candidateAlias) { final var matchInfo = partialMatch.getMatchInfo(); final var regularMatchInfo = partialMatch.getRegularMatchInfo(); - final var adjustedPullUp = partialMatch.nestPullUp(pullUp, nestingAlias); + final var nestedPullUpPair = + partialMatch.nestPullUp(pullUp, candidateAlias); + final var rootOfMatchPullUp = nestedPullUpPair.getKey(); + final var adjustedPullUp = Objects.requireNonNull(nestedPullUpPair.getRight()); final var bindingAliasMap = regularMatchInfo.getBindingAliasMap(); final PartialMatch childPartialMatch = @@ -198,27 +204,33 @@ public Compensation compensate(@Nonnull final PartialMatch partialMatch, return Compensation.impossibleCompensation(); } + boolean isCompensationImpossible = false; final ResultCompensationFunction resultCompensationFunction; - if (pullUp != null) { + final GroupByMappings groupByMappings; + if (rootOfMatchPullUp == null) { resultCompensationFunction = ResultCompensationFunction.noCompensationNeeded(); + groupByMappings = GroupByMappings.empty(); } else { - final var rootPullUp = adjustedPullUp.getRootPullUp(); final var maxMatchMap = matchInfo.getMaxMatchMap(); - final var pulledUpResultValueOptional = - rootPullUp.pullUpMaybe(maxMatchMap.getQueryValue()); - if (pulledUpResultValueOptional.isEmpty()) { + final var pulledUpTranslatedResultValueOptional = + rootOfMatchPullUp.pullUpValueMaybe(maxMatchMap.getQueryValue()); + if (pulledUpTranslatedResultValueOptional.isEmpty()) { return Compensation.impossibleCompensation(); } - final var pulledUpResultValue = pulledUpResultValueOptional.get(); + final var pulledUpTranslatedResultValue = pulledUpTranslatedResultValueOptional.get(); - if (QuantifiedObjectValue.isSimpleQuantifiedObjectValueOver(pulledUpResultValue, - rootPullUp.getNestingAlias())) { + if (QuantifiedObjectValue.isSimpleQuantifiedObjectValueOver(pulledUpTranslatedResultValue, + rootOfMatchPullUp.getCandidateAlias())) { resultCompensationFunction = ResultCompensationFunction.noCompensationNeeded(); } else { resultCompensationFunction = - ResultCompensationFunction.ofTranslation(pulledUpResultValue, rootPullUp.getNestingAlias()); + ResultCompensationFunction.ofValue(pulledUpTranslatedResultValue); } + isCompensationImpossible |= resultCompensationFunction.isImpossible(); + + groupByMappings = + RegularMatchInfo.pullUpAggregateCandidateMappings(partialMatch, rootOfMatchPullUp); } final var unmatchedQuantifiers = partialMatch.getUnmatchedQuantifiers(); @@ -228,12 +240,13 @@ public Compensation compensate(@Nonnull final PartialMatch partialMatch, return Compensation.noCompensation(); } - return childCompensation.derived(false, + return childCompensation.derived(isCompensationImpossible, new LinkedIdentityMap<>(), getMatchedQuantifiers(partialMatch), unmatchedQuantifiers, partialMatch.getCompensatedAliases(), - resultCompensationFunction); + resultCompensationFunction, + groupByMappings); } @Nonnull diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/MatchableSortExpression.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/MatchableSortExpression.java index c1ebcb4309..a57500dc76 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/MatchableSortExpression.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/MatchableSortExpression.java @@ -212,7 +212,8 @@ public MatchableSortExpression translateCorrelations(@Nonnull final TranslationM @Nonnull @Override - public Optional adjustMatch(@Nonnull final PartialMatch partialMatch) { + public Optional adjustMatch(@Nonnull final PartialMatch partialMatch, + @Nonnull final Quantifier candidateQuantifier) { final var childMatchInfo = partialMatch.getMatchInfo(); final var maxMatchMap = childMatchInfo.getMaxMatchMap(); final var innerQuantifier = Iterables.getOnlyElement(getQuantifiers()); @@ -223,6 +224,7 @@ public Optional adjustMatch(@Nonnull final PartialMatch partialMatch) childMatchInfo.adjustedBuilder() .setMaxMatchMap(adjustedMaxMatchMap) .setMatchedOrderingParts(forPartialMatch(partialMatch)) + .setGroupByMappings(childMatchInfo.adjustGroupByMappings(candidateQuantifier)) .build()); } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/RelationalExpression.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/RelationalExpression.java index d540aee3c6..8bb823142e 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/RelationalExpression.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/RelationalExpression.java @@ -750,12 +750,15 @@ static Optional pullUpAndComposeTranslationMapsMaybe(@Nonnull fi /** * Override that is called by {@link AdjustMatchRule} to improve an already existing {@link PartialMatch}. - * @param partialMatch the partial match already existing between {@code expression} and {@code this} + * @param partialMatch the partial match already existing between {@code expression} and the only child of + * {@code this} + * @param candidateQuantifier the quantifier we adjust along * @return {@code Optional.empty()} if the match could not be adjusted, Optional.of(matchInfo) for a new adjusted * match, otherwise. */ @Nonnull - default Optional adjustMatch(@Nonnull final PartialMatch partialMatch) { + default Optional adjustMatch(@Nonnull final PartialMatch partialMatch, + @Nonnull final Quantifier candidateQuantifier) { return Optional.empty(); } @@ -788,7 +791,7 @@ default boolean hasIncompatibleBoundQuantifiers(final AliasMap aliasMap, final C default Compensation compensate(@Nonnull final PartialMatch partialMatch, @Nonnull final Map boundParameterPrefixMap, @Nullable final PullUp pullUp, - @Nonnull final CorrelationIdentifier nestingAlias) { + @Nonnull final CorrelationIdentifier candidateAlias) { throw new RecordCoreException("expression matched but no compensation logic implemented"); } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/SelectExpression.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/SelectExpression.java index 8b78d03099..2bc6ae0ae6 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/SelectExpression.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/expressions/SelectExpression.java @@ -32,6 +32,7 @@ import com.apple.foundationdb.record.query.plan.cascades.IterableHelpers; import com.apple.foundationdb.record.query.plan.cascades.LinkedIdentityMap; import com.apple.foundationdb.record.query.plan.cascades.MatchInfo; +import com.apple.foundationdb.record.query.plan.cascades.GroupByMappings; import com.apple.foundationdb.record.query.plan.cascades.MatchInfo.RegularMatchInfo; import com.apple.foundationdb.record.query.plan.cascades.PartialMatch; import com.apple.foundationdb.record.query.plan.cascades.PredicateMap; @@ -465,7 +466,8 @@ public Iterable subsumedBy(@Nonnull final RelationalExpression candid MaxMatchMap.compute(translatedResultValue, candidateExpression.getResultValue(), Quantifiers.aliases(candidateExpression.getQuantifiers()), bindingValueEquivalence); return RegularMatchInfo.tryMerge(bindingAliasMap, partialMatchMap, mergedParameterBindingMap, - PredicateMap.empty(), maxMatchMap, maxMatchMap.getQueryPlanConstraint()) + PredicateMap.empty(), maxMatchMap, GroupByMappings.empty(), null, + maxMatchMap.getQueryPlanConstraint()) .map(ImmutableList::of) .orElse(ImmutableList.of()); } else { @@ -584,7 +586,7 @@ public Iterable subsumedBy(@Nonnull final RelationalExpression candid bindingValueEquivalence); return RegularMatchInfo.tryMerge(bindingAliasMap, partialMatchMap, allParameterBindingMap, predicateMap, - maxMatchMap, + maxMatchMap, GroupByMappings.empty(), null, maxMatchMap.getQueryPlanConstraint()); }) .map(ImmutableList::of) @@ -596,7 +598,8 @@ public Iterable subsumedBy(@Nonnull final RelationalExpression candid @Nonnull @Override - public Optional adjustMatch(@Nonnull final PartialMatch partialMatch) { + public Optional adjustMatch(@Nonnull final PartialMatch partialMatch, + @Nonnull final Quantifier candidateQuantifier) { final var childMatchInfo = partialMatch.getMatchInfo(); for (final var predicate : getPredicates()) { @@ -620,6 +623,7 @@ public Optional adjustMatch(@Nonnull final PartialMatch partialMatch) .map(adjustedMaxMatchMap -> childMatchInfo.adjustedBuilder() .setMaxMatchMap(adjustedMaxMatchMap) + .setGroupByMappings(childMatchInfo.adjustGroupByMappings(candidateQuantifier)) .build()); } @@ -767,14 +771,16 @@ private static List flattenPredicate(@Nonnull final Class boundParameterPrefixMap, @Nullable final PullUp pullUp, - @Nonnull final CorrelationIdentifier nestingAlias) { + @Nonnull final CorrelationIdentifier candidateAlias) { final var predicateCompensationMap = new LinkedIdentityMap(); final var matchInfo = partialMatch.getMatchInfo(); final var regularMatchInfo = partialMatch.getRegularMatchInfo(); final var quantifiers = getQuantifiers(); - final var adjustedPullUp = - partialMatch.nestPullUp(pullUp, nestingAlias); + final var nestedPullUpPair = + partialMatch.nestPullUp(pullUp, candidateAlias); + final var rootOfMatchPullUp = nestedPullUpPair.getKey(); + final var adjustedPullUp = Objects.requireNonNull(nestedPullUpPair.getRight()); // // The partial match we are called with here has child matches that have compensations on their own. @@ -840,11 +846,12 @@ public Compensation compensate(@Nonnull final PartialMatch partialMatch, break; } + if (compensationFunction == null) { + compensationFunction = compensationFunctionForCandidatePredicate; + } + if (!compensationFunctionForCandidatePredicate.isImpossible()) { isCompensationFunctionImpossible = false; - if (compensationFunction == null) { - compensationFunction = compensationFunctionForCandidatePredicate; - } } } @@ -852,34 +859,38 @@ public Compensation compensate(@Nonnull final PartialMatch partialMatch, isAnyCompensationFunctionNeeded = true; if (isCompensationFunctionImpossible) { isAnyCompensationFunctionImpossible = true; - } else { - predicateCompensationMap.put(predicate, Objects.requireNonNull(compensationFunction)); } + predicateCompensationMap.put(predicate, Objects.requireNonNull(compensationFunction)); } } } final ResultCompensationFunction resultCompensationFunction; - if (pullUp != null) { + final GroupByMappings groupByMappings; + if (rootOfMatchPullUp == null) { resultCompensationFunction = ResultCompensationFunction.noCompensationNeeded(); + groupByMappings = GroupByMappings.empty(); } else { - final var rootPullUp = adjustedPullUp.getRootPullUp(); final var maxMatchMap = matchInfo.getMaxMatchMap(); - final var pulledUpResultValueOptional = - rootPullUp.pullUpMaybe(maxMatchMap.getQueryValue()); - if (pulledUpResultValueOptional.isEmpty()) { + final var pulledUpTranslatedResultValueOptional = + rootOfMatchPullUp.pullUpValueMaybe(maxMatchMap.getQueryValue()); + if (pulledUpTranslatedResultValueOptional.isEmpty()) { return Compensation.impossibleCompensation(); } - final var pulledUpResultValue = pulledUpResultValueOptional.get(); + final var pulledUpTranslatedResultValue = pulledUpTranslatedResultValueOptional.get(); - if (QuantifiedObjectValue.isSimpleQuantifiedObjectValueOver(pulledUpResultValue, - rootPullUp.getNestingAlias())) { + if (QuantifiedObjectValue.isSimpleQuantifiedObjectValueOver(pulledUpTranslatedResultValue, + rootOfMatchPullUp.getCandidateAlias())) { resultCompensationFunction = ResultCompensationFunction.noCompensationNeeded(); } else { resultCompensationFunction = - ResultCompensationFunction.ofTranslation(pulledUpResultValue, rootPullUp.getNestingAlias()); + ResultCompensationFunction.ofValue(pulledUpTranslatedResultValue); } + isAnyCompensationFunctionImpossible |= resultCompensationFunction.isImpossible(); + + groupByMappings = + RegularMatchInfo.pullUpAggregateCandidateMappings(partialMatch, rootOfMatchPullUp); } final var isCompensationNeeded = @@ -910,6 +921,7 @@ public Compensation compensate(@Nonnull final PartialMatch partialMatch, getMatchedQuantifiers(partialMatch), partialMatch.getUnmatchedQuantifiers(), partialMatch.getCompensatedAliases(), - resultCompensationFunction); + resultCompensationFunction, + groupByMappings); } } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/matching/structure/PartialMatchMatchers.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/matching/structure/PartialMatchMatchers.java index d0a5f2e13a..7aa4579150 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/matching/structure/PartialMatchMatchers.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/matching/structure/PartialMatchMatchers.java @@ -21,7 +21,9 @@ package com.apple.foundationdb.record.query.plan.cascades.matching.structure; import com.apple.foundationdb.record.query.plan.RecordQueryPlannerConfiguration; +import com.apple.foundationdb.record.query.plan.cascades.AggregateIndexMatchCandidate; import com.apple.foundationdb.record.query.plan.cascades.PartialMatch; +import com.apple.foundationdb.record.query.plan.cascades.WithPrimaryKeyMatchCandidate; import javax.annotation.Nonnull; import java.util.stream.Stream; @@ -89,4 +91,47 @@ public Stream bindMatchesSafely(@Nonnull final RecordQueryPlann } }; } + + /** + * Matches any {@link PartialMatch} that is a match with a + * {@link com.apple.foundationdb.record.query.plan.cascades.MatchCandidate} that is backed by data structure that + * understands the concept of a primary key. Those match candidates are primary scan candidates, value indexes, + * and windowed indexes. + * @return a matcher matching a {@link PartialMatch} whose + * {@link com.apple.foundationdb.record.query.plan.cascades.MatchCandidate} implements + * {@link WithPrimaryKeyMatchCandidate}. + */ + @Nonnull + @SuppressWarnings("PMD.CompareObjectsWithEquals") + public static BindingMatcher matchingWithPrimaryKeyMatchCandidate() { + return new TypedMatcher<>(PartialMatch.class) { + @Nonnull + @Override + public Stream bindMatchesSafely(@Nonnull final RecordQueryPlannerConfiguration plannerConfiguration, + @Nonnull final PlannerBindings outerBindings, @Nonnull final PartialMatch in) { + return super.bindMatchesSafely(plannerConfiguration, outerBindings, in) + .filter(bindings -> in.getMatchCandidate() instanceof WithPrimaryKeyMatchCandidate); + } + }; + } + + /** + * Matches any {@link PartialMatch} that is a match with an {@link AggregateIndexMatchCandidate}. + * @return a matcher matching any partial match whose + * {@link com.apple.foundationdb.record.query.plan.cascades.MatchCandidate} is of type + * {@link AggregateIndexMatchCandidate}. + */ + @Nonnull + @SuppressWarnings("PMD.CompareObjectsWithEquals") + public static BindingMatcher matchingAggregateIndexMatchCandidate() { + return new TypedMatcher<>(PartialMatch.class) { + @Nonnull + @Override + public Stream bindMatchesSafely(@Nonnull final RecordQueryPlannerConfiguration plannerConfiguration, + @Nonnull final PlannerBindings outerBindings, @Nonnull final PartialMatch in) { + return super.bindMatchesSafely(plannerConfiguration, outerBindings, in) + .filter(bindings -> in.getMatchCandidate() instanceof AggregateIndexMatchCandidate); + } + }; + } } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/AndPredicate.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/AndPredicate.java index 1e284a189b..60192e55dd 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/AndPredicate.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/AndPredicate.java @@ -128,10 +128,10 @@ public AndPredicate withChildren(final Iterable newChi public PredicateCompensationFunction computeCompensationFunction(@Nonnull final PartialMatch partialMatch, @Nonnull final QueryPredicate originalQueryPredicate, @Nonnull final Map boundParameterPrefixMap, - @Nonnull final List childrenResults, + @Nonnull final List childrenCompensationFunctions, @Nonnull final PullUp pullUp) { boolean isNeeded = false; - for (final var childPredicateCompensationFunction : childrenResults) { + for (final var childPredicateCompensationFunction : childrenCompensationFunctions) { isNeeded |= childPredicateCompensationFunction.isNeeded(); if (childPredicateCompensationFunction.isImpossible()) { return PredicateCompensationFunction.impossibleCompensation(); @@ -142,12 +142,13 @@ public PredicateCompensationFunction computeCompensationFunction(@Nonnull final return PredicateCompensationFunction.noCompensationNeeded(); } - return PredicateCompensationFunction.of( - baseAlias -> childrenResults.stream() - .filter(PredicateCompensationFunction::isNeeded) - .flatMap(predicateCompensationFunction -> - predicateCompensationFunction.applyCompensationForPredicate(baseAlias).stream()) - .collect(LinkedIdentitySet.toLinkedIdentitySet())); + return PredicateCompensationFunction.ofChildrenCompensationFunctions(childrenCompensationFunctions, + (functions, baseAlias) -> + functions.stream() + .filter(PredicateCompensationFunction::isNeeded) + .flatMap(predicateCompensationFunction -> + predicateCompensationFunction.applyCompensationForPredicate(baseAlias).stream()) + .collect(LinkedIdentitySet.toLinkedIdentitySet())); } @Nonnull diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/ExistsPredicate.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/ExistsPredicate.java index 95a04e5853..4d8dc0f808 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/ExistsPredicate.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/ExistsPredicate.java @@ -36,9 +36,6 @@ import com.apple.foundationdb.record.query.plan.cascades.ConstrainedBoolean; import com.apple.foundationdb.record.query.plan.cascades.ComparisonRange; import com.apple.foundationdb.record.query.plan.cascades.CorrelationIdentifier; -import com.apple.foundationdb.record.query.plan.explain.ExplainTokens; -import com.apple.foundationdb.record.query.plan.explain.ExplainTokensWithPrecedence; -import com.apple.foundationdb.record.query.plan.cascades.LinkedIdentitySet; import com.apple.foundationdb.record.query.plan.cascades.Memoizer; import com.apple.foundationdb.record.query.plan.cascades.PartialMatch; import com.apple.foundationdb.record.query.plan.cascades.PredicateMultiMap.PredicateCompensationFunction; @@ -49,6 +46,8 @@ import com.apple.foundationdb.record.query.plan.cascades.values.QuantifiedObjectValue; import com.apple.foundationdb.record.query.plan.cascades.values.translation.PullUp; import com.apple.foundationdb.record.query.plan.cascades.values.translation.TranslationMap; +import com.apple.foundationdb.record.query.plan.explain.ExplainTokens; +import com.apple.foundationdb.record.query.plan.explain.ExplainTokensWithPrecedence; import com.google.auto.service.AutoService; import com.google.common.base.Verify; import com.google.common.collect.ImmutableSet; @@ -238,7 +237,7 @@ private PredicateCompensationFunction computeCompensationFunction(@Nonnull final // Note that this predicate does NOT need to be pulled up as the existential quantifier is separately // added in. // - return PredicateCompensationFunction.of(baseAlias -> LinkedIdentitySet.of(originalExistsPredicate)); + return PredicateCompensationFunction.ofExistentialPredicate(originalExistsPredicate); } return PredicateCompensationFunction.noCompensationNeeded(); } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/LeafQueryPredicate.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/LeafQueryPredicate.java index 57d68eed27..c7d33ebfbe 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/LeafQueryPredicate.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/LeafQueryPredicate.java @@ -23,11 +23,9 @@ import com.apple.foundationdb.annotation.API; import com.apple.foundationdb.record.query.plan.cascades.ComparisonRange; import com.apple.foundationdb.record.query.plan.cascades.CorrelationIdentifier; -import com.apple.foundationdb.record.query.plan.cascades.LinkedIdentitySet; import com.apple.foundationdb.record.query.plan.cascades.PartialMatch; import com.apple.foundationdb.record.query.plan.cascades.PredicateMultiMap; import com.apple.foundationdb.record.query.plan.cascades.values.translation.PullUp; -import com.apple.foundationdb.record.query.plan.cascades.values.translation.TranslationMap; import com.google.common.base.Verify; import com.google.common.collect.ImmutableList; @@ -82,11 +80,8 @@ default PredicateMultiMap.PredicateCompensationFunction computeCompensationFunct @Nonnull default PredicateMultiMap.PredicateCompensationFunction computeCompensationFunctionForLeaf(@Nonnull final PullUp pullUp) { return toResidualPredicate() - .replaceValuesMaybe(pullUp::pullUpMaybe) - .map(queryPredicate -> - PredicateMultiMap.PredicateCompensationFunction.of(baseAlias -> - LinkedIdentitySet.of(queryPredicate.translateCorrelations( - TranslationMap.ofAliases(pullUp.getTopAlias(), baseAlias), false)))) + .replaceValuesMaybe(pullUp::pullUpValueMaybe) + .map(PredicateMultiMap.PredicateCompensationFunction::ofPredicate) .orElse(PredicateMultiMap.PredicateCompensationFunction.impossibleCompensation()); } } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/NotPredicate.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/NotPredicate.java index d23f41871b..53b3ecbca6 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/NotPredicate.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/NotPredicate.java @@ -149,18 +149,19 @@ public NotPredicate withChild(@Nonnull final QueryPredicate newChild) { public PredicateCompensationFunction computeCompensationFunction(@Nonnull final PartialMatch partialMatch, @Nonnull final QueryPredicate originalQueryPredicate, @Nonnull final Map boundParameterPrefixMap, - @Nonnull final List childrenResults, + @Nonnull final List childrenCompensationFunctions, @Nonnull final PullUp pullUp) { - Verify.verify(childrenResults.size() == 1); - final var predicateCompensationFunction = Iterables.getOnlyElement(childrenResults); + Verify.verify(childrenCompensationFunctions.size() == 1); + final var predicateCompensationFunction = Iterables.getOnlyElement(childrenCompensationFunctions); if (!predicateCompensationFunction.isNeeded()) { return PredicateCompensationFunction.noCompensationNeeded(); } - return PredicateCompensationFunction.of(baseAlias -> { - final var childPredicates = predicateCompensationFunction.applyCompensationForPredicate(baseAlias); - return LinkedIdentitySet.of(not(AndPredicate.and(childPredicates))); - }); + return PredicateCompensationFunction.ofChildrenCompensationFunctions(childrenCompensationFunctions, + (functions, baseAlias) -> { + final var childPredicates = Iterables.getOnlyElement(functions).applyCompensationForPredicate(baseAlias); + return LinkedIdentitySet.of(not(AndPredicate.and(childPredicates))); + }); } @Nonnull diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/OrPredicate.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/OrPredicate.java index a055ad4c9e..ee4215a8c1 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/OrPredicate.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/OrPredicate.java @@ -354,10 +354,10 @@ private Optional impliesWithValuesAndRanges(@Nonnull final Val public PredicateCompensationFunction computeCompensationFunction(@Nonnull final PartialMatch partialMatch, @Nonnull final QueryPredicate originalQueryPredicate, @Nonnull final Map boundParameterPrefixMap, - @Nonnull final List childrenResults, + @Nonnull final List childrenCompensationFunctions, @Nonnull final PullUp pullUp) { boolean isNeeded = false; - for (final var childPredicateCompensationFunction : childrenResults) { + for (final var childPredicateCompensationFunction : childrenCompensationFunctions) { isNeeded |= childPredicateCompensationFunction.isNeeded(); if (childPredicateCompensationFunction.isImpossible()) { return PredicateCompensationFunction.impossibleCompensation(); @@ -368,19 +368,20 @@ public PredicateCompensationFunction computeCompensationFunction(@Nonnull final return PredicateCompensationFunction.noCompensationNeeded(); } - return PredicateCompensationFunction.of(baseAlias -> { - final var childPredicatesList = - childrenResults.stream() - .filter(PredicateCompensationFunction::isNeeded) - .map(predicateCompensationFunction -> predicateCompensationFunction.applyCompensationForPredicate(baseAlias)) - .collect(ImmutableList.toImmutableList()); - // take the predicates from each individual expansion, "and" them, and then "or" them - final var predicates = LinkedIdentitySet.of(); - for (final var childPredicates : childPredicatesList) { - predicates.add(AndPredicate.and(childPredicates)); - } - return LinkedIdentitySet.of(OrPredicate.or(predicates)); - }); + return PredicateCompensationFunction.ofChildrenCompensationFunctions(childrenCompensationFunctions, + (functions, baseAlias) -> { + final var childPredicatesList = + functions.stream() + .filter(PredicateCompensationFunction::isNeeded) + .map(predicateCompensationFunction -> predicateCompensationFunction.applyCompensationForPredicate(baseAlias)) + .collect(ImmutableList.toImmutableList()); + // take the predicates from each individual expansion, "and" them, and then "or" them + final var predicates = LinkedIdentitySet.of(); + for (final var childPredicates : childPredicatesList) { + predicates.add(AndPredicate.and(childPredicates)); + } + return LinkedIdentitySet.of(OrPredicate.or(predicates)); + }); } @Nonnull diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/QueryPredicate.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/QueryPredicate.java index e7bd8aecb3..9726f17172 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/QueryPredicate.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/QueryPredicate.java @@ -34,7 +34,6 @@ import com.apple.foundationdb.record.query.plan.cascades.ComparisonRange; import com.apple.foundationdb.record.query.plan.cascades.Correlated; import com.apple.foundationdb.record.query.plan.cascades.CorrelationIdentifier; -import com.apple.foundationdb.record.query.plan.cascades.LinkedIdentitySet; import com.apple.foundationdb.record.query.plan.cascades.Narrowable; import com.apple.foundationdb.record.query.plan.cascades.PartialMatch; import com.apple.foundationdb.record.query.plan.cascades.PredicateMultiMap.PredicateCompensation; @@ -248,11 +247,8 @@ default PredicateCompensationFunction computeCompensationFunction(@Nonnull final Verify.verify(childrenResults.isEmpty()); return toResidualPredicate() - .replaceValuesMaybe(pullUp::pullUpMaybe) - .map(queryPredicate -> - PredicateCompensationFunction.of(baseAlias -> - LinkedIdentitySet.of(queryPredicate.translateCorrelations( - TranslationMap.ofAliases(pullUp.getTopAlias(), baseAlias), false)))) + .replaceValuesMaybe(pullUp::pullUpValueMaybe) + .map(PredicateCompensationFunction::ofPredicate) .orElse(PredicateCompensationFunction.impossibleCompensation()); } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/properties/CardinalitiesProperty.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/properties/CardinalitiesProperty.java index 089396c7a5..bb3c90d6d3 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/properties/CardinalitiesProperty.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/properties/CardinalitiesProperty.java @@ -80,6 +80,7 @@ import com.apple.foundationdb.record.query.plan.plans.RecordQueryIntersectionOnValuesPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryLoadByKeysPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryMapPlan; +import com.apple.foundationdb.record.query.plan.plans.RecordQueryMultiIntersectionOnValuesPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryPredicatesFilterPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryRangePlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryRecursiveUnionPlan; @@ -298,7 +299,7 @@ public Cardinalities visitTempTableInsertPlan(@Nonnull final TempTableInsertPlan @Nonnull @Override public Cardinalities visitRecordQueryIntersectionOnValuesPlan(@Nonnull final RecordQueryIntersectionOnValuesPlan intersectionOnValuesPlan) { - return weakenCardinalities(fromChildren(intersectionOnValuesPlan)); + return intersectCardinalities(fromChildren(intersectionOnValuesPlan)); } @Nonnull @@ -439,6 +440,12 @@ public Cardinalities visitRecordQueryInUnionPlan(@Nonnull final RecordQueryInUni return inSourcesCardinalities.times(childCardinalities); } + @Nonnull + @Override + public Cardinalities visitRecordQueryMultiIntersectionOnValuesPlan(@Nonnull final RecordQueryMultiIntersectionOnValuesPlan recordQueryMultiIntersectionOnValuesPlan) { + return intersectCardinalities(fromChildren(recordQueryMultiIntersectionOnValuesPlan)); + } + @Nonnull @Override public Cardinalities visitRecordQueryInParameterJoinPlan(@Nonnull final RecordQueryInParameterJoinPlan element) { @@ -713,7 +720,8 @@ private Cardinalities intersectCardinalities(@Nonnull Iterable ca maxCardinality = cardinalities.getMaxCardinality(); } else { if (!cardinalities.getMaxCardinality().isUnknown()) { - maxCardinality = Cardinality.ofCardinality(Math.min(maxCardinality.getCardinality(), cardinalities.getMaxCardinality().getCardinality())); + maxCardinality = Cardinality.ofCardinality(Math.min(maxCardinality.getCardinality(), + cardinalities.getMaxCardinality().getCardinality())); } else { maxCardinality = Cardinality.unknownCardinality(); } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/properties/DerivationsProperty.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/properties/DerivationsProperty.java index f39d370dd2..2a14ad90ba 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/properties/DerivationsProperty.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/properties/DerivationsProperty.java @@ -24,6 +24,7 @@ import com.apple.foundationdb.annotation.SpotBugsSuppressWarnings; import com.apple.foundationdb.record.EvaluationContext; import com.apple.foundationdb.record.RecordCoreException; +import com.apple.foundationdb.record.query.combinatorics.CrossProduct; import com.apple.foundationdb.record.query.expressions.Comparisons; import com.apple.foundationdb.record.query.plan.bitmap.ComposedBitmapIndexQueryPlan; import com.apple.foundationdb.record.query.plan.cascades.AliasMap; @@ -31,18 +32,19 @@ import com.apple.foundationdb.record.query.plan.cascades.Reference; import com.apple.foundationdb.record.query.plan.cascades.Quantifier; import com.apple.foundationdb.record.query.plan.cascades.expressions.RelationalExpressionVisitor; -import com.apple.foundationdb.record.query.plan.cascades.values.FirstOrDefaultStreamingValue; -import com.apple.foundationdb.record.query.plan.cascades.values.translation.TranslationMap; import com.apple.foundationdb.record.query.plan.cascades.TreeLike; import com.apple.foundationdb.record.query.plan.cascades.expressions.RelationalExpression; import com.apple.foundationdb.record.query.plan.cascades.predicates.PredicateWithComparisons; import com.apple.foundationdb.record.query.plan.cascades.predicates.PredicateWithValue; import com.apple.foundationdb.record.query.plan.cascades.predicates.QueryPredicate; import com.apple.foundationdb.record.query.plan.cascades.typing.Type; +import com.apple.foundationdb.record.query.plan.cascades.values.FirstOrDefaultStreamingValue; import com.apple.foundationdb.record.query.plan.cascades.values.FirstOrDefaultValue; import com.apple.foundationdb.record.query.plan.cascades.values.QueriedValue; import com.apple.foundationdb.record.query.plan.cascades.values.ThrowsValue; import com.apple.foundationdb.record.query.plan.cascades.values.Value; +import com.apple.foundationdb.record.query.plan.cascades.values.translation.RegularTranslationMap; +import com.apple.foundationdb.record.query.plan.cascades.values.translation.TranslationMap; import com.apple.foundationdb.record.query.plan.plans.RecordQueryAggregateIndexPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryComparatorPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryCoveringIndexPlan; @@ -62,25 +64,24 @@ import com.apple.foundationdb.record.query.plan.plans.RecordQueryInValuesJoinPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryIndexPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryInsertPlan; -import com.apple.foundationdb.record.query.plan.plans.RecordQueryRecursiveUnionPlan; -import com.apple.foundationdb.record.query.plan.plans.RecordQueryTableFunctionPlan; -import com.apple.foundationdb.record.query.plan.plans.TempTableInsertPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryIntersectionOnKeyExpressionPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryIntersectionOnValuesPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryLoadByKeysPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryMapPlan; +import com.apple.foundationdb.record.query.plan.plans.RecordQueryMultiIntersectionOnValuesPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryPlanVisitor; import com.apple.foundationdb.record.query.plan.plans.RecordQueryPlanWithComparisonKeyValues; import com.apple.foundationdb.record.query.plan.plans.RecordQueryPlanWithComparisons; import com.apple.foundationdb.record.query.plan.plans.RecordQueryPredicatesFilterPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryRangePlan; +import com.apple.foundationdb.record.query.plan.plans.RecordQueryRecursiveUnionPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryScanPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryScoreForRankPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQuerySelectorPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQuerySetPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryStreamingAggregationPlan; -import com.apple.foundationdb.record.query.plan.plans.TempTableScanPlan; +import com.apple.foundationdb.record.query.plan.plans.RecordQueryTableFunctionPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryTextIndexPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryTypeFilterPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryUnionOnKeyExpressionPlan; @@ -89,12 +90,15 @@ import com.apple.foundationdb.record.query.plan.plans.RecordQueryUnorderedPrimaryKeyDistinctPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryUnorderedUnionPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryUpdatePlan; +import com.apple.foundationdb.record.query.plan.plans.TempTableInsertPlan; +import com.apple.foundationdb.record.query.plan.plans.TempTableScanPlan; import com.apple.foundationdb.record.query.plan.sorting.RecordQueryDamPlan; import com.apple.foundationdb.record.query.plan.sorting.RecordQuerySortPlan; import com.google.common.base.Verify; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; +import com.google.common.collect.Streams; import javax.annotation.Nonnull; import java.util.List; @@ -255,8 +259,8 @@ public Derivations visitInComparandJoinPlan(@Nonnull final RecordQueryInComparan @Nonnull @Override public Derivations visitAggregateIndexPlan(@Nonnull final RecordQueryAggregateIndexPlan aggregateIndexPlan) { - final var matchCandidate = aggregateIndexPlan.getMatchCandidate(); - return visitPlanWithComparisons(aggregateIndexPlan, matchCandidate.getQueriedRecordTypeNames()); + final var localValues = localValuesForComparisons(aggregateIndexPlan.getComparisons()); + return new Derivations(ImmutableList.of(), localValues); } @Nonnull @@ -280,7 +284,7 @@ public Derivations visitIntersectionOnKeyExpressionPlan(@Nonnull final RecordQue @Nonnull @Override public Derivations visitMapPlan(@Nonnull final RecordQueryMapPlan mapPlan) { - final Quantifier rangesOver = Iterables.getOnlyElement(mapPlan.getQuantifiers()); + final var rangesOver = Iterables.getOnlyElement(mapPlan.getQuantifiers()); final var childDerivations = derivationsFromQuantifier(rangesOver); final var childResultValues = childDerivations.getResultValues(); final var resultValue = mapPlan.getResultValue(); @@ -402,17 +406,20 @@ public Derivations visitRecursiveUnionPlan(@Nonnull final RecordQueryRecursiveUn @Nonnull private Derivations visitPlanWithComparisons(@Nonnull final RecordQueryPlanWithComparisons planWithComparisons, @Nonnull final Iterable recordTypeNames) { - final var comparisons = planWithComparisons.getComparisons(); - final var comparisonValues = comparisons.stream() - .map(Comparisons.Comparison::getValue) - .filter(Objects::nonNull) - .collect(ImmutableList.toImmutableList()); + final var comparisonValues = localValuesForComparisons(planWithComparisons.getComparisons()); final var resultValueFromPlan = planWithComparisons.getResultValue(); final var resultValue = new QueriedValue(resultValueFromPlan.getResultType(), recordTypeNames); - return new Derivations(ImmutableList.of(resultValue), comparisonValues); } + @Nonnull + private List localValuesForComparisons(@Nonnull final Iterable comparisons) { + return Streams.stream(comparisons) + .map(Comparisons.Comparison::getValue) + .filter(Objects::nonNull) + .collect(ImmutableList.toImmutableList()); + } + @Nonnull @Override public Derivations visitFirstOrDefaultPlan(@Nonnull final RecordQueryFirstOrDefaultPlan firstOrDefaultPlan) { @@ -557,6 +564,44 @@ public Derivations visitInUnionOnKeyExpressionPlan(@Nonnull final RecordQueryInU throw new RecordCoreException("unsupported plan operator"); } + @Nonnull + @Override + public Derivations visitMultiIntersectionOnValuesPlan(@Nonnull final RecordQueryMultiIntersectionOnValuesPlan multiIntersectionOnValuesPlan) { + final var intersectionResultValue = multiIntersectionOnValuesPlan.getResultValue(); + final var resultValuesBuilder = ImmutableList.builder(); + final var localValuesBuilder = ImmutableList.builder(); + + final var resultDerivationsBuilder = ImmutableList.>builder(); + + final var quantifiers = multiIntersectionOnValuesPlan.getQuantifiers(); + + for (final var quantifier : quantifiers) { + final var childDerivations = derivationsFromQuantifier(quantifier); + resultDerivationsBuilder.add(childDerivations.getResultValues()); + localValuesBuilder.addAll(childDerivations.getLocalValues()); + } + + final var crossProductIterable = + CrossProduct.crossProduct(resultDerivationsBuilder.build()); + + for (final var element : crossProductIterable) { + final var translationMapBuilder = RegularTranslationMap.builder(); + for (int i = 0; i < quantifiers.size(); i++) { + final var quantifier = quantifiers.get(i); + final var derivationResultValue = element.get(i); + translationMapBuilder.when(quantifier.getAlias()) + .then((alias, leafValue) -> derivationResultValue); + } + resultValuesBuilder.add(intersectionResultValue.translateCorrelations(translationMapBuilder.build())); + } + final var resultValues = resultValuesBuilder.build(); + + localValuesBuilder.addAll(derivationsFromComparisonKeyValues(multiIntersectionOnValuesPlan, resultValues)); + + return new Derivations(resultValues, localValuesBuilder.build()); + + } + @Nonnull @Override public Derivations visitInParameterJoinPlan(@Nonnull final RecordQueryInParameterJoinPlan inParameterJoinPlan) { @@ -687,18 +732,25 @@ private Derivations visitSetPlan(@Nonnull final RecordQuerySetPlan setPlan) { final var resultValues = resultValuesBuilder.build(); + localValuesBuilder.addAll(derivationsFromComparisonKeyValues(setPlan, resultValues)); + + return new Derivations(resultValues, localValuesBuilder.build()); + } + + private static List derivationsFromComparisonKeyValues(@Nonnull final RecordQuerySetPlan setPlan, + @Nonnull final ImmutableList resultValues) { + final var resultBuilder = ImmutableList.builder(); if (setPlan instanceof RecordQueryPlanWithComparisonKeyValues) { for (final var comparisonKeyValue : ((RecordQueryPlanWithComparisonKeyValues)setPlan).getComparisonKeyValues()) { for (final var resultValue : resultValues) { final var translationMap = TranslationMap.regularBuilder() .when(Quantifier.current()).then((sourceAlias, leafValue) -> resultValue) .build(); - localValuesBuilder.add(comparisonKeyValue.translateCorrelations(translationMap, true)); + resultBuilder.add(comparisonKeyValue.translateCorrelations(translationMap, true)); } } } - - return new Derivations(resultValues, localValuesBuilder.build()); + return resultBuilder.build(); } @Nonnull diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/properties/DistinctRecordsProperty.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/properties/DistinctRecordsProperty.java index 4118cfaa1d..b6b9bbd095 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/properties/DistinctRecordsProperty.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/properties/DistinctRecordsProperty.java @@ -47,6 +47,7 @@ import com.apple.foundationdb.record.query.plan.plans.RecordQueryInValuesJoinPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryIndexPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryInsertPlan; +import com.apple.foundationdb.record.query.plan.plans.RecordQueryMultiIntersectionOnValuesPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryRecursiveUnionPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryTableFunctionPlan; import com.apple.foundationdb.record.query.plan.plans.TempTableInsertPlan; @@ -335,6 +336,12 @@ public Boolean visitInUnionOnKeyExpressionPlan(@Nonnull final RecordQueryInUnion return true; } + @Nonnull + @Override + public Boolean visitMultiIntersectionOnValuesPlan(@Nonnull final RecordQueryMultiIntersectionOnValuesPlan element) { + return true; + } + @Nonnull @Override public Boolean visitInParameterJoinPlan(@Nonnull final RecordQueryInParameterJoinPlan inParameterJoinPlan) { diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/properties/OrderingProperty.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/properties/OrderingProperty.java index 1c9440608e..24c9a58014 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/properties/OrderingProperty.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/properties/OrderingProperty.java @@ -60,6 +60,7 @@ import com.apple.foundationdb.record.query.plan.plans.RecordQueryInValuesJoinPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryIndexPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryInsertPlan; +import com.apple.foundationdb.record.query.plan.plans.RecordQueryMultiIntersectionOnValuesPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryRecursiveUnionPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryTableFunctionPlan; import com.apple.foundationdb.record.query.plan.plans.TempTableScanPlan; @@ -515,6 +516,14 @@ public Ordering visitInUnionOnKeyExpressionPlan(@Nonnull final RecordQueryInUnio return Ordering.empty(); } + @Nonnull + @Override + public Ordering visitMultiIntersectionOnValuesPlan(@Nonnull final RecordQueryMultiIntersectionOnValuesPlan multiIntersectionOnValuesPlan) { + final var orderings = orderingsFromChildren(multiIntersectionOnValuesPlan); + return deriveForDistinctSetOperationFromOrderings(orderings, + multiIntersectionOnValuesPlan.getComparisonKeyOrderingParts(), Ordering.INTERSECTION); + } + @Nonnull @Override public Ordering visitInParameterJoinPlan(@Nonnull final RecordQueryInParameterJoinPlan inParameterJoinPlan) { diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/properties/PrimaryKeyProperty.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/properties/PrimaryKeyProperty.java index 0701fabc82..d12f0706a9 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/properties/PrimaryKeyProperty.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/properties/PrimaryKeyProperty.java @@ -48,6 +48,7 @@ import com.apple.foundationdb.record.query.plan.plans.RecordQueryInValuesJoinPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryIndexPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryInsertPlan; +import com.apple.foundationdb.record.query.plan.plans.RecordQueryMultiIntersectionOnValuesPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryRecursiveUnionPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryTableFunctionPlan; import com.apple.foundationdb.record.query.plan.plans.TempTableScanPlan; @@ -357,6 +358,12 @@ public Optional> visitInUnionOnKeyExpressionPlan(@Nonnull final Reco return primaryKeyFromSingleChild(inUnionOnKeyExpressionPlan); } + @Nonnull + @Override + public Optional> visitMultiIntersectionOnValuesPlan(@Nonnull final RecordQueryMultiIntersectionOnValuesPlan element) { + return Optional.empty(); + } + @Nonnull @Override public Optional> visitInParameterJoinPlan(@Nonnull final RecordQueryInParameterJoinPlan inParameterJoinPlan) { diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/properties/StoredRecordProperty.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/properties/StoredRecordProperty.java index 0ed00eabcf..002aa992f1 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/properties/StoredRecordProperty.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/properties/StoredRecordProperty.java @@ -45,6 +45,7 @@ import com.apple.foundationdb.record.query.plan.plans.RecordQueryInValuesJoinPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryIndexPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryInsertPlan; +import com.apple.foundationdb.record.query.plan.plans.RecordQueryMultiIntersectionOnValuesPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryRecursiveUnionPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryTableFunctionPlan; import com.apple.foundationdb.record.query.plan.plans.TempTableInsertPlan; @@ -317,6 +318,12 @@ public Boolean visitInUnionOnKeyExpressionPlan(@Nonnull final RecordQueryInUnion return true; } + @Nonnull + @Override + public Boolean visitMultiIntersectionOnValuesPlan(@Nonnull final RecordQueryMultiIntersectionOnValuesPlan element) { + return false; + } + @Nonnull @Override public Boolean visitInParameterJoinPlan(@Nonnull final RecordQueryInParameterJoinPlan inParameterJoinPlan) { diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/AbstractDataAccessRule.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/AbstractDataAccessRule.java index c98ed6dd73..e61a15f5ce 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/AbstractDataAccessRule.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/AbstractDataAccessRule.java @@ -28,6 +28,8 @@ import com.apple.foundationdb.record.query.plan.cascades.CascadesRuleCall; import com.apple.foundationdb.record.query.plan.cascades.ComparisonRange; import com.apple.foundationdb.record.query.plan.cascades.Compensation; +import com.apple.foundationdb.record.query.plan.cascades.CorrelationIdentifier; +import com.apple.foundationdb.record.query.plan.cascades.GroupByMappings; import com.apple.foundationdb.record.query.plan.cascades.LinkedIdentitySet; import com.apple.foundationdb.record.query.plan.cascades.MatchCandidate; import com.apple.foundationdb.record.query.plan.cascades.MatchPartition; @@ -40,12 +42,12 @@ import com.apple.foundationdb.record.query.plan.cascades.PlanContext; import com.apple.foundationdb.record.query.plan.cascades.PrimaryScanMatchCandidate; import com.apple.foundationdb.record.query.plan.cascades.Quantifier; +import com.apple.foundationdb.record.query.plan.cascades.Quantifiers; import com.apple.foundationdb.record.query.plan.cascades.Reference; import com.apple.foundationdb.record.query.plan.cascades.ReferencedFieldsConstraint; import com.apple.foundationdb.record.query.plan.cascades.RequestedOrdering; import com.apple.foundationdb.record.query.plan.cascades.RequestedOrderingConstraint; import com.apple.foundationdb.record.query.plan.cascades.ValueIndexScanMatchCandidate; -import com.apple.foundationdb.record.query.plan.cascades.WithPrimaryKeyMatchCandidate; import com.apple.foundationdb.record.query.plan.cascades.debug.Debugger; import com.apple.foundationdb.record.query.plan.cascades.expressions.LogicalDistinctExpression; import com.apple.foundationdb.record.query.plan.cascades.expressions.LogicalIntersectionExpression; @@ -53,16 +55,19 @@ import com.apple.foundationdb.record.query.plan.cascades.matching.structure.BindingMatcher; import com.apple.foundationdb.record.query.plan.cascades.properties.CardinalitiesProperty.Cardinality; import com.apple.foundationdb.record.query.plan.cascades.values.Value; -import com.apple.foundationdb.record.query.plan.plans.RecordQueryIntersectionPlan; +import com.apple.foundationdb.record.query.plan.cascades.values.translation.RegularTranslationMap; +import com.apple.foundationdb.record.query.plan.cascades.values.translation.TranslationMap; import com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan; -import com.apple.foundationdb.record.query.plan.plans.RecordQuerySetPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryUnorderedPrimaryKeyDistinctPlan; import com.apple.foundationdb.record.util.pair.NonnullPair; +import com.apple.foundationdb.record.util.pair.Pair; +import com.google.common.base.Suppliers; import com.google.common.base.Verify; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSetMultimap; +import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import org.slf4j.Logger; @@ -74,12 +79,18 @@ import java.util.BitSet; import java.util.Collection; import java.util.Comparator; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; import java.util.Set; import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collectors; +import java.util.stream.Stream; import static com.apple.foundationdb.record.query.plan.cascades.properties.CardinalitiesProperty.cardinalities; @@ -123,6 +134,98 @@ protected BindingMatcher getExpressionMatcher() { return expressionMatcher; } + @Override + public void onMatch(@Nonnull final CascadesRuleCall call) { + final var bindings = call.getBindings(); + final var completeMatches = bindings.getAll(getCompleteMatchMatcher()); + if (completeMatches.isEmpty()) { + return; + } + + final var expression = bindings.get(getExpressionMatcher()); + + // + // return if there is no pre-determined interesting ordering + // + final var requestedOrderingsOptional = + call.getPlannerConstraintMaybe(RequestedOrderingConstraint.REQUESTED_ORDERING); + if (requestedOrderingsOptional.isEmpty()) { + return; + } + + final var requestedOrderings = requestedOrderingsOptional.get(); + final var aliasToQuantifierMap = Quantifiers.aliasToQuantifierMap(expression.getQuantifiers()); + final var aliases = aliasToQuantifierMap.keySet(); + + // group all successful matches by their sets of compensated aliases + final var matchPartitionByMatchAliasMap = + completeMatches + .stream() + .flatMap(match -> { + final var compensatedAliases = match.getCompensatedAliases(); + if (!compensatedAliases.containsAll(aliases)) { + return Stream.empty(); + } + final Set matchedForEachAliases = + compensatedAliases.stream() + .filter(matchedAlias -> + Objects.requireNonNull(aliasToQuantifierMap.get(matchedAlias)) instanceof Quantifier.ForEach) + .collect(ImmutableSet.toImmutableSet()); + if (matchedForEachAliases.size() == 1) { + return Stream.of(NonnullPair.of(Iterables.getOnlyElement(matchedForEachAliases), match)); + } + return Stream.empty(); + }) + .collect(Collectors.groupingBy( + Pair::getLeft, + LinkedHashMap::new, + Collectors.mapping(Pair::getRight, ImmutableList.toImmutableList()))); + + // loop through all compensated alias sets and their associated match partitions + for (final var matchPartitionByMatchAliasEntry : matchPartitionByMatchAliasMap.entrySet()) { + final var matchPartitionForMatchedAlias = + matchPartitionByMatchAliasEntry.getValue(); + + // + // We do know that local predicates (which includes predicates only using the matchedAlias quantifier) + // are definitely handled by the logic expressed by the partial matches of the current match partition. + // Join predicates are different in a sense that there will be matches that handle those predicates and + // there will be matches where these predicates will not be handled. We further need to sub-partition the + // current match partition, by the predicates that are being handled by the matches. + // + // TODO this should just be exactly one key + final var matchPartitionsForAliasesByPredicates = + matchPartitionForMatchedAlias + .stream() + .collect(Collectors.groupingBy(match -> + new LinkedIdentitySet<>(match.getRegularMatchInfo().getPredicateMap().keySet()), + HashMap::new, + ImmutableList.toImmutableList())); + + // + // Note that this works because there is only one for-each and potentially 0 - n existential quantifiers + // that are covered by the match partition. Even though that logically forms a join, the existential + // quantifiers do not mutate the result of the join, they only cause filtering, that is, the resulting + // record is exactly what the for each quantifier produced filtered by the predicates expressed on the + // existential quantifiers. + // + for (final var matchPartitionEntry : matchPartitionsForAliasesByPredicates.entrySet()) { + final var matchPartition = matchPartitionEntry.getValue(); + + // + // The current match partition covers all matches that match the aliases in matchedAliases + // as well as all predicates in matchedPredicates. In other words we now have to compensate + // for all the remaining quantifiers and all remaining predicates. + // + final var dataAccessExpressions = + dataAccessForMatchPartition(call, + requestedOrderings, + matchPartition); + call.yieldMixedUnknownExpressions(dataAccessExpressions); + } + } + } + /** * Method that does the leg work to create the appropriate expression dag for data access using value indexes or * value index-like scans (primary scans). @@ -280,18 +383,12 @@ protected Set dataAccessForMatchPartition(@Nonnu addToIntersectionInfoMap(intersectionInfoMap, bestMatchWithIndex, compensatedSingleAccessExpressionOptional); } - final var bestMatchToDistinctPlanMap = - distinctMatchToScanMap(call, bestMatchToPlanMap); - - final var commonPrimaryKeyValuesOptional = - WithPrimaryKeyMatchCandidate.commonPrimaryKeyValuesMaybe( - bestMaximumCoverageMatches.stream() - .map(singleMatchedAccessVectored -> singleMatchedAccessVectored.getElement().getPartialMatch().getMatchCandidate()) - .collect(ImmutableList.toImmutableList())); - if (commonPrimaryKeyValuesOptional.isEmpty() || bestMaximumCoverageMatches.size() == 1) { + if (bestMaximumCoverageMatches.size() == 1) { return intersectionInfoMapToExpressions(intersectionInfoMap); } - final var commonPrimaryKeyValues = commonPrimaryKeyValuesOptional.get(); + + final var bestMatchToDistinctPlanMap = + distinctMatchToScanMap(call, bestMatchToPlanMap); // // Create all combinations of scans for all best matches and intersect them. @@ -335,11 +432,10 @@ protected Set dataAccessForMatchPartition(@Nonnu createIntersectionAndCompensation( call, intersectionInfoMap, - commonPrimaryKeyValues, bestMatchToDistinctPlanMap, binaryPartition, requestedOrderings); - if (binaryIntersections.hasCommonIntersectionOrdering()) { + if (binaryIntersections.hasViableIntersection()) { updateIntersectionInfoMap(intersectionInfoMap, binaryPartition, binaryIntersections); } else { if (sieveBitMatrix != null) { @@ -393,12 +489,14 @@ protected Set dataAccessForMatchPartition(@Nonnu createIntersectionAndCompensation( call, intersectionInfoMap, - commonPrimaryKeyValues, bestMatchToDistinctPlanMap, kPartition, requestedOrderings); - Verify.verify(intersectionResult.hasCommonIntersectionOrdering()); + if (!intersectionResult.hasViableIntersection()) { + continue; + } + hasCommonOrderingForK = true; updateIntersectionInfoMap(intersectionInfoMap, kPartition, intersectionResult); @@ -539,7 +637,13 @@ private static List prepareMatchesAndCompensations(final @N final @Nonnull Set requestedOrderings) { final var partialMatchesWithCompensation = new ArrayList(); for (final var partialMatch: partialMatches) { - final var satisfyingOrderingsPairOptional = satisfiesAnyRequestedOrderings(partialMatch, requestedOrderings); + final var topToTopTranslationMapOptional = computeTopToTopTranslationMapMaybe(partialMatch); + if (topToTopTranslationMapOptional.isEmpty()) { + continue; + } + final var topToTopTranslationMap = topToTopTranslationMapOptional.get(); + final var satisfyingOrderingsPairOptional = + satisfiesAnyRequestedOrderings(partialMatch, topToTopTranslationMap, requestedOrderings); if (satisfyingOrderingsPairOptional.isEmpty()) { continue; } @@ -549,11 +653,17 @@ private static List prepareMatchesAndCompensations(final @N Verify.verify(scanDirection == ScanDirection.FORWARD || scanDirection == ScanDirection.REVERSE || scanDirection == ScanDirection.BOTH); - final var compensation = partialMatch.compensateCompleteMatch(); + final var topAlias = Quantifier.uniqueId(); + final var candidateTopAlias = Quantifier.uniqueId(); + final var unificationPullUp = + partialMatch.prepareForUnification(topAlias, candidateTopAlias); + final var compensation = + partialMatch.compensateCompleteMatch(unificationPullUp, + unificationPullUp == null ? topAlias : candidateTopAlias); if (scanDirection == ScanDirection.FORWARD || scanDirection == ScanDirection.BOTH) { partialMatchesWithCompensation.add(new SingleMatchedAccess(partialMatch, compensation, - false, satisfyingOrderingsPair.getRight())); + topAlias, false, topToTopTranslationMap, satisfyingOrderingsPair.getRight())); } // @@ -566,7 +676,7 @@ private static List prepareMatchesAndCompensations(final @N // if (scanDirection == ScanDirection.REVERSE /* || scanDirection == ScanDirection.BOTH */) { partialMatchesWithCompensation.add(new SingleMatchedAccess(partialMatch, compensation, - true, satisfyingOrderingsPair.getRight())); + topAlias, true, topToTopTranslationMap, satisfyingOrderingsPair.getRight())); } } @@ -576,6 +686,12 @@ private static List prepareMatchesAndCompensations(final @N return partialMatchesWithCompensation; } + @Nonnull + private static Optional computeTopToTopTranslationMapMaybe(final PartialMatch partialMatch) { + final var maxMatchMap = partialMatch.getMatchInfo().getMaxMatchMap(); + return maxMatchMap.pullUpMaybe(Quantifier.current(), Quantifier.current()); + } + /** * Private helper method to compute the subset of orderings passed in that would be satisfied by a scan * if the given {@link PartialMatch} were to be planned. @@ -588,15 +704,19 @@ private static List prepareMatchesAndCompensations(final @N @Nonnull @SuppressWarnings("java:S135") private static Optional>> satisfiesAnyRequestedOrderings(@Nonnull final PartialMatch partialMatch, + @Nonnull final TranslationMap topToTopTranslationMap, @Nonnull final Set requestedOrderings) { boolean seenForward = false; boolean seenReverse = false; final var satisfyingRequestedOrderings = ImmutableSet.builder(); for (final var requestedOrdering : requestedOrderings) { + final var translatedRequestedOrdering = + requestedOrdering.translateCorrelations(topToTopTranslationMap, true); + final var scanDirectionForRequestedOrderingOptional = - satisfiesRequestedOrdering(partialMatch, requestedOrdering); + satisfiesRequestedOrdering(partialMatch, translatedRequestedOrdering); if (scanDirectionForRequestedOrderingOptional.isPresent()) { - satisfyingRequestedOrderings.add(requestedOrdering); + satisfyingRequestedOrderings.add(translatedRequestedOrdering); // Note, that a match may satisfy one requested ordering using a forward scan and another requested // ordering using a reverse scan. final var scanDirectionForRequestedOrdering = scanDirectionForRequestedOrderingOptional.get(); @@ -725,7 +845,8 @@ private static Map createScansForMatches(@Nonnull final var singleMatchedAccess = singleMatchedAccessVectored.getElement(); final var partialMatch = singleMatchedAccess.getPartialMatch(); return partialMatch.getMatchCandidate() - .toEquivalentPlan(partialMatch, planContext, memoizer, singleMatchedAccess.isReverseScanOrder()); + .toEquivalentPlan(partialMatch, planContext, memoizer, + singleMatchedAccess.isReverseScanOrder()); })); } @@ -778,18 +899,19 @@ private static Optional applyCompensationForSingleDataAcce if (compensation.isImpossible()) { return Optional.empty(); } - return Optional.of(compensation.applyAllNeededCompensations(memoizer, plan)); + return Optional.of(compensation.applyAllNeededCompensations(memoizer, plan, + realizedAlias -> + TranslationMap.ofAliases(singleMatchedAccess.getCandidateTopAlias(), realizedAlias))); } /** - * Private helper method to plan an intersection and subsequently compensate it using the partial match structures + * Protected helper method to plan an intersection and subsequently compensate it using the partial match structures * kept for all participating data accesses. * Planning the data access and its compensation for a given match is a two-step approach as we compute * the compensation for intersections by intersecting the {@link Compensation} for the single data accesses first * before using the resulting {@link Compensation} to compute the compensating expression for the entire * intersection. * @param memoizer the memoizer - * @param commonPrimaryKeyValues normalized common primary key * @param matchToPlanMap a map from match to single data access expression * @param partition a partition (i.e. a list of {@link SingleMatchedAccess}es that the caller would like to compute * and intersected data access for @@ -798,87 +920,15 @@ private static Optional applyCompensationForSingleDataAcce * realized data access and its compensation. */ @Nonnull - private static IntersectionResult createIntersectionAndCompensation(@Nonnull final Memoizer memoizer, - @Nonnull final Map intersectionInfoMap, - @Nonnull final List commonPrimaryKeyValues, - @Nonnull final Map matchToPlanMap, - @Nonnull final List> partition, - @Nonnull final Set requestedOrderings) { - final var partitionOrderings = - partition.stream() - .map(Vectored::getElement) - .map(AbstractDataAccessRule::adjustMatchedOrderingParts) - .collect(ImmutableList.toImmutableList()); - final var intersectionOrdering = intersectOrderings(partitionOrderings); - - final var equalityBoundKeyValues = - partitionOrderings - .stream() - .flatMap(orderingPartsPair -> - orderingPartsPair.getKey() - .stream() - .filter(boundOrderingKey -> boundOrderingKey.getComparisonRangeType() == ComparisonRange.Type.EQUALITY) - .map(MatchedOrderingPart::getValue)) - .collect(ImmutableSet.toImmutableSet()); - - final var isPartitionRedundant = - isPartitionRedundant(intersectionInfoMap, partition, equalityBoundKeyValues); - if (isPartitionRedundant) { - return IntersectionResult.of(ImmutableList.of(), null); - } - - boolean hasCommonOrdering = false; - final var expressionsBuilder = ImmutableList.builder(); - for (final var requestedOrdering : requestedOrderings) { - final var comparisonKeyValuesIterable = - intersectionOrdering.enumerateSatisfyingComparisonKeyValues(requestedOrdering); - for (final var comparisonKeyValues : comparisonKeyValuesIterable) { - if (!isCompatibleComparisonKey(comparisonKeyValues, - commonPrimaryKeyValues, - equalityBoundKeyValues)) { - continue; - } - - hasCommonOrdering = true; - - final var compensation = - partition - .stream() - .map(pair -> pair.getElement().getCompensation()) - .reduce(Compensation.impossibleCompensation(), Compensation::intersect); - - if (!compensation.isImpossible()) { - var comparisonOrderingParts = - intersectionOrdering.directionalOrderingParts(comparisonKeyValues, requestedOrdering, - OrderingPart.ProvidedSortOrder.FIXED); - final var comparisonIsReverse = - RecordQuerySetPlan.resolveComparisonDirection(comparisonOrderingParts); - comparisonOrderingParts = RecordQuerySetPlan.adjustFixedBindings(comparisonOrderingParts, comparisonIsReverse); - - final var newQuantifiers = - partition - .stream() - .map(pair -> Objects.requireNonNull(matchToPlanMap.get(pair.getElement().getPartialMatch()))) - .map(memoizer::memoizePlan) - .map(Quantifier::physical) - .collect(ImmutableList.toImmutableList()); - - final var intersectionPlan = - RecordQueryIntersectionPlan.fromQuantifiers(newQuantifiers, - comparisonOrderingParts, comparisonIsReverse); - final var compensatedIntersection = - compensation.applyAllNeededCompensations(memoizer, intersectionPlan); - expressionsBuilder.add(compensatedIntersection); - } - } - } - - return IntersectionResult.of(expressionsBuilder.build(), hasCommonOrdering ? intersectionOrdering : null); - } - - private static boolean isPartitionRedundant(@Nonnull final Map intersectionInfoMap, - @Nonnull final List> partition, - @Nonnull final ImmutableSet equalityBoundKeyValues) { + protected abstract IntersectionResult createIntersectionAndCompensation(@Nonnull Memoizer memoizer, + @Nonnull Map intersectionInfoMap, + @Nonnull Map matchToPlanMap, + @Nonnull List> partition, + @Nonnull Set requestedOrderings); + + protected static boolean isPartitionRedundant(@Nonnull final Map intersectionInfoMap, + @Nonnull final List> partition, + @Nonnull final ImmutableSet equalityBoundKeyValues) { // if one of the single accesses has a max cardinality of 0 or 1 it is not useful to create this intersection for (final var singleMatchedAccessWithIndex : partition) { final var infoKey = intersectionInfoKey(singleMatchedAccessWithIndex); @@ -889,17 +939,83 @@ private static boolean isPartitionRedundant(@Nonnull final Map> unmatchedIdsMaybe(@Nonnull final Map intersectionInfoMap, + @Nonnull final List> partition) { + final var iterator = partition.iterator(); + + var unmatchedIdsOptional = + unmatchedIdsMaybe(Objects.requireNonNull(intersectionInfoMap.get(intersectionInfoKey(iterator.next())))); + if (unmatchedIdsOptional.isEmpty()) { + return Optional.empty(); + } + + var intersectedUniqueIds = new LinkedHashSet<>(unmatchedIdsOptional.get()); + while (iterator.hasNext()) { + unmatchedIdsOptional = + unmatchedIdsMaybe(Objects.requireNonNull(intersectionInfoMap.get(intersectionInfoKey(iterator.next())))); + if (unmatchedIdsOptional.isEmpty()) { + return Optional.empty(); + } + intersectedUniqueIds.retainAll(unmatchedIdsOptional.get()); + } + + return Optional.of(intersectedUniqueIds); + } + + @Nonnull + private static Optional compensationMaybe(@Nonnull final IntersectionInfo intersectionInfo) { + final var compensation = intersectionInfo.getCompensation(); + if (!(compensation instanceof Compensation.WithSelectCompensation)) { + return Optional.empty(); + } + return Optional.of((Compensation.WithSelectCompensation)compensation); + } + + @Nonnull + private static Optional> unmatchedIdsMaybe(@Nonnull final IntersectionInfo intersectionInfo) { + if (!intersectionInfo.getCompensation().isNeeded()) { + return Optional.of(ImmutableSet.of()); + } + final var compensationOptional = compensationMaybe(intersectionInfo); + return compensationOptional.map(compensation -> + compensation.getGroupByMappings().getUnmatchedAggregatesMap().keySet()); + } + @Nonnull private static Ordering orderingFromSingleMatchedAccess(@Nonnull final SingleMatchedAccess singleMatchedAccess) { final var singlePartitionOrderingPartsPair = @@ -918,7 +1034,7 @@ private static Ordering orderingFromSingleMatchedAccess(@Nonnull final SingleMat * computed from */ @Nonnull - private static NonnullPair, Boolean> adjustMatchedOrderingParts(@Nonnull final SingleMatchedAccess singleMatchedAccess) { + protected static NonnullPair, Boolean> adjustMatchedOrderingParts(@Nonnull final SingleMatchedAccess singleMatchedAccess) { final var partialMatch = singleMatchedAccess.getPartialMatch(); final var boundParametersPrefixMap = partialMatch.getBoundParameterPrefixMap(); @@ -941,7 +1057,7 @@ private static NonnullPair, Boolean> adjustMatchedOrde */ @SuppressWarnings("java:S1066") @Nonnull - private static Ordering.Intersection intersectOrderings(@Nonnull final List, Boolean>> partitionOrderingPairs) { + protected static Ordering.Intersection intersectOrderings(@Nonnull final List, Boolean>> partitionOrderingPairs) { final var orderings = partitionOrderingPairs .stream() @@ -979,19 +1095,14 @@ private static Ordering orderingFromOrderingParts(final @Nonnull List comparisonKeyValues, - @Nonnull List commonPrimaryKeyValues, - @Nonnull ImmutableSet equalityBoundKeyValues) { - if (comparisonKeyValues.isEmpty()) { - // everything is in one row - return true; - } - - return commonPrimaryKeyValues + protected static boolean isCompatibleComparisonKey(@Nonnull Collection comparisonKeyValues, + @Nonnull List commonRecordKeyValues, + @Nonnull ImmutableSet equalityBoundKeyValues) { + return commonRecordKeyValues .stream() .filter(commonPrimaryKeyValue -> !equalityBoundKeyValues.contains(commonPrimaryKeyValue)) .allMatch(comparisonKeyValues::contains); @@ -1002,15 +1113,18 @@ private static void addToIntersectionInfoMap(@Nonnull final Map compensatedExpressionOptional) { final var cacheKey = new BitSet(); cacheKey.set(singleAccessWithIndex.getPosition()); - final var orderingFromSingleMatchedAccess = orderingFromSingleMatchedAccess(singleAccessWithIndex.getElement()); + final var singleMatchedAccess = singleAccessWithIndex.getElement(); + final var compensation = singleMatchedAccess.getCompensation(); + final var orderingFromSingleMatchedAccess = orderingFromSingleMatchedAccess(singleMatchedAccess); if (compensatedExpressionOptional.isEmpty()) { - intersectionInfoMap.put(cacheKey, IntersectionInfo.ofImpossibleAccess(orderingFromSingleMatchedAccess)); + intersectionInfoMap.put(cacheKey, IntersectionInfo.ofImpossibleAccess(orderingFromSingleMatchedAccess, + compensation)); } else { final var compensatedExpression = compensatedExpressionOptional.get(); final var cardinalities = cardinalities().evaluate(compensatedExpression); intersectionInfoMap.put(cacheKey, - IntersectionInfo.ofSingleAccess(orderingFromSingleMatchedAccess, compensatedExpression, + IntersectionInfo.ofSingleAccess(orderingFromSingleMatchedAccess, compensation, compensatedExpression, cardinalities.getMaxCardinality())); } } @@ -1027,7 +1141,7 @@ private static void updateIntersectionInfoMap(@Nonnull final Map= 2); final var cacheKey = intersectionInfoKey(partition); - if (intersectionResult.hasCommonIntersectionOrdering()) { + if (intersectionResult.hasViableIntersection()) { if (!intersectionResult.getExpressions().isEmpty()) { // This loop loops partition.size() times for (final var subPartition : ChooseK.chooseK(partition, partition.size() - 1)) { @@ -1038,7 +1152,7 @@ private static void updateIntersectionInfoMap(@Nonnull final Map satisfyingRequestedOrderings; + @Nonnull + private final Supplier pulledUpGroupByMappingsSupplier; public SingleMatchedAccess(@Nonnull final PartialMatch partialMatch, @Nonnull final Compensation compensation, + @Nonnull final CorrelationIdentifier candidateTopAlias, final boolean reverseScanOrder, + @Nonnull final TranslationMap topToTopTranslationMap, @Nonnull final Set satisfyingRequestedOrderings) { this.partialMatch = partialMatch; this.compensation = compensation; + this.candidateTopAlias = candidateTopAlias; this.reverseScanOrder = reverseScanOrder; this.satisfyingRequestedOrderings = ImmutableSet.copyOf(satisfyingRequestedOrderings); + this.topToTopTranslationMap = topToTopTranslationMap; + this.pulledUpGroupByMappingsSupplier = + Suppliers.memoize(() -> partialMatch.getMatchInfo() + .adjustGroupByMappings(Quantifier.current(), partialMatch.getCandidateRef().get())); } @Nonnull @@ -1099,17 +1226,40 @@ public Compensation getCompensation() { return compensation; } + @Nonnull + public CorrelationIdentifier getCandidateTopAlias() { + return candidateTopAlias; + } + public boolean isReverseScanOrder() { return reverseScanOrder; } + @Nonnull + public TranslationMap getTopToTopTranslationMap() { + return topToTopTranslationMap; + } + @Nonnull public Set getSatisfyingRequestedOrderings() { return satisfyingRequestedOrderings; } + + @Nonnull + public GroupByMappings getPulledUpGroupByMappingsForOrdering() { + return pulledUpGroupByMappingsSupplier.get(); + } + + @Override + public String toString() { + return "[" + partialMatch + ", " + compensation + + ", " + candidateTopAlias + + ", " + (reverseScanOrder ? "forward" : "reverse") + + ", " + satisfyingRequestedOrderings + ']'; + } } - private static class Vectored { + protected static class Vectored { @Nonnull private final T element; final int position; @@ -1155,17 +1305,21 @@ public static Vectored of(@Nonnull final T element, final int position) { } } - private static class IntersectionResult { - @Nonnull - private final List expressions; + protected static class IntersectionResult { @Nullable private final Ordering.Intersection commonIntersectionOrdering; + @Nonnull + private final Compensation compensation; + @Nonnull + private final List expressions; - private IntersectionResult(@Nonnull final List expressions, - @Nullable final Ordering.Intersection commonIntersectionOrdering) { + private IntersectionResult(@Nullable final Ordering.Intersection commonIntersectionOrdering, + @Nonnull final Compensation compensation, + @Nonnull final List expressions) { Verify.verify(commonIntersectionOrdering != null || expressions.isEmpty()); this.expressions = ImmutableList.copyOf(expressions); this.commonIntersectionOrdering = commonIntersectionOrdering; + this.compensation = compensation; } @Nonnull @@ -1173,7 +1327,7 @@ public List getExpressions() { return Objects.requireNonNull(expressions); } - public boolean hasCommonIntersectionOrdering() { + public boolean hasViableIntersection() { return commonIntersectionOrdering != null; } @@ -1183,36 +1337,52 @@ public Ordering.Intersection getCommonIntersectionOrdering() { } @Nonnull - public static IntersectionResult of(@Nonnull final List expressions, - @Nullable final Ordering.Intersection commonIntersectionOrdering) { - return new IntersectionResult(expressions, commonIntersectionOrdering); + public Compensation getCompensation() { + return compensation; + } + + @Nonnull + public static IntersectionResult noViableIntersection() { + return new IntersectionResult(null, Compensation.noCompensation(), ImmutableList.of()); + } + + @Nonnull + public static IntersectionResult of(@Nullable final Ordering.Intersection commonIntersectionOrdering, + @Nonnull final Compensation compensation, + @Nonnull final List expressions) { + return new IntersectionResult(commonIntersectionOrdering, compensation, expressions); } @Override public String toString() { - return "[" + expressions + ", ordering=" + - (commonIntersectionOrdering == null ? "no common ordering" : commonIntersectionOrdering) + "]"; + return "[ordering=" + + (commonIntersectionOrdering == null ? "no common ordering" : commonIntersectionOrdering) + ", " + + compensation + "]"; } } - private enum ScanDirection { + protected enum ScanDirection { FORWARD, REVERSE, BOTH } - private static class IntersectionInfo { + protected static class IntersectionInfo { @Nonnull private final Ordering intersectionOrdering; @Nonnull + private final Compensation compensation; + @Nonnull private final List expressions; @Nonnull private final Cardinality maxCardinality; private IntersectionInfo(@Nonnull final Ordering intersectionOrdering, + @Nonnull final Compensation compensation, @Nonnull final List expressions, @Nonnull final Cardinality maxCardinality) { this.intersectionOrdering = intersectionOrdering; + this.compensation = compensation; this.expressions = expressions; this.maxCardinality = maxCardinality; } @@ -1222,6 +1392,11 @@ public Ordering getIntersectionOrdering() { return intersectionOrdering; } + @Nonnull + public Compensation getCompensation() { + return compensation; + } + @Nonnull public List getExpressions() { return expressions; @@ -1238,20 +1413,24 @@ public void evictExpressions() { @Nonnull public static IntersectionInfo ofSingleAccess(@Nonnull final Ordering ordering, + @Nonnull final Compensation compensation, @Nonnull final RelationalExpression expression, @Nonnull final Cardinality maxCardinality) { - return new IntersectionInfo(ordering, Lists.newArrayList(expression), maxCardinality); + return new IntersectionInfo(ordering, compensation, Lists.newArrayList(expression), maxCardinality); } @Nonnull - public static IntersectionInfo ofImpossibleAccess(@Nonnull final Ordering ordering) { - return new IntersectionInfo(ordering, Lists.newArrayList(), Cardinality.unknownCardinality()); + public static IntersectionInfo ofImpossibleAccess(@Nonnull final Ordering ordering, + @Nonnull final Compensation compensation) { + return new IntersectionInfo(ordering, compensation, Lists.newArrayList(), Cardinality.unknownCardinality()); } @Nonnull public static IntersectionInfo ofIntersection(@Nonnull final Ordering ordering, + @Nonnull final Compensation compensation, @Nonnull final List expressions) { - return new IntersectionInfo(ordering, Lists.newArrayList(expressions), Cardinality.unknownCardinality()); + return new IntersectionInfo(ordering, compensation, Lists.newArrayList(expressions), + Cardinality.unknownCardinality()); } } } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/AdjustMatchRule.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/AdjustMatchRule.java index c7abf635ce..2f5c02b73f 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/AdjustMatchRule.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/AdjustMatchRule.java @@ -23,6 +23,7 @@ import com.apple.foundationdb.annotation.API; import com.apple.foundationdb.record.query.plan.cascades.CascadesRule; import com.apple.foundationdb.record.query.plan.cascades.CascadesRuleCall; +import com.apple.foundationdb.record.query.plan.cascades.Quantifier; import com.apple.foundationdb.record.query.plan.cascades.Reference; import com.apple.foundationdb.record.query.plan.cascades.MatchCandidate; import com.apple.foundationdb.record.query.plan.cascades.MatchInfo; @@ -49,7 +50,7 @@ *

  • referencing the {@link MatchCandidate}'s traversal w.r.t. the (partially) matched query.
  • *
  • does not have a corresponding match on the query side.
  • * - * For more information, see {@link RelationalExpression#adjustMatch(PartialMatch)}. + * For more information, see {@link RelationalExpression#adjustMatch(PartialMatch, Quantifier)}. * Currently the only such expression that can be absorbed is * {@link com.apple.foundationdb.record.query.plan.cascades.expressions.MatchableSortExpression}. * TODO Maybe that expression should just be a generic property-defining expression or properties should be kept on quantifiers. @@ -100,8 +101,9 @@ private Optional matchWithCandidate(@Nonnull final PartialMatch parti return Optional.empty(); } + final Quantifier candidateQuantifier = Iterables.getOnlyElement(candidateExpression.getQuantifiers()); final Reference otherRangesOver = - Iterables.getOnlyElement(candidateExpression.getQuantifiers()).getRangesOver(); + candidateQuantifier.getRangesOver(); if (!candidateExpression.getCorrelatedTo().equals(otherRangesOver.getCorrelatedTo())) { return Optional.empty(); @@ -111,6 +113,6 @@ private Optional matchWithCandidate(@Nonnull final PartialMatch parti return Optional.empty(); } - return candidateExpression.adjustMatch(partialMatch); + return candidateExpression.adjustMatch(partialMatch, candidateQuantifier); } } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/AggregateDataAccessRule.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/AggregateDataAccessRule.java new file mode 100644 index 0000000000..2745d1859e --- /dev/null +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/AggregateDataAccessRule.java @@ -0,0 +1,386 @@ +/* + * AggregateDataAccessRule.java + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2015-2021 Apple Inc. and the FoundationDB project authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.apple.foundationdb.record.query.plan.cascades.rules; + +import com.apple.foundationdb.annotation.API; +import com.apple.foundationdb.record.query.plan.cascades.AggregateIndexMatchCandidate; +import com.apple.foundationdb.record.query.plan.cascades.CascadesPlanner; +import com.apple.foundationdb.record.query.plan.cascades.Column; +import com.apple.foundationdb.record.query.plan.cascades.ComparisonRange; +import com.apple.foundationdb.record.query.plan.cascades.Compensation; +import com.apple.foundationdb.record.query.plan.cascades.CorrelationIdentifier; +import com.apple.foundationdb.record.query.plan.cascades.MatchPartition; +import com.apple.foundationdb.record.query.plan.cascades.Memoizer; +import com.apple.foundationdb.record.query.plan.cascades.OrderingPart; +import com.apple.foundationdb.record.query.plan.cascades.PartialMatch; +import com.apple.foundationdb.record.query.plan.cascades.Quantifier; +import com.apple.foundationdb.record.query.plan.cascades.RequestedOrdering; +import com.apple.foundationdb.record.query.plan.cascades.ValueEquivalence; +import com.apple.foundationdb.record.query.plan.cascades.expressions.RelationalExpression; +import com.apple.foundationdb.record.query.plan.cascades.matching.structure.BindingMatcher; +import com.apple.foundationdb.record.query.plan.cascades.typing.Type; +import com.apple.foundationdb.record.query.plan.cascades.values.QuantifiedObjectValue; +import com.apple.foundationdb.record.query.plan.cascades.values.RecordConstructorValue; +import com.apple.foundationdb.record.query.plan.cascades.values.Value; +import com.apple.foundationdb.record.query.plan.cascades.values.Values; +import com.apple.foundationdb.record.query.plan.cascades.values.translation.RegularTranslationMap; +import com.apple.foundationdb.record.query.plan.cascades.values.translation.TranslationMap; +import com.apple.foundationdb.record.query.plan.plans.RecordQueryMultiIntersectionOnValuesPlan; +import com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan; +import com.apple.foundationdb.record.query.plan.plans.RecordQuerySetPlan; +import com.apple.foundationdb.record.util.pair.NonnullPair; +import com.google.common.base.Verify; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; + +import javax.annotation.Nonnull; +import java.util.BitSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; + +import static com.apple.foundationdb.record.query.plan.cascades.matching.structure.MatchPartitionMatchers.ofExpressionAndMatches; +import static com.apple.foundationdb.record.query.plan.cascades.matching.structure.MultiMatcher.some; +import static com.apple.foundationdb.record.query.plan.cascades.matching.structure.PartialMatchMatchers.completeMatch; +import static com.apple.foundationdb.record.query.plan.cascades.matching.structure.PartialMatchMatchers.matchingAggregateIndexMatchCandidate; +import static com.apple.foundationdb.record.query.plan.cascades.matching.structure.RelationalExpressionMatchers.anyExpression; + +/** + * A rule that utilizes index matching information compiled by {@link CascadesPlanner} to create a multitude of + * expressions for data access involving only {@link AggregateIndexMatchCandidate}. + */ +@API(API.Status.EXPERIMENTAL) +@SuppressWarnings("PMD.TooManyStaticImports") +public class AggregateDataAccessRule extends AbstractDataAccessRule { + private static final BindingMatcher completeMatchMatcher = + completeMatch().and(matchingAggregateIndexMatchCandidate()); + private static final BindingMatcher expressionMatcher = anyExpression(); + + private static final BindingMatcher rootMatcher = + ofExpressionAndMatches(expressionMatcher, some(completeMatchMatcher)); + + public AggregateDataAccessRule() { + super(rootMatcher, completeMatchMatcher, expressionMatcher); + } + + /** + * Method to compute the intersection of multiple compatibly-ordered index scans of aggregate indexes. This method + * utilizes {@link RecordQueryMultiIntersectionOnValuesPlan} which intersects {@code n} compatibly-ordered data + * streams of records comprised of the groupings and the aggregates of the underlying indexes. In contrast to the + * simpler {@link com.apple.foundationdb.record.query.plan.plans.RecordQueryIntersectionOnValuesPlan} which is + * used to intersect value indexes, a multi intersection allows us to associate the current records of all data + * streams by the use of a common comparison key (that identifies the group) and then freely to pick any datum + * from any participating stream. In this way, we can access the different aggregates flowed in the individuals + * stream. + *
    + * For instance, if the partition we are trying to intersect, flows the result of an index scan over a + * {@code SUM} index ({@code q1 := (a, b, SUM(c)}) and another flows the result of a {@code COUNT} index using an + * identical grouping ({@code q2: = (a, b, COUNT_STAR}), we can form a multi intersection using a comparison key + * {@code _.1, _2}. We can then also access the aggregates in individually, e.g. + * ({@code (q1._0, q1._1, q1._2, q2._2}) would return the groupings comprised of {@code a} and {@code b} as well + * as the sum and the count. + * @param memoizer the memoizer + * @param intersectionInfoMap a map that allows us to access information about other intersections of degree + * {@code n-1}. + * @param matchToPlanMap a map from match to single data access expression + * @param partition a partition (i.e. a list of {@link SingleMatchedAccess}es that the caller would like to compute + * and intersected data access for + * @param requestedOrderings a set of ordering that have been requested by consuming expressions/plan operators + * @return a new {@link IntersectionResult} + */ + @Nonnull + @Override + protected IntersectionResult createIntersectionAndCompensation(@Nonnull final Memoizer memoizer, + @Nonnull final Map intersectionInfoMap, + @Nonnull final Map matchToPlanMap, + @Nonnull final List> partition, + @Nonnull final Set requestedOrderings) { + Verify.verify(partition.size() > 1); + + final var partitionAccesses = + partition.stream() + .map(Vectored::getElement) + .collect(ImmutableList.toImmutableList()); + final var commonGroupingKeyValuesOptional = + commonGroupingKeyValuesMaybe( + partitionAccesses.stream() + .map(SingleMatchedAccess::getPartialMatch) + .collect(ImmutableList.toImmutableList())); + if (commonGroupingKeyValuesOptional.isEmpty()) { + return IntersectionResult.noViableIntersection(); + } + final var commonGroupingKeyValues = commonGroupingKeyValuesOptional.get(); + + final var partitionOrderings = + partitionAccesses.stream() + .map(AbstractDataAccessRule::adjustMatchedOrderingParts) + .collect(ImmutableList.toImmutableList()); + final var intersectionOrdering = intersectOrderings(partitionOrderings); + + final var equalityBoundKeyValues = + partitionOrderings + .stream() + .flatMap(orderingPartsPair -> + orderingPartsPair.getKey() + .stream() + .filter(boundOrderingKey -> boundOrderingKey.getComparisonRangeType() == + ComparisonRange.Type.EQUALITY) + .map(OrderingPart.MatchedOrderingPart::getValue)) + .collect(ImmutableSet.toImmutableSet()); + + final var isPartitionRedundant = + isPartitionRedundant(intersectionInfoMap, partition, equalityBoundKeyValues); + if (isPartitionRedundant) { + return IntersectionResult.noViableIntersection(); + } + + final var compensation = + partitionAccesses + .stream() + .map(SingleMatchedAccess::getCompensation) + .reduce(Compensation.impossibleCompensation(), Compensation::intersect); + + // + // Grab the first matched access from the partition in order to translate to the required ordering + // to the candidate's top. This is only correct as long as the derivations are consistent among the indexes. + // We check that a bit further down. + // + final var firstMatchedAccess = partition.get(0).getElement(); + final var topToTopTranslationMap = firstMatchedAccess.getTopToTopTranslationMap(); + + boolean hasCommonOrdering = false; + final var expressionsBuilder = ImmutableList.builder(); + for (final var requestedOrdering : requestedOrderings) { + final var translatedRequestedOrdering = + requestedOrdering.translateCorrelations(topToTopTranslationMap, true); + + final var comparisonKeyValuesIterable = + intersectionOrdering.enumerateSatisfyingComparisonKeyValues(translatedRequestedOrdering); + for (final var comparisonKeyValues : comparisonKeyValuesIterable) { + // + // We need to ensure that the common record key, that is the key that is used to identify the + // entire record is part of the comparison key (unless it's equality-bound). + // + if (!isCompatibleComparisonKey(comparisonKeyValues, commonGroupingKeyValues, equalityBoundKeyValues)) { + continue; + } + + // + // We need to ensure that the comparison key has consistent translations to all participating + // candidates. For grouping values (and we only allow grouping values) that is rather straightforward. + // We map the grouping values from each match candidate one-by-one to the query side grouping values + // and see if they match across candidates. + // + if (!isConsistentComparisonKeyDerivations(partition, comparisonKeyValues)) { + continue; + } + + hasCommonOrdering = true; + if (!compensation.isImpossible()) { + var comparisonOrderingParts = + intersectionOrdering.directionalOrderingParts(comparisonKeyValues, translatedRequestedOrdering, + OrderingPart.ProvidedSortOrder.FIXED); + final var comparisonIsReverse = + RecordQuerySetPlan.resolveComparisonDirection(comparisonOrderingParts); + comparisonOrderingParts = RecordQuerySetPlan.adjustFixedBindings(comparisonOrderingParts, comparisonIsReverse); + + final var newQuantifiersBuilder = ImmutableList.builder(); + final var candidateTopAliasesBuilder = ImmutableList.builder(); + for (final var singleMatchedAccessWithIndex : partition) { + final var singleMatchedAccess = singleMatchedAccessWithIndex.getElement(); + final var plan = Objects.requireNonNull(matchToPlanMap.get( + singleMatchedAccess.getPartialMatch())); + final var reference = memoizer.memoizePlan(plan); + newQuantifiersBuilder.add(Quantifier.physical(reference)); + candidateTopAliasesBuilder.add(singleMatchedAccess.getCandidateTopAlias()); + } + + final var newQuantifiers = newQuantifiersBuilder.build(); + final var commonAndPickUpValues = + computeCommonAndPickUpValues(partition, commonGroupingKeyValues.size()); + final var intersectionResultValue = + computeIntersectionResultValue(newQuantifiers, commonAndPickUpValues.getLeft(), commonAndPickUpValues.getRight()); + final var intersectionPlan = + RecordQueryMultiIntersectionOnValuesPlan.intersection(newQuantifiers, + comparisonOrderingParts, intersectionResultValue, comparisonIsReverse); + final var compensatedIntersection = + compensation.applyAllNeededCompensations(memoizer, intersectionPlan, + baseAlias -> computeTranslationMap(baseAlias, + newQuantifiers, candidateTopAliasesBuilder.build(), + (Type.Record)intersectionResultValue.getResultType(), + commonGroupingKeyValues.size())); + expressionsBuilder.add(compensatedIntersection); + } + } + } + + return IntersectionResult.of(hasCommonOrdering ? intersectionOrdering : null, compensation, + expressionsBuilder.build()); + } + + @Nonnull + protected static Optional> commonGroupingKeyValuesMaybe(@Nonnull Iterable partialMatches) { + List common = null; + var first = true; + for (final var partialMatch : partialMatches) { + final var matchCandidate = partialMatch.getMatchCandidate(); + final var regularMatchInfo = partialMatch.getRegularMatchInfo(); + + final List key; + if (matchCandidate instanceof AggregateIndexMatchCandidate) { + final var aggregateIndexMatchCandidate = (AggregateIndexMatchCandidate)matchCandidate; + final var rollUpToGroupingValues = regularMatchInfo.getRollUpToGroupingValues(); + if (rollUpToGroupingValues == null) { + key = aggregateIndexMatchCandidate.getGroupingAndAggregateAccessors(Quantifier.current()).getLeft(); + } else { + key = aggregateIndexMatchCandidate.getGroupingAndAggregateAccessors(rollUpToGroupingValues.size(), + Quantifier.current()).getLeft(); + } + } else { + return Optional.empty(); + } + if (first) { + common = key; + first = false; + } else if (!common.equals(key)) { + return Optional.empty(); + } + } + return Optional.ofNullable(common); // common can only be null if we didn't have any match candidates to start with + } + + private static boolean isConsistentComparisonKeyDerivations(@Nonnull final List> partition, + @Nonnull final List comparisonKeyValues) { + for (final var comparisonKeyValue : comparisonKeyValues) { + if (consistentQueryValueForGroupingValueMaybe(partition, comparisonKeyValue).isEmpty()) { + return false; + } + } + return true; + } + + @Nonnull + private static Optional consistentQueryValueForGroupingValueMaybe(@Nonnull final List> partition, + @Nonnull final Value comparisonKeyValue) { + Value queryComparisonKeyValue = null; + for (final var singleMatchedAccessWithIndex : partition) { + final var singledMatchedAccess = singleMatchedAccessWithIndex.getElement(); + final var groupByMappings = singledMatchedAccess.getPulledUpGroupByMappingsForOrdering(); + final var inverseMatchedGroupingsMap = + groupByMappings.getMatchedGroupingsMap().inverse(); + final var currentQueryComparisonKeyValue = inverseMatchedGroupingsMap.get(comparisonKeyValue); + if (currentQueryComparisonKeyValue == null) { + return Optional.empty(); + } + if (queryComparisonKeyValue == null) { + queryComparisonKeyValue = currentQueryComparisonKeyValue; + } else { + final var semanticEquals = + queryComparisonKeyValue.semanticEquals(currentQueryComparisonKeyValue, + ValueEquivalence.empty()); + if (semanticEquals.isFalse()) { + return Optional.empty(); + } + if (!semanticEquals.getConstraint().isTautology()) { + return Optional.empty(); + } + } + } + + return Optional.of(Objects.requireNonNull(queryComparisonKeyValue)); + } + + @Nonnull + private static NonnullPair, List> computeCommonAndPickUpValues(@Nonnull final List> partition, + final int numGroupings) { + final var commonValuesAndPickUpValueByAccess = + partition + .stream() + .map(singleMatchedAccessWithIndex -> + singleMatchedAccessWithIndex.getElement() + .getPartialMatch() + .getMatchCandidate()) + .map(matchCandidate -> (AggregateIndexMatchCandidate)matchCandidate) + .map(aggregateIndexMatchCandidate -> + aggregateIndexMatchCandidate.getGroupingAndAggregateAccessors(numGroupings, Quantifier.current())) + .collect(ImmutableList.toImmutableList()); + + final var pickUpValuesBuilder = ImmutableList.builder(); + for (int i = 0; i < commonValuesAndPickUpValueByAccess.size(); i++) { + final var commonAndPickUpValuePair = commonValuesAndPickUpValueByAccess.get(i); + final var pickUpValue = commonAndPickUpValuePair.getRight(); + pickUpValuesBuilder.add(pickUpValue); + } + return NonnullPair.of(commonValuesAndPickUpValueByAccess.get(0).getLeft(), pickUpValuesBuilder.build()); + } + + @Nonnull + private static Value computeIntersectionResultValue(@Nonnull final List quantifiers, + @Nonnull final List commonValues, + @Nonnull final List pickUpValues) { + final var columnBuilder = ImmutableList.>builder(); + + // grab the common values from the first quantifier + final var commonTranslationMap = + TranslationMap.ofAliases(Quantifier.current(), quantifiers.get(0).getAlias()); + for (final var commonValue : commonValues) { + columnBuilder.add(Column.unnamedOf(commonValue.translateCorrelations(commonTranslationMap))); + } + + for (int i = 0; i < quantifiers.size(); i++) { + final var quantifier = quantifiers.get(i); + final var pickUpTranslationMap = + TranslationMap.ofAliases(Quantifier.current(), quantifier.getAlias()); + columnBuilder.add(Column.unnamedOf(pickUpValues.get(i).translateCorrelations(pickUpTranslationMap))); + } + + return RecordConstructorValue.ofColumns(columnBuilder.build()); + } + + private static TranslationMap computeTranslationMap(@Nonnull final CorrelationIdentifier intersectionAlias, + @Nonnull final List quantifiers, + @Nonnull final List candidateTopAliases, + @Nonnull final Type.Record intersectionResultType, + final int numGrouped) { + final var builder = RegularTranslationMap.builder(); + final var deconstructedIntersectionValues = + Values.deconstructRecord(QuantifiedObjectValue.of(intersectionAlias, intersectionResultType)); + for (int quantifierIndex = 0; quantifierIndex < quantifiers.size(); quantifierIndex++) { + final var quantifier = quantifiers.get(quantifierIndex); + final var quantifierFlowedObjectType = (Type.Record)quantifier.getFlowedObjectType(); + final var quantifierFields = quantifierFlowedObjectType.getFields(); + Verify.verify(quantifierFields.size() == numGrouped + 1); + final var columnBuilder = + ImmutableList.>builder(); + for (int columnIndex = 0; columnIndex < numGrouped; columnIndex++) { + columnBuilder.add(Column.of(quantifierFields.get(columnIndex), deconstructedIntersectionValues.get(columnIndex))); + } + columnBuilder.add(Column.of(quantifierFields.get(numGrouped), + deconstructedIntersectionValues.get(numGrouped + quantifierIndex))); + builder.when(candidateTopAliases.get(quantifierIndex)).then((alias, leaf) -> + RecordConstructorValue.ofColumns(columnBuilder.build())); + } + + return builder.build(); + } +} diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/DataAccessRule.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/DataAccessRule.java deleted file mode 100644 index a7f1ee4cb3..0000000000 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/DataAccessRule.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * DataAccessRule.java - * - * This source file is part of the FoundationDB open source project - * - * Copyright 2015-2019 Apple Inc. and the FoundationDB project authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.apple.foundationdb.record.query.plan.cascades.rules; - -import com.apple.foundationdb.annotation.API; -import com.apple.foundationdb.record.query.plan.cascades.CascadesPlanner; -import com.apple.foundationdb.record.query.plan.cascades.CascadesRuleCall; -import com.apple.foundationdb.record.query.plan.cascades.MatchCandidate; -import com.apple.foundationdb.record.query.plan.cascades.MatchPartition; -import com.apple.foundationdb.record.query.plan.cascades.Memoizer; -import com.apple.foundationdb.record.query.plan.cascades.PartialMatch; -import com.apple.foundationdb.record.query.plan.cascades.PlanContext; -import com.apple.foundationdb.record.query.plan.cascades.RequestedOrderingConstraint; -import com.apple.foundationdb.record.query.plan.cascades.ValueIndexScanMatchCandidate; -import com.apple.foundationdb.record.query.plan.cascades.expressions.LogicalIntersectionExpression; -import com.apple.foundationdb.record.query.plan.cascades.expressions.RelationalExpression; -import com.apple.foundationdb.record.query.plan.cascades.expressions.SelectExpression; -import com.apple.foundationdb.record.query.plan.cascades.matching.structure.BindingMatcher; -import com.google.common.collect.ImmutableList; - -import javax.annotation.Nonnull; - -import static com.apple.foundationdb.record.query.plan.cascades.matching.structure.MatchPartitionMatchers.ofExpressionAndMatches; -import static com.apple.foundationdb.record.query.plan.cascades.matching.structure.MultiMatcher.some; -import static com.apple.foundationdb.record.query.plan.cascades.matching.structure.NotMatcher.not; -import static com.apple.foundationdb.record.query.plan.cascades.matching.structure.PartialMatchMatchers.completeMatch; -import static com.apple.foundationdb.record.query.plan.cascades.matching.structure.RelationalExpressionMatchers.anyExpression; -import static com.apple.foundationdb.record.query.plan.cascades.matching.structure.RelationalExpressionMatchers.ofType; - -/** - * A rule that utilizes index matching information compiled by {@link CascadesPlanner} to create one or more - * expressions for data access. While this rule delegates specifics to the {@link MatchCandidate}s, the following are - * possible outcomes of the application of this transformation rule. Based on the match info, we may create for a single match: - * - *
      - *
    • a primary scan/index scan/index scan + fetch for a single {@link ValueIndexScanMatchCandidate}
    • - *
    • an intersection ({@link LogicalIntersectionExpression}) of data accesses
    • - *
    - * - * The logic that this rules delegates to actually create the expressions can be found in - * {@link MatchCandidate#toEquivalentPlan(PartialMatch, PlanContext, Memoizer, boolean)} - * - */ -@API(API.Status.EXPERIMENTAL) -@SuppressWarnings("PMD.TooManyStaticImports") -public class DataAccessRule extends AbstractDataAccessRule { - private static final BindingMatcher completeMatchMatcher = completeMatch(); - private static final BindingMatcher expressionMatcher = anyExpression().where(not(ofType(SelectExpression.class))); - - private static final BindingMatcher rootMatcher = - ofExpressionAndMatches(expressionMatcher, some(completeMatchMatcher)); - - public DataAccessRule() { - super(rootMatcher, completeMatchMatcher, expressionMatcher); - } - - @Override - public void onMatch(@Nonnull final CascadesRuleCall call) { - final var bindings = call.getBindings(); - final var completeMatches = bindings.getAll(getCompleteMatchMatcher()); - if (completeMatches.isEmpty()) { - return; - } - - final var expression = bindings.get(getExpressionMatcher()); - - if (expression.getQuantifiers().size() != 1) { - return; - } - - // - // return if there is no pre-determined interesting ordering - // - final var requestedOrderingsOptional = call.getPlannerConstraintMaybe(RequestedOrderingConstraint.REQUESTED_ORDERING); - if (requestedOrderingsOptional.isEmpty()) { - return; - } - - final var requestedOrderings = requestedOrderingsOptional.get(); - - final var matchPartition = - completeMatches - .stream() - .filter(match -> { - final var matchedQuantifiers = - expression.getMatchedQuantifiers(match); - return matchedQuantifiers.size() == 1; - }) - .collect(ImmutableList.toImmutableList()); - - call.yieldMixedUnknownExpressions(dataAccessForMatchPartition(call, - requestedOrderings, - matchPartition)); - } -} diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/MergeProjectionAndFetchRule.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/MergeProjectionAndFetchRule.java index dddd260e02..5ceee72bcc 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/MergeProjectionAndFetchRule.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/MergeProjectionAndFetchRule.java @@ -65,7 +65,7 @@ public void onMatch(@Nonnull final ImplementationCascadesRuleCall call) { // if the fetch is able to push all values we can eliminate the fetch as well final RecordQueryFetchFromPartialRecordPlan fetchPlan = call.get(innerPlanMatcher); final CorrelationIdentifier oldInnerAlias = Iterables.getOnlyElement(projectionExpression.getQuantifiers()).getAlias(); - final CorrelationIdentifier newInnerAlias = Quantifier.uniqueID(); + final CorrelationIdentifier newInnerAlias = Quantifier.uniqueId(); final List projectedValues = projectionExpression.getProjectedValues(); final boolean allPushable = projectedValues .stream() diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/PartitionSelectRule.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/PartitionSelectRule.java index f3e8774885..689b87dc3b 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/PartitionSelectRule.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/PartitionSelectRule.java @@ -156,7 +156,7 @@ public void onMatch(@Nonnull final ExplorationCascadesRuleCall call) { final CorrelationIdentifier lowerAliasCorrelatedToByUpperAliases; if (lowersCorrelatedToByUpperAliases.isEmpty()) { - lowerAliasCorrelatedToByUpperAliases = Quantifier.uniqueID(); + lowerAliasCorrelatedToByUpperAliases = Quantifier.uniqueId(); } else { lowerAliasCorrelatedToByUpperAliases = Iterables.getOnlyElement(lowersCorrelatedToByUpperAliases); } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/PushDistinctThroughFetchRule.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/PushDistinctThroughFetchRule.java index 159c7e3dff..9725cf9bdc 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/PushDistinctThroughFetchRule.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/PushDistinctThroughFetchRule.java @@ -92,7 +92,7 @@ public void onMatch(@Nonnull final ImplementationCascadesRuleCall call) { final RecordQueryFetchFromPartialRecordPlan fetchPlan = bindings.get(fetchPlanMatcher); final RecordQueryPlan innerPlan = bindings.get(innerPlanMatcher); - final CorrelationIdentifier newInnerAlias = Quantifier.uniqueID(); + final CorrelationIdentifier newInnerAlias = Quantifier.uniqueId(); final Quantifier.Physical newInnerQuantifier = Quantifier.physical(call.memoizePlan(innerPlan), newInnerAlias); diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/PushFilterThroughFetchRule.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/PushFilterThroughFetchRule.java index 84c816d2e2..96abeec5e5 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/PushFilterThroughFetchRule.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/PushFilterThroughFetchRule.java @@ -169,7 +169,7 @@ public void onMatch(@Nonnull final ImplementationCascadesRuleCall call) { final ImmutableList.Builder pushedPredicatesBuilder = ImmutableList.builder(); final ImmutableList.Builder residualPredicatesBuilder = ImmutableList.builder(); - final CorrelationIdentifier newInnerAlias = Quantifier.uniqueID(); + final CorrelationIdentifier newInnerAlias = Quantifier.uniqueId(); for (final QueryPredicate queryPredicate : queryPredicates) { final Optional pushedPredicateOptional = diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/PushMapThroughFetchRule.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/PushMapThroughFetchRule.java index 9aea56db10..8b1bf30fb4 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/PushMapThroughFetchRule.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/PushMapThroughFetchRule.java @@ -143,7 +143,7 @@ public void onMatch(@Nonnull final ImplementationCascadesRuleCall call) { final var resultValue = mapPlan.getResultValue(); // try to push these field values - final CorrelationIdentifier newInnerAlias = Quantifier.uniqueID(); + final CorrelationIdentifier newInnerAlias = Quantifier.uniqueId(); final var pushedResultValueOptional = fetchPlan.pushValue(resultValue, quantifierOverFetch.getAlias(), newInnerAlias); if (pushedResultValueOptional.isEmpty()) { diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/PushSetOperationThroughFetchRule.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/PushSetOperationThroughFetchRule.java index 9328e98286..afac7045d9 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/PushSetOperationThroughFetchRule.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/PushSetOperationThroughFetchRule.java @@ -173,7 +173,7 @@ public void onMatch(@Nonnull final ImplementationCascadesRuleCall call) { Verify.verify(quantifiersOverFetches.size() == fetchPlans.size()); Verify.verify(fetchPlans.size() == dependentFunctions.size()); - final CorrelationIdentifier sourceAlias = Quantifier.uniqueID(); + final CorrelationIdentifier sourceAlias = Quantifier.uniqueId(); final List requiredValues = setOperationPlan.getRequiredValues(sourceAlias, Quantifiers.getFlowedTypeForSetOperation(quantifiersOverFetches)); final Set pushableAliases = setOperationPlan.tryPushValues(dependentFunctions, quantifiersOverFetches, requiredValues, sourceAlias); diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/SelectDataAccessRule.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/SelectDataAccessRule.java deleted file mode 100644 index ba712e00af..0000000000 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/SelectDataAccessRule.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * SelectDataAccessRule.java - * - * This source file is part of the FoundationDB open source project - * - * Copyright 2015-2021 Apple Inc. and the FoundationDB project authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.apple.foundationdb.record.query.plan.cascades.rules; - -import com.apple.foundationdb.annotation.API; -import com.apple.foundationdb.record.query.plan.cascades.AliasMap; -import com.apple.foundationdb.record.query.plan.cascades.CascadesPlanner; -import com.apple.foundationdb.record.query.plan.cascades.CascadesRuleCall; -import com.apple.foundationdb.record.query.plan.cascades.CorrelationIdentifier; -import com.apple.foundationdb.record.query.plan.cascades.LinkedIdentitySet; -import com.apple.foundationdb.record.query.plan.cascades.MatchPartition; -import com.apple.foundationdb.record.query.plan.cascades.PartialMatch; -import com.apple.foundationdb.record.query.plan.cascades.Quantifier; -import com.apple.foundationdb.record.query.plan.cascades.Quantifiers; -import com.apple.foundationdb.record.query.plan.cascades.RequestedOrderingConstraint; -import com.apple.foundationdb.record.query.plan.cascades.expressions.SelectExpression; -import com.apple.foundationdb.record.query.plan.cascades.matching.structure.BindingMatcher; -import com.apple.foundationdb.record.util.pair.NonnullPair; -import com.apple.foundationdb.record.util.pair.Pair; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Iterables; - -import javax.annotation.Nonnull; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import static com.apple.foundationdb.record.query.plan.cascades.matching.structure.MatchPartitionMatchers.ofExpressionAndMatches; -import static com.apple.foundationdb.record.query.plan.cascades.matching.structure.MultiMatcher.some; -import static com.apple.foundationdb.record.query.plan.cascades.matching.structure.PartialMatchMatchers.completeMatch; -import static com.apple.foundationdb.record.query.plan.cascades.matching.structure.RelationalExpressionMatchers.ofType; - -/** - * A rule that utilizes index matching information compiled by {@link CascadesPlanner} to create one or more - * expressions for data access specifically for a {@link SelectExpression}. A {@link SelectExpression} behaves - * different compared to essentially all other expressions in a way that we can conceptually deconstruct such an expression - * on the fly and only replace the matched part of the original expression with the scan over the materialized view. - * That allows us to relax restrictions (.e.g. to match all quantifiers the select expression owns) while matching - * select expressions. - */ -@API(API.Status.EXPERIMENTAL) -@SuppressWarnings("PMD.TooManyStaticImports") -public class SelectDataAccessRule extends AbstractDataAccessRule { - private static final BindingMatcher completeMatchMatcher = completeMatch(); - private static final BindingMatcher expressionMatcher = ofType(SelectExpression.class); - - private static final BindingMatcher rootMatcher = - ofExpressionAndMatches(expressionMatcher, some(completeMatchMatcher)); - - public SelectDataAccessRule() { - super(rootMatcher, completeMatchMatcher, expressionMatcher); - } - - @Override - public void onMatch(@Nonnull final CascadesRuleCall call) { - final var bindings = call.getBindings(); - final var completeMatches = bindings.getAll(getCompleteMatchMatcher()); - if (completeMatches.isEmpty()) { - return; - } - - final var expression = bindings.get(getExpressionMatcher()); - final var correlatedTo = expression.getCorrelatedTo(); - - // - // return if there is no pre-determined interesting ordering - // - final var requestedOrderingsOptional = call.getPlannerConstraintMaybe(RequestedOrderingConstraint.REQUESTED_ORDERING); - if (requestedOrderingsOptional.isEmpty()) { - return; - } - - final var requestedOrderings = requestedOrderingsOptional.get(); - final var aliasToQuantifierMap = Quantifiers.aliasToQuantifierMap(expression.getQuantifiers()); - final var aliases = aliasToQuantifierMap.keySet(); - - // group all successful matches by their sets of compensated aliases - final var matchPartitionByMatchAliasMap = - completeMatches - .stream() - .flatMap(match -> { - final var compensatedAliases = match.getCompensatedAliases(); - if (!compensatedAliases.containsAll(aliases)) { - return Stream.empty(); - } - final Set matchedForEachAliases = - compensatedAliases.stream() - .filter(matchedAlias -> Objects.requireNonNull(aliasToQuantifierMap.get(matchedAlias)) instanceof Quantifier.ForEach) - .collect(ImmutableSet.toImmutableSet()); - if (matchedForEachAliases.size() == 1) { - return Stream.of(NonnullPair.of(Iterables.getOnlyElement(matchedForEachAliases), match)); - } - return Stream.empty(); - }) - .collect(Collectors.groupingBy( - Pair::getLeft, - LinkedHashMap::new, - Collectors.mapping(Pair::getRight, ImmutableList.toImmutableList()))); - - // loop through all compensated alias sets and their associated match partitions - for (final var matchPartitionByMatchAliasEntry : matchPartitionByMatchAliasMap.entrySet()) { - final var matchedAlias = matchPartitionByMatchAliasEntry.getKey(); - final var matchPartitionForMatchedAlias = matchPartitionByMatchAliasEntry.getValue(); - - // - // Pull down the requested orderings along the matchedAlias - // - final var pushedRequestedOrderings = - requestedOrderings.stream() - .map(requestedOrdering -> - requestedOrdering.pushDown(expression.getResultValue(), matchedAlias, - call.getEvaluationContext(), AliasMap.emptyMap(), correlatedTo)) - .collect(ImmutableSet.toImmutableSet()); - - // - // We do know that local predicates (which includes predicates only using the matchedAlias quantifier) - // are definitely handled by the logic expressed by the partial matches of the current match partition. - // Join predicates are different in a sense that there will be matches that handle those predicates and - // there will be matches where these predicates will not be handled. We further need to sub-partition the - // current match partition, by the predicates that are being handled by the matches. - // - // TODO this should just be exactly one key - final var matchPartitionsForAliasesByPredicates = - matchPartitionForMatchedAlias - .stream() - .collect(Collectors.groupingBy(match -> - new LinkedIdentitySet<>(match.getRegularMatchInfo().getPredicateMap().keySet()), - HashMap::new, - ImmutableList.toImmutableList())); - - // - // Note that this works because there is only one for-each and potentially 0 - n existential quantifiers - // that are covered by the match partition. Even though that logically forms a join, the existential - // quantifiers do not mutate the result of the join, they only cause filtering, that is, the resulting - // record is exactly what the for each quantifier produced filtered by the predicates expressed on the - // existential quantifiers. - // - for (final var matchPartitionEntry : matchPartitionsForAliasesByPredicates.entrySet()) { - final var matchPartition = matchPartitionEntry.getValue(); - - // - // The current match partition covers all matches that match the aliases in matchedAliases - // as well as all predicates in matchedPredicates. In other words we now have to compensate - // for all the remaining quantifiers and all remaining predicates. - // - final var dataAccessExpressions = - dataAccessForMatchPartition(call, - pushedRequestedOrderings, - matchPartition); - call.yieldMixedUnknownExpressions(dataAccessExpressions); - } - } - } -} diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/SelectMergeRule.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/SelectMergeRule.java index a478416ba8..b8a7335a4b 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/SelectMergeRule.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/SelectMergeRule.java @@ -157,7 +157,7 @@ public void onMatch(@Nonnull final ImplementationCascadesRuleCall call) { // childSelectExpression. If one does, we need to assign a new alias // to it. Choose one here // - CorrelationIdentifier newAlias = Quantifier.uniqueID(); + CorrelationIdentifier newAlias = Quantifier.uniqueId(); childAliasMapBuilder.put(childQun.getAlias(), newAlias); newQunAliases.add(newAlias); } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/WithPrimaryKeyDataAccessRule.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/WithPrimaryKeyDataAccessRule.java new file mode 100644 index 0000000000..dcae8508fb --- /dev/null +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/rules/WithPrimaryKeyDataAccessRule.java @@ -0,0 +1,236 @@ +/* + * WithPrimaryKeyDataAccessRule.java + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2015-2021 Apple Inc. and the FoundationDB project authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.apple.foundationdb.record.query.plan.cascades.rules; + +import com.apple.foundationdb.annotation.API; +import com.apple.foundationdb.record.query.plan.cascades.CascadesPlanner; +import com.apple.foundationdb.record.query.plan.cascades.ComparisonRange; +import com.apple.foundationdb.record.query.plan.cascades.Compensation; +import com.apple.foundationdb.record.query.plan.cascades.CorrelationIdentifier; +import com.apple.foundationdb.record.query.plan.cascades.MatchPartition; +import com.apple.foundationdb.record.query.plan.cascades.Memoizer; +import com.apple.foundationdb.record.query.plan.cascades.OrderingPart; +import com.apple.foundationdb.record.query.plan.cascades.PartialMatch; +import com.apple.foundationdb.record.query.plan.cascades.Quantifier; +import com.apple.foundationdb.record.query.plan.cascades.RequestedOrdering; +import com.apple.foundationdb.record.query.plan.cascades.WithPrimaryKeyMatchCandidate; +import com.apple.foundationdb.record.query.plan.cascades.expressions.RelationalExpression; +import com.apple.foundationdb.record.query.plan.cascades.expressions.SelectExpression; +import com.apple.foundationdb.record.query.plan.cascades.matching.structure.BindingMatcher; +import com.apple.foundationdb.record.query.plan.cascades.values.Value; +import com.apple.foundationdb.record.query.plan.cascades.values.translation.RegularTranslationMap; +import com.apple.foundationdb.record.query.plan.cascades.values.translation.TranslationMap; +import com.apple.foundationdb.record.query.plan.plans.RecordQueryIntersectionPlan; +import com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan; +import com.apple.foundationdb.record.query.plan.plans.RecordQuerySetPlan; +import com.google.common.base.Verify; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Iterables; + +import javax.annotation.Nonnull; +import java.util.BitSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.function.Function; + +import static com.apple.foundationdb.record.query.plan.cascades.matching.structure.MatchPartitionMatchers.ofExpressionAndMatches; +import static com.apple.foundationdb.record.query.plan.cascades.matching.structure.MultiMatcher.some; +import static com.apple.foundationdb.record.query.plan.cascades.matching.structure.PartialMatchMatchers.completeMatch; +import static com.apple.foundationdb.record.query.plan.cascades.matching.structure.PartialMatchMatchers.matchingWithPrimaryKeyMatchCandidate; +import static com.apple.foundationdb.record.query.plan.cascades.matching.structure.RelationalExpressionMatchers.anyExpression; + +/** + * A rule that utilizes index matching information compiled by {@link CascadesPlanner} to create one or more + * expressions for data access specifically for a {@link SelectExpression}. A {@link SelectExpression} behaves + * different compared to essentially all other expressions in a way that we can conceptually deconstruct such an expression + * on the fly and only replace the matched part of the original expression with the scan over the materialized view. + * That allows us to relax restrictions (.e.g. to match all quantifiers the select expression owns) while matching + * select expressions. + */ +@API(API.Status.EXPERIMENTAL) +@SuppressWarnings("PMD.TooManyStaticImports") +public class WithPrimaryKeyDataAccessRule extends AbstractDataAccessRule { + private static final BindingMatcher completeMatchMatcher = + completeMatch().and(matchingWithPrimaryKeyMatchCandidate()); + private static final BindingMatcher expressionMatcher = anyExpression(); + + private static final BindingMatcher rootMatcher = + ofExpressionAndMatches(expressionMatcher, some(completeMatchMatcher)); + + public WithPrimaryKeyDataAccessRule() { + super(rootMatcher, completeMatchMatcher, expressionMatcher); + } + + @Nonnull + @Override + protected IntersectionResult createIntersectionAndCompensation(@Nonnull final Memoizer memoizer, + @Nonnull final Map intersectionInfoMap, + @Nonnull final Map matchToPlanMap, + @Nonnull final List> partition, + @Nonnull final Set requestedOrderings) { + Verify.verify(partition.size() > 1); + + final var partitionAccesses = + partition.stream() + .map(Vectored::getElement) + .collect(ImmutableList.toImmutableList()); + + final var commonPrimaryKeyValuesOptional = + commonPrimaryKeyValuesMaybe( + partitionAccesses.stream() + .map(SingleMatchedAccess::getPartialMatch) + .collect(ImmutableList.toImmutableList())); + if (commonPrimaryKeyValuesOptional.isEmpty()) { + return IntersectionResult.noViableIntersection(); + } + + final var commonPrimaryKeyValues = commonPrimaryKeyValuesOptional.get(); + + final var partitionOrderings = + partitionAccesses.stream() + .map(AbstractDataAccessRule::adjustMatchedOrderingParts) + .collect(ImmutableList.toImmutableList()); + final var intersectionOrdering = intersectOrderings(partitionOrderings); + + final var equalityBoundKeyValues = + partitionOrderings + .stream() + .flatMap(orderingPartsPair -> + orderingPartsPair.getKey() + .stream() + .filter(boundOrderingKey -> boundOrderingKey.getComparisonRangeType() == + ComparisonRange.Type.EQUALITY) + .map(OrderingPart.MatchedOrderingPart::getValue)) + .collect(ImmutableSet.toImmutableSet()); + + final var isPartitionRedundant = + isPartitionRedundant(intersectionInfoMap, partition, equalityBoundKeyValues); + if (isPartitionRedundant) { + return IntersectionResult.noViableIntersection(); + } + + final var compensation = + partitionAccesses + .stream() + .map(SingleMatchedAccess::getCompensation) + .reduce(Compensation.impossibleCompensation(), Compensation::intersect); + final Function matchedToRealizedTranslationMapFunction = + realizedAlias -> matchedToRealizedTranslationMap(partition, realizedAlias); + + // + // Grab the first matched access from the partition in order to translate to the required ordering + // to the candidate's top. + // + final var firstMatchedAccess = partition.get(0).getElement(); + final var topToTopTranslationMap = firstMatchedAccess.getTopToTopTranslationMap(); + + boolean hasCommonOrdering = false; + final var expressionsBuilder = ImmutableList.builder(); + for (final var requestedOrdering : requestedOrderings) { + final var translatedRequestedOrdering = + requestedOrdering.translateCorrelations(topToTopTranslationMap, true); + final var comparisonKeyValuesIterable = + intersectionOrdering.enumerateSatisfyingComparisonKeyValues(translatedRequestedOrdering); + for (final var comparisonKeyValues : comparisonKeyValuesIterable) { + if (!isCompatibleComparisonKey(comparisonKeyValues, + commonPrimaryKeyValues, + equalityBoundKeyValues)) { + continue; + } + + hasCommonOrdering = true; + if (!compensation.isImpossible()) { + var comparisonOrderingParts = + intersectionOrdering.directionalOrderingParts(comparisonKeyValues, translatedRequestedOrdering, + OrderingPart.ProvidedSortOrder.FIXED); + final var comparisonIsReverse = + RecordQuerySetPlan.resolveComparisonDirection(comparisonOrderingParts); + comparisonOrderingParts = RecordQuerySetPlan.adjustFixedBindings(comparisonOrderingParts, comparisonIsReverse); + + final var newQuantifiers = + partition + .stream() + .map(pair -> + Objects.requireNonNull(matchToPlanMap.get(pair.getElement().getPartialMatch()))) + .map(memoizer::memoizePlan) + .map(Quantifier::physical) + .collect(ImmutableList.toImmutableList()); + + final var intersectionPlan = + RecordQueryIntersectionPlan.fromQuantifiers(newQuantifiers, + comparisonOrderingParts, comparisonIsReverse); + final var compensatedIntersection = + compensation.applyAllNeededCompensations(memoizer, intersectionPlan, + matchedToRealizedTranslationMapFunction); + expressionsBuilder.add(compensatedIntersection); + } + } + } + + return IntersectionResult.of(hasCommonOrdering ? intersectionOrdering : null, compensation, + expressionsBuilder.build()); + } + + @Nonnull + protected static Optional> commonPrimaryKeyValuesMaybe(@Nonnull Iterable partialMatches) { + Verify.verify(!Iterables.isEmpty(partialMatches)); + List common = null; + var first = true; + for (final var partialMatch : partialMatches) { + final var matchCandidate = partialMatch.getMatchCandidate(); + + final List key; + if (matchCandidate instanceof WithPrimaryKeyMatchCandidate) { + final var withPrimaryKeyMatchCandidate = (WithPrimaryKeyMatchCandidate)matchCandidate; + final var keyMaybe = withPrimaryKeyMatchCandidate.getPrimaryKeyValuesMaybe(); + if (keyMaybe.isEmpty()) { + return Optional.empty(); + } + key = keyMaybe.get(); + } else { + return Optional.empty(); + } + if (first) { + common = key; + first = false; + } else if (!common.equals(key)) { + return Optional.empty(); + } + } + return Optional.of(Objects.requireNonNull(common)); + } + + @Nonnull + private static TranslationMap matchedToRealizedTranslationMap(@Nonnull final List> partition, + @Nonnull final CorrelationIdentifier realizedAlias) { + final var translationMapBuilder = RegularTranslationMap.builder(); + for (final var singleMatchedAccessWithIndex : partition) { + translationMapBuilder.when(singleMatchedAccessWithIndex.getElement().getCandidateTopAlias()) + .then((sourceAlias, leafValue) -> leafValue.rebaseLeaf( + realizedAlias)); + } + return translationMapBuilder.build(); + } +} diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/typing/Type.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/typing/Type.java index e6cc85c390..2ad227549f 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/typing/Type.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/typing/Type.java @@ -2126,7 +2126,7 @@ public ExplainTokens describe() { } if (i + 1 < getFields().size()) { - return resultExplainTokens.addCommaAndWhiteSpace(); + resultExplainTokens.addCommaAndWhiteSpace(); } i ++; } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/Values.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/Values.java index c06e420b0d..bc2ede6a25 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/Values.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/Values.java @@ -47,7 +47,7 @@ public class Values { * @return a list of field values */ @Nonnull - public static List deconstructRecord(@Nonnull Value recordValue) { + public static List deconstructRecord(@Nonnull final Value recordValue) { final var resultType = recordValue.getResultType(); Verify.verify(resultType.isRecord()); Verify.verify(resultType instanceof Type.Record); diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/translation/MaxMatchMap.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/translation/MaxMatchMap.java index 9e001c1627..e25e27eb78 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/translation/MaxMatchMap.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/translation/MaxMatchMap.java @@ -291,6 +291,17 @@ public Optional adjustMaybe(@Nonnull final CorrelationIdentifier up rangedOverAliases)); } + @Nonnull + public Optional pullUpMaybe(@Nonnull final CorrelationIdentifier queryAlias, + @Nonnull final CorrelationIdentifier candidateAlias) { + final var translatedQueryValueOptional = translateQueryValueMaybe(candidateAlias); + return translatedQueryValueOptional + .map(translatedQueryValue -> + RegularTranslationMap.builder() + .when(queryAlias).then(TranslationMap.TranslationFunction.adjustValueType(translatedQueryValue)) + .build()); + } + @Override public String toString() { return "M³(" + @@ -318,6 +329,15 @@ public static MaxMatchMap compute(@Nonnull final Value queryValue, ValueEquivalence.empty()); } + @Nonnull + public static MaxMatchMap compute(@Nonnull final Value queryValue, + @Nonnull final Value candidateValue, + @Nonnull final Set rangedOverAliases, + @Nonnull final ValueEquivalence valueEquivalence) { + return compute(queryValue, candidateValue, rangedOverAliases, valueEquivalence, + ignored -> Optional.empty()); + } + /** * Computes the maximum sub-{@link Value}s in {@code queryValue} that have an exact match in the * {@code candidateValue}. @@ -329,6 +349,8 @@ public static MaxMatchMap compute(@Nonnull final Value queryValue, * @param candidateValue the candidate result {@code Value} we want to search for maximum matches * @param rangedOverAliases a set of aliases that should be considered constant * @param valueEquivalence an {@link ValueEquivalence} that informs the logic about equivalent value subtrees + * @param unmatchedHandlerFunction function that is invoked if a match between a query {@link Value} and a candidate + * {@link Value} cannot be established * @return a {@link MaxMatchMap} of all maximum matches. Note that the returned {@link MaxMatchMap} always exists, * it is possible, however, that it might not contain all necessary mappings to perform a pull-up when it * is used. @@ -337,7 +359,8 @@ public static MaxMatchMap compute(@Nonnull final Value queryValue, public static MaxMatchMap compute(@Nonnull final Value queryValue, @Nonnull final Value candidateValue, @Nonnull final Set rangedOverAliases, - @Nonnull final ValueEquivalence valueEquivalence) { + @Nonnull final ValueEquivalence valueEquivalence, + @Nonnull final Function> unmatchedHandlerFunction) { if (logger.isTraceEnabled()) { logger.trace("calculate begin queryValue={}, candidateValue={}", queryValue, candidateValue); } @@ -355,8 +378,8 @@ public static MaxMatchMap compute(@Nonnull final Value queryValue, // final var resultsMap = recurseQueryResultValue(queryValue, candidateValue, rangedOverAliases, - valueEquivalence, new IdentityHashMap<>(), -1, new ArrayDeque<>(), - Integer.MAX_VALUE, new HashSet<>()); + valueEquivalence, unmatchedHandlerFunction, new IdentityHashMap<>(), -1, + new ArrayDeque<>(), Integer.MAX_VALUE, new HashSet<>()); // // Pick a match which has the minimum max depth among all the matches. @@ -487,6 +510,7 @@ private static Map recurseQueryResultValue(@Nonnull final Va @Nonnull final Value candidateValue, @Nonnull final Set rangedOverAliases, @Nonnull final ValueEquivalence valueEquivalence, + @Nonnull final Function> unmatchedHandlerFunction, @Nonnull final IdentityHashMap> knownValueMap, final int descendOrdinal, @Nonnull final Deque matchers, @@ -544,7 +568,7 @@ private static Map recurseQueryResultValue(@Nonnull final Va if (Iterables.isEmpty(children)) { final var resultForCurrent = computeForCurrent(maxDepthBound, currentQueryValue, candidateValue, rangedOverAliases, - valueEquivalence, ImmutableList.of()); + valueEquivalence, unmatchedHandlerFunction, ImmutableList.of()); bestMatches.put(currentQueryValue, resultForCurrent); } else { final ConstrainedBoolean isFound; @@ -557,7 +581,8 @@ private static Map recurseQueryResultValue(@Nonnull final Va final var matchingPair = findMatchingReachableCandidateValue(currentQueryValue, candidateValue, - valueEquivalence); + valueEquivalence, + unmatchedHandlerFunction); isFound = Objects.requireNonNull(matchingPair.getLeft()); if (isFound.isTrue()) { bestMatches.put(currentQueryValue, MatchResult.of(ImmutableMap.of(currentQueryValue, @@ -592,7 +617,8 @@ private static Map recurseQueryResultValue(@Nonnull final Va } final var childrenResultsMap = recurseQueryResultValue(child, candidateValue, rangedOverAliases, valueEquivalence, - knownValueMap, i, localMatchers, childrenMaxDepthBound, expandedValues); + unmatchedHandlerFunction, knownValueMap, i, localMatchers, childrenMaxDepthBound, + expandedValues); childrenResultsBuilder.add(childrenResultsMap.entrySet()); } @@ -622,8 +648,8 @@ private static Map recurseQueryResultValue(@Nonnull final Va } final var resultForCurrent = - computeForCurrent(maxDepthBound, resultQueryValue, candidateValue, - rangedOverAliases, valueEquivalence, childrenResultEntries); + computeForCurrent(maxDepthBound, resultQueryValue, candidateValue, rangedOverAliases, + valueEquivalence, unmatchedHandlerFunction, childrenResultEntries); bestMatches.put(resultQueryValue, resultForCurrent); } } @@ -662,10 +688,8 @@ private static Map recurseQueryResultValue(@Nonnull final Va final var expandedResultsMap = recurseQueryResultValue(expandedCurrentQueryValue, candidateValue, - rangedOverAliases, valueEquivalence, knownValueMap, descendOrdinal, - matchers, - currentMaxDepthBound, - expandedValues); + rangedOverAliases, valueEquivalence, unmatchedHandlerFunction, knownValueMap, + descendOrdinal, matchers, currentMaxDepthBound, expandedValues); for (final var expandedResultsEntry : expandedResultsMap.entrySet()) { bestMatches.put(expandedResultsEntry.getKey(), expandedResultsEntry.getValue()); } @@ -708,13 +732,15 @@ private static MatchResult computeForCurrent(final int maxDepthBound, @Nonnull final Value candidateValue, @Nonnull final Set rangedOverAliases, @Nonnull final ValueEquivalence valueEquivalence, + @Nonnull final Function> unmatchedHandlerFunction, @Nonnull final List> childrenResultEntries) { Verify.verify(maxDepthBound > 0); final var matchingPair = findMatchingReachableCandidateValue(resultQueryValue, candidateValue, - valueEquivalence); + valueEquivalence, + unmatchedHandlerFunction); final var isFound = Objects.requireNonNull(matchingPair.getLeft()); if (isFound.isTrue()) { return MatchResult.of(ImmutableMap.of(resultQueryValue, @@ -755,10 +781,11 @@ private static MatchResult computeForCurrent(final int maxDepthBound, @SuppressWarnings("PMD.CompareObjectsWithEquals") private static Pair findMatchingReachableCandidateValue(@Nonnull final Value currentQueryValue, @Nonnull final Value candidateValue, - @Nonnull final ValueEquivalence valueEquivalence) { + @Nonnull final ValueEquivalence valueEquivalence, + @Nonnull final Function> unmatchedHandlerFunction) { for (final var currentCandidateValue : candidateValue // when traversing the candidate in pre-order, only descend into structures that can be referenced - // from the top expression. For example, RCV's components can be referenced however an Arithmetic + // from the top expression. For example, rcv's components can be referenced however an arithmetic // operator's children can not be referenced. // It is crucial to do this in pre-order to guarantee matching the maximum (sub-)value of the candidate. .preOrderIterable(v -> v instanceof RecordConstructorValue)) { @@ -774,7 +801,10 @@ private static Pair findMatchingReachableCandidateVal return Pair.of(semanticEquals, currentCandidateValue); } } - return Pair.of(ConstrainedBoolean.falseValue(), null); + + final var unmatchedHandlerResult = unmatchedHandlerFunction.apply(currentQueryValue); + return unmatchedHandlerResult.map(value -> Pair.of(ConstrainedBoolean.alwaysTrue(), value)) + .orElseGet(() -> Pair.of(ConstrainedBoolean.falseValue(), null)); } /** diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/translation/PullUp.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/translation/PullUp.java index e48147db05..29e100b2f0 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/translation/PullUp.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/translation/PullUp.java @@ -31,7 +31,9 @@ import com.apple.foundationdb.record.query.plan.cascades.typing.Type; import com.apple.foundationdb.record.query.plan.cascades.values.QuantifiedObjectValue; import com.apple.foundationdb.record.query.plan.cascades.values.Value; +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Sets; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -45,21 +47,20 @@ public class PullUp { @Nullable private final PullUp parentPullUp; @Nonnull - private final CorrelationIdentifier nestingAlias; + private final CorrelationIdentifier candidateAlias; @Nonnull private final Value pullThroughValue; @Nonnull private final Set rangedOverAliases; - @Nonnull private final PullUp rootPullUp; private PullUp(@Nullable final PullUp parentPullUp, - @Nonnull final CorrelationIdentifier nestingAlias, + @Nonnull final CorrelationIdentifier candidateAlias, @Nonnull final Value pullThroughValue, @Nonnull final Set rangedOverAliases) { this.parentPullUp = parentPullUp; - this.nestingAlias = nestingAlias; + this.candidateAlias = candidateAlias; this.pullThroughValue = pullThroughValue; this.rangedOverAliases = ImmutableSet.copyOf(rangedOverAliases); this.rootPullUp = parentPullUp == null ? this : parentPullUp.getRootPullUp(); @@ -76,8 +77,8 @@ public PullUp getRootPullUp() { } @Nonnull - public CorrelationIdentifier getNestingAlias() { - return nestingAlias; + public CorrelationIdentifier getCandidateAlias() { + return candidateAlias; } public boolean isRoot() { @@ -95,26 +96,28 @@ public Set getRangedOverAliases() { } @Nonnull - public CorrelationIdentifier getTopAlias() { - return getRootPullUp().getNestingAlias(); + private static PullUp forMatch(@Nullable final PullUp parentPullUp, + @Nonnull final CorrelationIdentifier candidateAlias, + @Nonnull final CorrelationIdentifier lowerAlias, + @Nonnull final Type lowerType, + @Nonnull final Set rangedOverAliases) { + return forMatch(parentPullUp, candidateAlias, QuantifiedObjectValue.of(lowerAlias, lowerType), + rangedOverAliases); } @Nonnull - private static PullUp of(@Nullable final PullUp parentPullUp, - @Nonnull final CorrelationIdentifier nestingAlias, - @Nonnull final CorrelationIdentifier lowerAlias, - @Nonnull final Type lowerType, - @Nonnull final Set rangedOverAliases) { - return of(parentPullUp, nestingAlias, QuantifiedObjectValue.of(lowerAlias, lowerType), - rangedOverAliases); + private static PullUp forMatch(@Nullable final PullUp parentPullUp, + @Nonnull final CorrelationIdentifier candidateAlias, + @Nonnull final Value lowerPullThroughValue, + @Nonnull final Set rangedOverAliases) { + return new MatchPullUp(parentPullUp, candidateAlias, lowerPullThroughValue, rangedOverAliases); } @Nonnull - private static PullUp of(@Nullable final PullUp parentPullUp, - @Nonnull final CorrelationIdentifier nestingAlias, - @Nonnull final Value lowerPullThroughValue, - @Nonnull final Set rangedOverAliases) { - return new PullUp(parentPullUp, nestingAlias, lowerPullThroughValue, rangedOverAliases); + public static UnificationPullUp forUnification(@Nonnull final CorrelationIdentifier candidateAlias, + @Nonnull final Value lowerPullThroughValue, + @Nonnull final Set rangedOverAliases) { + return new UnificationPullUp(null, candidateAlias, lowerPullThroughValue, rangedOverAliases); } /** @@ -131,7 +134,7 @@ private static PullUp of(@Nullable final PullUp parentPullUp, * {@code value} could not be pulled up. */ @Nonnull - public Optional pullUpMaybe(@Nonnull final Value value) { + public Optional pullUpValueMaybe(@Nonnull final Value value) { // // The following loop would probably be more self-explanatory if it were written as a recursion but // this unrolled version probably performs better as this may prove to be a tight loop. @@ -142,7 +145,7 @@ public Optional pullUpMaybe(@Nonnull final Value value) { MaxMatchMap.compute(currentValue, currentPullUp.getPullThroughValue(), currentPullUp.getRangedOverAliases()); final var currentValueOptional = - maxMatchMap.translateQueryValueMaybe(currentPullUp.getNestingAlias()); + maxMatchMap.translateQueryValueMaybe(currentPullUp.getCandidateAlias()); if (currentValueOptional.isEmpty()) { return Optional.empty(); } @@ -155,28 +158,58 @@ public Optional pullUpMaybe(@Nonnull final Value value) { } } + @Nonnull + public Optional pullUpCandidateValueMaybe(@Nonnull final Value value) { + // + // The following loop would probably be more self-explanatory if it were written as a recursion but + // this unrolled version probably performs better as this may prove to be a tight loop. + // + var currentValue = value; + for (var currentPullUp = this; ; currentPullUp = currentPullUp.getParentPullUp()) { + final var currentPullThroughValue = currentPullUp.getPullThroughValue(); + final var currentRangedOverAliases = currentPullUp.getRangedOverAliases(); + final var currentCandidateAlias = currentPullUp.getCandidateAlias(); + final var candidatePullUpMap = + currentPullThroughValue.pullUp(ImmutableList.of(currentValue), + EvaluationContext.empty(), + AliasMap.emptyMap(), + Sets.difference(currentValue.getCorrelatedToWithoutChildren(), + currentRangedOverAliases), + currentCandidateAlias); + final var pulledUpCandidateAggregateValue = candidatePullUpMap.get(currentValue); + if (pulledUpCandidateAggregateValue == null) { + return Optional.empty(); + } + currentValue = pulledUpCandidateAggregateValue; + + if (currentPullUp.getParentPullUp() == null) { + return Optional.of(currentValue); + } + } + } + @Nonnull public static RelationalExpressionVisitor visitor(@Nullable final PullUp parentPullUp, - @Nonnull final CorrelationIdentifier nestingAlias) { - return new PullUpVisitor(parentPullUp, nestingAlias); + @Nonnull final CorrelationIdentifier candidateAlias) { + return new PullUpVisitor(parentPullUp, candidateAlias); } private static class PullUpVisitor implements RelationalExpressionVisitorWithDefaults { @Nullable private final PullUp parentPullUp; @Nonnull - private final CorrelationIdentifier nestingAlias; + private final CorrelationIdentifier candidateAlias; public PullUpVisitor(@Nullable final PullUp parentPullUp, - @Nonnull final CorrelationIdentifier nestingAlias) { + @Nonnull final CorrelationIdentifier candidateAlias) { this.parentPullUp = parentPullUp; - this.nestingAlias = nestingAlias; + this.candidateAlias = candidateAlias; } @Nonnull @Override public PullUp visitLogicalTypeFilterExpression(@Nonnull final LogicalTypeFilterExpression logicalTypeFilterExpression) { - return of(parentPullUp, nestingAlias, logicalTypeFilterExpression.getInnerQuantifier().getAlias(), + return forMatch(parentPullUp, candidateAlias, logicalTypeFilterExpression.getInnerQuantifier().getAlias(), logicalTypeFilterExpression.getInnerQuantifier().getFlowedObjectType(), Quantifiers.aliases(logicalTypeFilterExpression.getQuantifiers())); } @@ -184,8 +217,26 @@ public PullUp visitLogicalTypeFilterExpression(@Nonnull final LogicalTypeFilterE @Nonnull @Override public PullUp visitDefault(@Nonnull final RelationalExpression relationalExpression) { - return of(parentPullUp, nestingAlias, relationalExpression.getResultValue(), + return forMatch(parentPullUp, candidateAlias, relationalExpression.getResultValue(), Quantifiers.aliases(relationalExpression.getQuantifiers())); } } + + public static class MatchPullUp extends PullUp { + public MatchPullUp(@Nullable final PullUp parentPullUp, + @Nonnull final CorrelationIdentifier candidateAlias, + @Nonnull final Value pullThroughValue, + @Nonnull final Set rangedOverAliases) { + super(parentPullUp, candidateAlias, pullThroughValue, rangedOverAliases); + } + } + + public static class UnificationPullUp extends PullUp { + public UnificationPullUp(@Nullable final PullUp parentPullUp, + @Nonnull final CorrelationIdentifier candidateAlias, + @Nonnull final Value pullThroughValue, + @Nonnull final Set rangedOverAliases) { + super(parentPullUp, candidateAlias, pullThroughValue, rangedOverAliases); + } + } } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/translation/ToUniqueAliasesTranslationMap.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/translation/ToUniqueAliasesTranslationMap.java index 7ce9f0fe4f..25de2a3e06 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/translation/ToUniqueAliasesTranslationMap.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/translation/ToUniqueAliasesTranslationMap.java @@ -85,6 +85,6 @@ public Value applyTranslationFunction(@Nonnull final CorrelationIdentifier sourc @Nonnull private CorrelationIdentifier computeTargetIfAbsent(@Nonnull final CorrelationIdentifier sourceAlias) { return sourceToTargetMap.computeIfAbsent(sourceAlias, - ignored0 -> Quantifier.uniqueID()); + ignored0 -> Quantifier.uniqueId()); } } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryExplodePlan.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryExplodePlan.java index 393acaa8fa..d4b7243e6e 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryExplodePlan.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryExplodePlan.java @@ -169,7 +169,6 @@ public Set getDynamicTypes() { return collectionValue.getDynamicTypes(); } - @Nonnull @Override public String toString() { diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryIndexPlan.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryIndexPlan.java index bce54f1450..1433c5d9cc 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryIndexPlan.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryIndexPlan.java @@ -60,6 +60,7 @@ import com.apple.foundationdb.record.provider.foundationdb.MultidimensionalIndexScanComparisons; import com.apple.foundationdb.record.provider.foundationdb.UnsupportedRemoteFetchIndexException; import com.apple.foundationdb.record.query.plan.AvailableFields; +import com.apple.foundationdb.record.query.plan.cascades.AggregateIndexMatchCandidate; import com.apple.foundationdb.record.query.plan.QueryPlanConstraint; import com.apple.foundationdb.record.query.plan.ScanComparisons; import com.apple.foundationdb.record.query.plan.cascades.AliasMap; @@ -661,6 +662,16 @@ public PlannerGraph createIndexPlannerGraph(@Nonnull RecordQueryPlan identity, attributeMapBuilder.put("direction", Attribute.gml("reversed")); } + final var matchCandidateOptional = getMatchCandidateMaybe(); + final String extendedIndexName; + if (matchCandidateOptional.isPresent() && + matchCandidateOptional.get() instanceof AggregateIndexMatchCandidate) { + final var aggregateIndexMatchCandidate = (AggregateIndexMatchCandidate)matchCandidateOptional.get(); + extendedIndexName = aggregateIndexMatchCandidate.toString(); + } else { + extendedIndexName = getIndexName(); + } + return PlannerGraph.fromNodeAndChildGraphs( new PlannerGraph.OperatorNodeWithInfo(identity, nodeInfo, @@ -668,7 +679,7 @@ public PlannerGraph createIndexPlannerGraph(@Nonnull RecordQueryPlan identity, attributeMapBuilder.build()), ImmutableList.of( PlannerGraph.fromNodeAndChildGraphs( - new PlannerGraph.DataNodeWithInfo(NodeInfo.INDEX_DATA, getResultType(), ImmutableList.copyOf(getUsedIndexes())), + new PlannerGraph.DataNodeWithInfo(NodeInfo.INDEX_DATA, getResultType(), ImmutableList.of(extendedIndexName)), ImmutableList.of()))); } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryIntersectionPlan.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryIntersectionPlan.java index c553c0ceba..d1b4f3d3eb 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryIntersectionPlan.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryIntersectionPlan.java @@ -50,6 +50,7 @@ import com.apple.foundationdb.record.query.plan.cascades.expressions.RelationalExpression; import com.apple.foundationdb.record.query.plan.cascades.explain.ExplainPlanVisitor; import com.apple.foundationdb.record.query.plan.cascades.values.Value; +import com.google.common.base.Suppliers; import com.google.common.base.Verify; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; @@ -64,6 +65,7 @@ import java.util.Objects; import java.util.Set; import java.util.function.Function; +import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -90,7 +92,7 @@ public abstract class RecordQueryIntersectionPlan implements RecordQueryPlanWith protected final boolean reverse; @Nonnull - private final Value resultValue; + private final Supplier resultValueSupplier; protected RecordQueryIntersectionPlan(@Nonnull final PlanSerializationContext serializationContext, @Nonnull final PRecordQueryIntersectionPlan recordQueryIntersectionPlanProto) { @@ -102,7 +104,7 @@ protected RecordQueryIntersectionPlan(@Nonnull final PlanSerializationContext se this.quantifiers = quantifiersBuilder.build(); this.comparisonKeyFunction = ComparisonKeyFunction.fromComparisonKeyFunctionProto(serializationContext, Objects.requireNonNull(recordQueryIntersectionPlanProto.getComparisonKeyFunction())); this.reverse = recordQueryIntersectionPlanProto.getReverse(); - this.resultValue = RecordQuerySetPlan.mergeValues(quantifiers); + this.resultValueSupplier = Suppliers.memoize(this::computeResultValue); } @SuppressWarnings("PMD.UnusedFormalParameter") @@ -112,7 +114,7 @@ protected RecordQueryIntersectionPlan(@Nonnull List quantif this.quantifiers = ImmutableList.copyOf(quantifiers); this.comparisonKeyFunction = comparisonKeyFunction; this.reverse = reverse; - this.resultValue = RecordQuerySetPlan.mergeValues(quantifiers); + this.resultValueSupplier = Suppliers.memoize(this::computeResultValue); } @Nonnull @@ -179,7 +181,12 @@ public Set getCorrelatedToWithoutChildren() { @Nonnull @Override public Value getResultValue() { - return resultValue; + return resultValueSupplier.get(); + } + + @Nonnull + protected Value computeResultValue() { + return RecordQuerySetPlan.mergeValues(quantifiers); } @Override diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryMultiIntersectionOnValuesPlan.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryMultiIntersectionOnValuesPlan.java new file mode 100644 index 0000000000..ead4340baf --- /dev/null +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryMultiIntersectionOnValuesPlan.java @@ -0,0 +1,271 @@ +/* + * RecordQueryIntersectionOnValuesPlan.java + * + * This source file is part of the FoundationDB open source project + * + * Copyright 2015-2022 Apple Inc. and the FoundationDB project authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.apple.foundationdb.record.query.plan.plans; + +import com.apple.foundationdb.record.EvaluationContext; +import com.apple.foundationdb.record.ExecuteProperties; +import com.apple.foundationdb.record.PlanDeserializer; +import com.apple.foundationdb.record.PlanSerializationContext; +import com.apple.foundationdb.record.RecordCoreException; +import com.apple.foundationdb.record.RecordCursor; +import com.apple.foundationdb.record.metadata.expressions.KeyExpression; +import com.apple.foundationdb.record.planprotos.PRecordQueryMultiIntersectionOnValuesPlan; +import com.apple.foundationdb.record.planprotos.PRecordQueryPlan; +import com.apple.foundationdb.record.provider.foundationdb.FDBRecordStoreBase; +import com.apple.foundationdb.record.provider.foundationdb.cursors.IntersectionMultiCursor; +import com.apple.foundationdb.record.query.plan.cascades.CorrelationIdentifier; +import com.apple.foundationdb.record.query.plan.cascades.FinalMemoizer; +import com.apple.foundationdb.record.query.plan.cascades.OrderingPart.ProvidedOrderingPart; +import com.apple.foundationdb.record.query.plan.cascades.Quantifier; +import com.apple.foundationdb.record.query.plan.cascades.Quantifiers; +import com.apple.foundationdb.record.query.plan.cascades.Reference; +import com.apple.foundationdb.record.query.plan.cascades.explain.Attribute; +import com.apple.foundationdb.record.query.plan.cascades.explain.NodeInfo; +import com.apple.foundationdb.record.query.plan.cascades.explain.PlannerGraph; +import com.apple.foundationdb.record.query.plan.cascades.typing.Type; +import com.apple.foundationdb.record.query.plan.cascades.values.Value; +import com.apple.foundationdb.record.query.plan.cascades.values.translation.TranslationMap; +import com.google.auto.service.AutoService; +import com.google.common.base.Verify; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Streams; +import com.google.protobuf.Message; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.util.List; +import java.util.Objects; +import java.util.Set; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * Intersection plan that compares using a {@link Value}. + */ +@SuppressWarnings("java:S2160") +public class RecordQueryMultiIntersectionOnValuesPlan extends RecordQueryIntersectionPlan implements RecordQueryPlanWithComparisonKeyValues { + + /** + * A list of {@link ProvidedOrderingPart}s that is used to compute the comparison key function. This attribute is + * transient and therefore not plan-serialized + */ + @Nullable + private final List comparisonKeyOrderingParts; + @Nonnull + private final Value resultValue; + + protected RecordQueryMultiIntersectionOnValuesPlan(@Nonnull final PlanSerializationContext serializationContext, + @Nonnull final PRecordQueryMultiIntersectionOnValuesPlan recordQueryMultiIntersectionOnValuesPlanProto) { + super(serializationContext, Objects.requireNonNull(recordQueryMultiIntersectionOnValuesPlanProto.getSuper())); + this.comparisonKeyOrderingParts = null; + this.resultValue = Value.fromValueProto(serializationContext, + recordQueryMultiIntersectionOnValuesPlanProto.getResultValue()); + } + + private RecordQueryMultiIntersectionOnValuesPlan(@Nonnull final List quantifiers, + @Nullable final List comparisonKeyOrderingParts, + @Nonnull final List comparisonKeyValues, + @Nonnull final Value resultValue, + final boolean reverse) { + super(quantifiers, + new ComparisonKeyFunction.OnValues(Quantifier.current(), comparisonKeyValues), + reverse); + this.comparisonKeyOrderingParts = + comparisonKeyOrderingParts == null ? null : ImmutableList.copyOf(comparisonKeyOrderingParts); + this.resultValue = resultValue; + } + + @Nonnull + @Override + public ComparisonKeyFunction.OnValues getComparisonKeyFunction() { + return (ComparisonKeyFunction.OnValues)super.getComparisonKeyFunction(); + } + + @Nonnull + @Override + public List getRequiredValues(@Nonnull final CorrelationIdentifier newBaseAlias, + @Nonnull final Type inputType) { + throw new RecordCoreException("this plan does not support getRequiredValues()"); + } + + @Nonnull + @Override + public Set getRequiredFields() { + throw new RecordCoreException("this plan does not support getRequiredFields()"); + } + + @Nonnull + @Override + public List getComparisonKeyOrderingParts() { + return Objects.requireNonNull(comparisonKeyOrderingParts); + } + + @Nonnull + @Override + public List getComparisonKeyValues() { + return getComparisonKeyFunction().getComparisonKeyValues(); + } + + @Nonnull + @Override + public Set getDynamicTypes() { + return Streams.concat(getComparisonKeyValues().stream(), Stream.of(resultValue)) + .flatMap(comparisonKeyValue -> + comparisonKeyValue.getDynamicTypes().stream()).collect(ImmutableSet.toImmutableSet()); + } + + @Nonnull + @Override + protected Value computeResultValue() { + return resultValue; + } + + @Nonnull + @Override + @SuppressWarnings("resource") + public RecordCursor executePlan(@Nonnull final FDBRecordStoreBase store, + @Nonnull final EvaluationContext context, + @Nullable final byte[] continuation, + @Nonnull final ExecuteProperties executeProperties) { + final var quantifiers = getQuantifiers(); + final ExecuteProperties childExecuteProperties = executeProperties.clearSkipAndLimit(); + return IntersectionMultiCursor.create( + getComparisonKeyFunction().apply(store, context), + reverse, + quantifiers.stream() + .map(physical -> ((Quantifier.Physical)physical).getRangesOverPlan()) + .map(childPlan -> (Function>) + ((byte[] childContinuation) -> childPlan + .executePlan(store, context, childContinuation, childExecuteProperties))) + .collect(Collectors.toList()), + continuation, + store.getTimer()) + .map(multiResult -> { + Verify.verify(getQuantifiers().size() == multiResult.size()); + final var childEvaluationContextBuilder = context.childBuilder(); + for (int i = 0; i < quantifiers.size(); i++) { + childEvaluationContextBuilder.setBinding(quantifiers.get(i).getAlias(), multiResult.get(i)); + } + final var childEvaluationContext = + childEvaluationContextBuilder.build(context.getTypeRepository()); + return QueryResult.ofComputed(getResultValue().eval(store, childEvaluationContext)); + }) + .skipThenLimit(executeProperties.getSkip(), executeProperties.getReturnedRowLimit()); + } + + @Nonnull + @Override + public RecordQueryMultiIntersectionOnValuesPlan translateCorrelations(@Nonnull final TranslationMap translationMap, + final boolean shouldSimplifyValues, + @Nonnull final List translatedQuantifiers) { + return new RecordQueryMultiIntersectionOnValuesPlan(Quantifiers.narrow(Quantifier.Physical.class, translatedQuantifiers), + comparisonKeyOrderingParts, + getComparisonKeyValues(), + resultValue, + isReverse()); + } + + @Nonnull + @Override + public RecordQueryMultiIntersectionOnValuesPlan withChildrenReferences(@Nonnull final List newChildren) { + return new RecordQueryMultiIntersectionOnValuesPlan( + newChildren.stream() + .map(Quantifier::physical) + .collect(ImmutableList.toImmutableList()), + comparisonKeyOrderingParts, + getComparisonKeyValues(), + resultValue, + isReverse()); + } + + @Override + public RecordQueryMultiIntersectionOnValuesPlan strictlySorted(@Nonnull final FinalMemoizer finalMemoizer) { + return this; + } + + @Nonnull + @Override + public PRecordQueryMultiIntersectionOnValuesPlan toProto(@Nonnull final PlanSerializationContext serializationContext) { + return PRecordQueryMultiIntersectionOnValuesPlan.newBuilder() + .setSuper(toRecordQueryIntersectionPlan(serializationContext)) + .setResultValue(resultValue.toValueProto(serializationContext)) + .build(); + } + + @Nonnull + @Override + public PRecordQueryPlan toRecordQueryPlanProto(@Nonnull final PlanSerializationContext serializationContext) { + return PRecordQueryPlan.newBuilder() + .setMultiIntersectionOnValuesPlan(toProto(serializationContext)).build(); + } + + @Nonnull + @Override + public PlannerGraph rewritePlannerGraph(@Nonnull final List childGraphs) { + return PlannerGraph.fromNodeAndChildGraphs( + new PlannerGraph.OperatorNodeWithInfo(this, + NodeInfo.INTERSECTION_OPERATOR, + ImmutableList.of("COMPARE BY {{comparisonKeyFunction}}", "RESULT {{resultValue}}"), + ImmutableMap.of("comparisonKeyFunction", Attribute.gml(getComparisonKeyFunction().toString()), + "resultValue", Attribute.gml(resultValue.toString()))), + childGraphs); + } + + @Nonnull + public static RecordQueryMultiIntersectionOnValuesPlan fromProto(@Nonnull final PlanSerializationContext serializationContext, + @Nonnull final PRecordQueryMultiIntersectionOnValuesPlan recordQueryMultiIntersectionOnValuesPlanProto) { + return new RecordQueryMultiIntersectionOnValuesPlan(serializationContext, recordQueryMultiIntersectionOnValuesPlanProto); + } + + @Nonnull + public static RecordQueryMultiIntersectionOnValuesPlan intersection(@Nonnull final List quantifiers, + @Nonnull final List comparisonKeyOrderingParts, + @Nonnull final Value resultValue, + final boolean isReverse) { + return new RecordQueryMultiIntersectionOnValuesPlan(quantifiers, + comparisonKeyOrderingParts, + ProvidedOrderingPart.comparisonKeyValues(comparisonKeyOrderingParts, isReverse), + resultValue, + isReverse); + } + + /** + * Deserializer. + */ + @AutoService(PlanDeserializer.class) + public static class Deserializer implements PlanDeserializer { + @Nonnull + @Override + public Class getProtoMessageClass() { + return PRecordQueryMultiIntersectionOnValuesPlan.class; + } + + @Nonnull + @Override + public RecordQueryMultiIntersectionOnValuesPlan fromProto(@Nonnull final PlanSerializationContext serializationContext, + @Nonnull final PRecordQueryMultiIntersectionOnValuesPlan recordQueryMultiIntersectionOnValuesPlanProto) { + return RecordQueryMultiIntersectionOnValuesPlan.fromProto(serializationContext, recordQueryMultiIntersectionOnValuesPlanProto); + } + } +} diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQuerySetPlan.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQuerySetPlan.java index 6cbcffefc8..437ba6e9dd 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQuerySetPlan.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQuerySetPlan.java @@ -123,7 +123,7 @@ default Set tryPushValues(@Nonnull final List resultValueFunction) { - final var groupingKeyAlias = CorrelationIdentifier.uniqueID(); - final var aggregateAlias = CorrelationIdentifier.uniqueID(); + final var groupingKeyAlias = CorrelationIdentifier.uniqueId(); + final var aggregateAlias = CorrelationIdentifier.uniqueId(); final var referencedGroupingKeyValue = groupingKeyValue == null @@ -487,8 +485,8 @@ public static RecordQueryStreamingAggregationPlan of(@Nonnull final Quantifier.P @Nonnull final AggregateValue aggregateValue, @Nonnull final BiFunction resultValueFunction, @Nonnull final SerializationMode serializationMode) { - final var groupingKeyAlias = CorrelationIdentifier.uniqueID(); - final var aggregateAlias = CorrelationIdentifier.uniqueID(); + final var groupingKeyAlias = CorrelationIdentifier.uniqueId(); + final var aggregateAlias = CorrelationIdentifier.uniqueId(); final var referencedGroupingKeyValue = groupingKeyValue == null diff --git a/fdb-record-layer-core/src/main/proto/record_query_plan.proto b/fdb-record-layer-core/src/main/proto/record_query_plan.proto index 5936ddd6f8..ecdff1a62e 100644 --- a/fdb-record-layer-core/src/main/proto/record_query_plan.proto +++ b/fdb-record-layer-core/src/main/proto/record_query_plan.proto @@ -1419,6 +1419,7 @@ message PRecordQueryPlan { PRecursiveUnionQueryPlan recursive_union_query_plan = 36; PRecordQueryTableFunctionPlan table_function_plan = 37; PRecordQueryStreamingAggregationPlan2 streaming_aggregation_plan2 = 38; + PRecordQueryMultiIntersectionOnValuesPlan multi_intersection_on_values_plan = 39; } } @@ -1782,6 +1783,14 @@ message PRecordQueryIntersectionOnValuesPlan { optional PRecordQueryIntersectionPlan super = 1; } +// +// PRecordQueryMultiIntersectionOnValuesPlan +// +message PRecordQueryMultiIntersectionOnValuesPlan { + optional PRecordQueryIntersectionPlan super = 1; + optional PValue result_value = 2; +} + // // PRecordQueryInUnionPlan // diff --git a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/UnnestedRecordTypeTest.java b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/UnnestedRecordTypeTest.java index 73bcc1ca9e..f7cdb1986f 100644 --- a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/UnnestedRecordTypeTest.java +++ b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/UnnestedRecordTypeTest.java @@ -2316,10 +2316,11 @@ void deleteWhereOnMultiTypeFailsWithAmbiguousParent() { @Test void deleteWhereOnMultiTypeFailsWithRecordTypePrefix() { - // Create a multi-type index on two different unnested types. Each one has a parent constituent named and an inner constituent, so the index is well-defined. - // The multi-type index in this case has a record type prefix. In theory, we actually could perform the delete records where, but the record type key in the - // index matches the synthetic type's record type key, not the base type. This means we'd need to translate the record type key before deleting data from the - // index. Until we get that working, just assert that this fails. + // Create a multi-type index on two different unnested types. Each one has a parent constituent named and an + // inner constituent, so the index is well-defined. The multi-type index in this case has a record type prefix. + // In theory, we actually could perform the delete records where, but the record type key in the index matches + // the synthetic type's record type key, not the base type. This means we'd need to translate the record type + // key before deleting data from the index. Until we get that working, just assert that this fails. final RecordMetaDataHook hook = addMultiTypeDoubleUnnestedIndex(concat(recordType(), field(PARENT_CONSTITUENT).nest(field("middle").nest("other_int")), field("inner").nest("foo"))) .andThen(setOuterAndMiddlePrimaryKey(concat(recordType(), field("middle").nest("other_int"), field("rec_no")))); final RecordMetaData metaData = doubleNestedMetaData(hook); diff --git a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBInQueryTest.java b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBInQueryTest.java index b5de65a4bb..978a12fcb6 100644 --- a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBInQueryTest.java +++ b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBInQueryTest.java @@ -312,7 +312,7 @@ void testInQueryIndex(boolean reverse) throws Exception { @DualPlannerTest(planner = DualPlannerTest.Planner.CASCADES) void testInQueryWithConstantValueUnsorted() throws Exception { complexQuerySetup(NO_HOOK); - final ConstantObjectValue constant = ConstantObjectValue.of(CorrelationIdentifier.uniqueID(), "0", new Type.Array(false, Type.primitiveType(Type.TypeCode.INT, false))); + final ConstantObjectValue constant = ConstantObjectValue.of(CorrelationIdentifier.uniqueId(), "0", new Type.Array(false, Type.primitiveType(Type.TypeCode.INT, false))); final RecordQueryPlan plan = planGraph(() -> { final Quantifier base = fullTypeScan(recordStore.getRecordMetaData(), "MySimpleRecord"); var select = GraphExpansion.builder() @@ -648,7 +648,7 @@ void testInQuerySortedByConstantValue(boolean reverse) throws Exception { Assumptions.assumeTrue(useCascadesPlanner); complexQuerySetup(NO_HOOK); - final ConstantObjectValue constant = ConstantObjectValue.of(Quantifier.uniqueID(), "0", new Type.Array(false, Type.primitiveType(Type.TypeCode.INT, false))); + final ConstantObjectValue constant = ConstantObjectValue.of(Quantifier.uniqueId(), "0", new Type.Array(false, Type.primitiveType(Type.TypeCode.INT, false))); planner.setConfiguration(planner.getConfiguration().asBuilder() .setAttemptFailedInJoinAsUnionMaxSize(100) .build()); @@ -1104,7 +1104,7 @@ void testConstantObjectInQuerySortedWithExtraUnorderedColumns(boolean reverse) t .andThen(metaDataBuilder -> metaDataBuilder.addIndex("MySimpleRecord", index)); complexQuerySetup(hook); - final CorrelationIdentifier constantAlias = CorrelationIdentifier.uniqueID(); + final CorrelationIdentifier constantAlias = CorrelationIdentifier.uniqueId(); final ConstantObjectValue nv2Constant = ConstantObjectValue.of(constantAlias, "0", Type.primitiveType(Type.TypeCode.INT, false)); final ConstantObjectValue listConstant = ConstantObjectValue.of(constantAlias, "1", new Type.Array(false, Type.primitiveType(Type.TypeCode.INT, false))); planner.setConfiguration(planner.getConfiguration().asBuilder().setAttemptFailedInJoinAsUnionMaxSize(10).build()); diff --git a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBLongArithmeticFunctionQueryTest.java b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBLongArithmeticFunctionQueryTest.java index 0c68f66100..dfd7d8c54b 100644 --- a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBLongArithmeticFunctionQueryTest.java +++ b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBLongArithmeticFunctionQueryTest.java @@ -416,7 +416,7 @@ void matchConstantMaskValue() { openSimpleRecordStore(context, hook); final String maskResultParam = "masked"; - final CorrelationIdentifier baseConstantId = CorrelationIdentifier.uniqueID(); + final CorrelationIdentifier baseConstantId = CorrelationIdentifier.uniqueId(); final ConstantObjectValue maskConstantValue = ConstantObjectValue.of(baseConstantId, "mask", Type.primitiveType(Type.TypeCode.LONG, false)); for (int i = 0; i < 3; i++) { final long mask = (1 << i); diff --git a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBPermutedMinMaxQueryTest.java b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBPermutedMinMaxQueryTest.java index 7ac7e9985a..3aef7d7f93 100644 --- a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBPermutedMinMaxQueryTest.java +++ b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBPermutedMinMaxQueryTest.java @@ -414,7 +414,7 @@ public String toString() { @Nonnull static Stream selectMaxWithInOrderByMax() { - ConstantObjectValue constant = ConstantObjectValue.of(Quantifier.uniqueID(), "0", new Type.Array(false, Type.primitiveType(Type.TypeCode.INT, false))); + ConstantObjectValue constant = ConstantObjectValue.of(Quantifier.uniqueId(), "0", new Type.Array(false, Type.primitiveType(Type.TypeCode.INT, false))); return Stream.of( new InComparisonCase("byParameter", new Comparisons.ParameterComparison(Comparisons.Type.IN, "numValue2List"), nv2List -> Bindings.newBuilder().set("numValue2List", nv2List).build(), 2026350341, -272644765), new InComparisonCase("byLiteral", new Comparisons.ListComparison(Comparisons.Type.IN, List.of(-1, -1)), nv2List -> { @@ -496,7 +496,7 @@ void selectMaxWithInOrderByMax(InComparisonCase inComparisonCase) throws Excepti @Nonnull static Stream testMaxWithInAndDupes() { - ConstantObjectValue constant = ConstantObjectValue.of(Quantifier.uniqueID(), "0", new Type.Array(false, Type.primitiveType(Type.TypeCode.STRING, false))); + ConstantObjectValue constant = ConstantObjectValue.of(Quantifier.uniqueId(), "0", new Type.Array(false, Type.primitiveType(Type.TypeCode.STRING, false))); return Stream.of( new InComparisonCase("byParameter", new Comparisons.ParameterComparison(Comparisons.Type.IN, "strValueList"), strValueList -> Bindings.newBuilder().set("strValueList", strValueList).build(), 2106093264, 1809779597), new InComparisonCase("byLiteral", new Comparisons.ListComparison(Comparisons.Type.IN, List.of("even", "odd")), strValueList -> { @@ -638,7 +638,7 @@ void testSortedMaxWithEqualityOnRepeater() { @Nonnull static Stream testSortedMaxWithInOnRepeater() { - ConstantObjectValue constant = ConstantObjectValue.of(Quantifier.uniqueID(), "0", new Type.Array(false, Type.primitiveType(Type.TypeCode.INT, false))); + ConstantObjectValue constant = ConstantObjectValue.of(Quantifier.uniqueId(), "0", new Type.Array(false, Type.primitiveType(Type.TypeCode.INT, false))); return Stream.of( new InComparisonCase("byParameter", new Comparisons.ParameterComparison(Comparisons.Type.IN, "xValueList"), xValueList -> Bindings.newBuilder().set("xValueList", xValueList).build(), -1502950720, -1056018522), new InComparisonCase("byLiteral", new Comparisons.ListComparison(Comparisons.Type.IN, List.of(0, 0)), strValueList -> { @@ -747,7 +747,7 @@ void testSortedMaxWithInOnRepeater(InComparisonCase inComparisonCase) { @Nonnull static Stream testMaxUniqueByStr2And3WithDifferentOrderingKeys() { - ConstantObjectValue constant = ConstantObjectValue.of(Quantifier.uniqueID(), "0", new Type.Array(false, Type.primitiveType(Type.TypeCode.STRING, false))); + ConstantObjectValue constant = ConstantObjectValue.of(Quantifier.uniqueId(), "0", new Type.Array(false, Type.primitiveType(Type.TypeCode.STRING, false))); List literalStrList = ImmutableList.of("even", "odd", "empty", "other1", "other2"); return Stream.of( new InComparisonCase("byParameter", new Comparisons.ParameterComparison(Comparisons.Type.IN, "strValueList"), strValueList -> Bindings.newBuilder().set("strValueList", strValueList).build(), 755361732, -85959138), diff --git a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/TempTableTest.java b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/TempTableTest.java index 1169baff2d..92218d9183 100644 --- a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/TempTableTest.java +++ b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/TempTableTest.java @@ -72,7 +72,7 @@ void scanTempTableWorksCorrectly() throws Exception { try (FDBRecordContext context = openContext()) { // select id, value from . final var tempTable = tempTableInstance(); - final var tempTableId = CorrelationIdentifier.uniqueID(); + final var tempTableId = CorrelationIdentifier.uniqueId(); final var plan = createAndOptimizeTempTableScanPlan(tempTableId); addSampleDataToTempTable(tempTable); final var expectedResults = ImmutableList.of(Pair.of(42L, "fortySecondValue"), @@ -87,7 +87,7 @@ void scanTempTableWithPredicateWorksCorrectly() throws Exception { try (FDBRecordContext context = openContext()) { final var tempTable = tempTableInstance(); addSampleDataToTempTable(tempTable); - final var tempTableId = CorrelationIdentifier.uniqueID(); + final var tempTableId = CorrelationIdentifier.uniqueId(); final var tempTableScanQun = Quantifier.forEach(Reference.initialOf(TempTableScanExpression.ofCorrelated(tempTableId, getTempTableType()))); final var selectExpressionBuilder = GraphExpansion.builder() .addAllResultColumns(ImmutableList.of(getIdCol(tempTableScanQun), getValueCol(tempTableScanQun))) @@ -107,7 +107,7 @@ void insertIntoTempTableWorksCorrectly() throws Exception { // insert into values ((1, 'first'), (2, 'second')) try (FDBRecordContext context = openContext()) { final var tempTable = tempTableInstance(); - final var tempTableId = CorrelationIdentifier.uniqueID(); + final var tempTableId = CorrelationIdentifier.uniqueId(); final var firstRecord = rcv(1L, "first"); final var secondArray = rcv(2L, "second"); final var explodeExpression = new ExplodeExpression(AbstractArrayConstructorValue.LightArrayConstructorValue.of(firstRecord, secondArray)); @@ -132,11 +132,11 @@ void insertIntoTempTableWorksCorrectly() throws Exception { } @DualPlannerTest(planner = DualPlannerTest.Planner.CASCADES) - void insertIntoTempTableWorksCorrectlyAcrossContinuations() throws Exception { + void insertIntoTempTableWorksCorrectlyAcrossContinuations() { // insert into values ((1, 'first'), stop, resume, then insert (2, 'second')) byte[] continuation = null; RecordQueryPlan planToResume = null; - final var tempTableId = CorrelationIdentifier.uniqueID(); + final var tempTableId = CorrelationIdentifier.uniqueId(); { final var tempTable = tempTableInstance(); @@ -183,7 +183,7 @@ void scanTempTableWithPredicateWorksCorrectlyAcrossContinuations() { // select id, value from where id < 44L. byte[] continuation = null; RecordQueryPlan planToResume = null; - final var tempTableId = CorrelationIdentifier.uniqueID(); + final var tempTableId = CorrelationIdentifier.uniqueId(); final var tempTable = tempTableInstance(); try (FDBRecordContext context = openContext()) { tempTable.add(queryResult(1L, "one")); diff --git a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/query/plan/cascades/ConstantFoldingTestUtils.java b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/query/plan/cascades/ConstantFoldingTestUtils.java index 6e5ea67299..92e1dd0eec 100644 --- a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/query/plan/cascades/ConstantFoldingTestUtils.java +++ b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/query/plan/cascades/ConstantFoldingTestUtils.java @@ -186,7 +186,7 @@ public static EvaluationContext mergeEvaluationContexts(@Nonnull final ValueWrap @Nonnull public static ValueWrapper newCov(@Nonnull final Type type, @Nullable Object bindingValue) { - final var correlationId = CorrelationIdentifier.uniqueID(); + final var correlationId = CorrelationIdentifier.uniqueId(); final var constantId = String.valueOf(counter++); final var bindingKey = Bindings.Internal.CONSTANT.bindingName(correlationId.getId()); final var bindingValueMap = new HashMap(); diff --git a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/query/plan/cascades/MacroFunctionTest.java b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/query/plan/cascades/MacroFunctionTest.java index 0ff371ca33..c1659f958a 100644 --- a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/query/plan/cascades/MacroFunctionTest.java +++ b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/query/plan/cascades/MacroFunctionTest.java @@ -43,7 +43,7 @@ void testColumnProjection() { Type.Record.Field.of(Type.primitiveType(Type.TypeCode.STRING), Optional.of("name")), Type.Record.Field.of(Type.primitiveType(Type.TypeCode.LONG), Optional.of("id"))); Type record = Type.Record.fromFields(false, fields); - QuantifiedObjectValue param = QuantifiedObjectValue.of(CorrelationIdentifier.uniqueID(), record); + QuantifiedObjectValue param = QuantifiedObjectValue.of(CorrelationIdentifier.uniqueId(), record); FieldValue bodyValue = FieldValue.ofFieldName(param, "name"); MacroFunction macroFunction = new MacroFunction("getName", ImmutableList.of(param), bodyValue); @@ -60,8 +60,8 @@ void testAdd() { ImmutableList fields = ImmutableList.of( Type.Record.Field.of(Type.primitiveType(Type.TypeCode.LONG), Optional.of("id"))); Type record = Type.Record.fromFields(false, fields); - QuantifiedObjectValue param1 = QuantifiedObjectValue.of(CorrelationIdentifier.uniqueID(), record); - QuantifiedObjectValue param2 = QuantifiedObjectValue.of(CorrelationIdentifier.uniqueID(), record); + QuantifiedObjectValue param1 = QuantifiedObjectValue.of(CorrelationIdentifier.uniqueId(), record); + QuantifiedObjectValue param2 = QuantifiedObjectValue.of(CorrelationIdentifier.uniqueId(), record); ArithmeticValue bodyValue = new ArithmeticValue(ArithmeticValue.PhysicalOperator.ADD_LL, param1, param2); MacroFunction macroFunction = new MacroFunction("add", ImmutableList.of(param1, param2), bodyValue); diff --git a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/query/plan/explain/ExplainPlanVisitorTest.java b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/query/plan/explain/ExplainPlanVisitorTest.java index 6142e28925..9dedcb1494 100644 --- a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/query/plan/explain/ExplainPlanVisitorTest.java +++ b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/query/plan/explain/ExplainPlanVisitorTest.java @@ -304,7 +304,7 @@ private static NonnullPair randomExplodePlan(@Nonnull R if (r.nextBoolean()) { collectionValue = LiteralValue.ofList(List.of(1, 2, 3, 4, 5)); } else { - collectionValue = ConstantObjectValue.of(CorrelationIdentifier.uniqueID(), "__const_" + r.nextInt(10), new Type.Array(Type.primitiveType(Type.TypeCode.LONG, false))); + collectionValue = ConstantObjectValue.of(CorrelationIdentifier.uniqueId(), "__const_" + r.nextInt(10), new Type.Array(Type.primitiveType(Type.TypeCode.LONG, false))); } return NonnullPair.of(new RecordQueryExplodePlan(collectionValue), String.format("EXPLODE %s", collectionValue)); } diff --git a/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/api/metrics/NoOpMetricRegistry.java b/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/api/metrics/NoOpMetricRegistry.java index 7296c260cb..a663ba3618 100644 --- a/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/api/metrics/NoOpMetricRegistry.java +++ b/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/api/metrics/NoOpMetricRegistry.java @@ -30,7 +30,7 @@ * A utility for accessing a no-op {@link MetricRegistry}. *

    * NOTE(stack): Consider NOT using codahale but prometheus metrics. If server is exporting metrics - * on an prometheus endpoint, codahale will require translation (there are translators but better not + * on a prometheus endpoint, codahale will require translation (there are translators but better not * to translate at all). What is the story for clients? RL is codahale? */ @API(API.Status.EXPERIMENTAL) diff --git a/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/recordlayer/query/Expression.java b/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/recordlayer/query/Expression.java index 8ba8522e37..30598386a1 100644 --- a/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/recordlayer/query/Expression.java +++ b/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/recordlayer/query/Expression.java @@ -207,7 +207,7 @@ public boolean canBeDerivedFrom(@Nonnull final Expression expression, final var aliasMap = AliasMap.identitiesFor(value.getCorrelatedTo()); final var simplifiedValue = value.simplify(EvaluationContext.empty(), aliasMap, constantAliases); final var thisValue = getUnderlying(); - final var quantifier = CorrelationIdentifier.uniqueID(); + final var quantifier = CorrelationIdentifier.uniqueId(); final var result = simplifiedValue.pullUp(ImmutableList.of(thisValue), EvaluationContext.empty(), aliasMap, constantAliases, quantifier); return result.containsKey(thisValue); diff --git a/fdb-relational-grpc/src/main/java/com/apple/foundationdb/relational/jdbc/grpc/GrpcSQLExceptionUtil.java b/fdb-relational-grpc/src/main/java/com/apple/foundationdb/relational/jdbc/grpc/GrpcSQLExceptionUtil.java index b9bca3b0dc..1b2aca073d 100644 --- a/fdb-relational-grpc/src/main/java/com/apple/foundationdb/relational/jdbc/grpc/GrpcSQLExceptionUtil.java +++ b/fdb-relational-grpc/src/main/java/com/apple/foundationdb/relational/jdbc/grpc/GrpcSQLExceptionUtil.java @@ -222,7 +222,7 @@ private static SQLException map(String message, ErrorInfo errorInfo) { } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { // Just fall through to plain-old sqlexception. - if (logger.isTraceEnabled()) { + if (logger.isTraceEnabled() && e.getMessage() != null) { logger.trace(e.getMessage()); } } diff --git a/yaml-tests/src/main/java/com/apple/foundationdb/relational/yamltests/YamlTestExtension.java b/yaml-tests/src/main/java/com/apple/foundationdb/relational/yamltests/YamlTestExtension.java index 863ad089e5..c5a9ce7816 100644 --- a/yaml-tests/src/main/java/com/apple/foundationdb/relational/yamltests/YamlTestExtension.java +++ b/yaml-tests/src/main/java/com/apple/foundationdb/relational/yamltests/YamlTestExtension.java @@ -70,7 +70,7 @@ public class YamlTestExtension implements TestTemplateInvocationContextProvider, private final boolean includeMethodInDescriptions; public YamlTestExtension() { - this(null, false); + this(null, true); } /** diff --git a/yaml-tests/src/test/java/YamlIntegrationTests.java b/yaml-tests/src/test/java/YamlIntegrationTests.java index f52cbbe822..f6f77f967c 100644 --- a/yaml-tests/src/test/java/YamlIntegrationTests.java +++ b/yaml-tests/src/test/java/YamlIntegrationTests.java @@ -295,4 +295,9 @@ public void literalTests(YamlTest.Runner runner) throws Exception { public void transactionalCallsTest(YamlTest.Runner runner) throws Exception { runner.runYamsql("transactions-tests.yamsql"); } + + @TestTemplate + public void compositeAggregates(YamlTest.Runner runner) throws Exception { + runner.runYamsql("composite-aggregates.yamsql"); + } } diff --git a/yaml-tests/src/test/resources/aggregate-empty-table.metrics.binpb b/yaml-tests/src/test/resources/aggregate-empty-table.metrics.binpb index 821d1733bc..dadb2d1128 100644 --- a/yaml-tests/src/test/resources/aggregate-empty-table.metrics.binpb +++ b/yaml-tests/src/test/resources/aggregate-empty-table.metrics.binpb @@ -1,71 +1,71 @@ - + 9 -agg-empty-table-tests EXPLAIN select count(*) from T1; -@ T(0ǘ 8@SCAN(<,>) | TFILTER T1 | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +agg-empty-table-tests EXPLAIN select count(*) from T1; +D X(0 8@SCAN(<,>) | TFILTER T1 | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 6 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 7 [ label=<
    Primary Storage
    record types: [T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q34> label="q34" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q37> label="q37" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q25> label="q25" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} H -agg-empty-table-tests/EXPLAIN select count(*) from T1 where col1 = 0; -U Ű(0Ͻ8@SCAN(<,>) | TFILTER T1 | FILTER _.COL1 EQUALS promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +agg-empty-table-tests/EXPLAIN select count(*) from T1 where col1 = 0; +ɘY (08@SCAN(<,>) | TFILTER T1 | FILTER _.COL1 EQUALS promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q30 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 EQUALS promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 4 [ label=<
    Value Computation
    MAP (q32 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 EQUALS promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 7 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 8 [ label=<
    Primary Storage
    record types: [T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q39> label="q39" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q30> label="q30" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q42> label="q42" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q32> label="q32" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 6 [ label=< q25> label="q25" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} H -agg-empty-table-tests/EXPLAIN select count(*) from T1 where col1 > 0; -U (08@SCAN(<,>) | TFILTER T1 | FILTER _.COL1 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +agg-empty-table-tests/EXPLAIN select count(*) from T1 where col1 > 0; +Y (08@SCAN(<,>) | TFILTER T1 | FILTER _.COL1 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q30 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 GREATER_THAN promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 4 [ label=<
    Value Computation
    MAP (q32 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 GREATER_THAN promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 7 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 8 [ label=<
    Primary Storage
    record types: [T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q39> label="q39" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q30> label="q30" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q42> label="q42" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q32> label="q32" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 6 [ label=< q25> label="q25" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} 9 -agg-empty-table-tests EXPLAIN select count(*) from T2; -  (30"8)@AISCAN(T2_I1 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +agg-empty-table-tests EXPLAIN select count(*) from T2; + (<0>87@AISCAN(T2_I1 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; @@ -73,259 +73,255 @@ H 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Value Computation
    MAP (q4 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 5 [ label=<
    Index
    T2_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 5 [ label=<
    Index
    T2_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q4> label="q4" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} H -agg-empty-table-tests/EXPLAIN select count(*) from T2 where col1 = 0; - (:0-8/@AISCAN(T2_I2 [EQUALS promote(@c11 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +agg-empty-table-tests/EXPLAIN select count(*) from T2 where col1 = 0; +  (:0%8/@AISCAN(T2_I2 [EQUALS promote(@c11 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Value Computation
    MAP ((q4._1 AS _0) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 5 [ label=<
    Index
    T2_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 5 [ label=<
    Index
    T2_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q4> label="q4" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} H -agg-empty-table-tests/EXPLAIN select count(*) from T2 where col1 > 0; -Ւp (-0ؗ8@SCAN(<,>) | TFILTER T2 | FILTER _.COL1 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +agg-empty-table-tests/EXPLAIN select count(*) from T2 where col1 > 0; +܆ ם +(:0382@AISCAN(T2_I2 [[GREATER_THAN promote(@c11 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | AGG sum_l(_._1) GROUP BY () | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q84 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 GREATER_THAN promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Type Filter
    WHERE record IS [T2]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 7 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 8 [ label=<
    Primary Storage
    record types: [T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; + 3 [ label=<
    Value Computation
    MAP ((q4._1 AS _0) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Streaming Aggregate
    COLLECT sum_l(q102._1)
    GROUP BY ()
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; + 5 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 6 [ label=<
    Index
    T2_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q93> label="q93" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q84> label="q84" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q78> label="q78" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q4> label="q4" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q102> label="q102" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} G -agg-empty-table-tests.EXPLAIN select count(*) from T2 group by col1; - -v (008@MAISCAN(T2_I2 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) +agg-empty-table-tests.EXPLAIN select count(*) from T2 group by col1; + } (00Ă8@MAISCAN(T2_I2 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    T2_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    T2_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} V -agg-empty-table-tests=EXPLAIN select count(*) from T2 where col1 = 0 group by col1; - x (008@hAISCAN(T2_I2 [EQUALS promote(@c11 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) +agg-empty-table-tests=EXPLAIN select count(*) from T2 where col1 = 0 group by col1; +  (008@hAISCAN(T2_I2 [EQUALS promote(@c11 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    T2_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    T2_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} V -agg-empty-table-tests=EXPLAIN select count(*) from T2 where col1 > 0 group by col1; - x 꾼(008@pAISCAN(T2_I2 [[GREATER_THAN promote(@c11 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) +agg-empty-table-tests=EXPLAIN select count(*) from T2 where col1 > 0 group by col1; +  (008@pAISCAN(T2_I2 [[GREATER_THAN promote(@c11 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    T2_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    T2_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} 9 -agg-empty-table-tests EXPLAIN select count(*) from T3; -\ (%0780@ISCAN(T3_I2 <,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +agg-empty-table-tests EXPLAIN select count(*) from T3; +` (%0&80@ISCAN(T3_I2 <,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    T3_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    T3_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q72> label="q72" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q81> label="q81" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} H -agg-empty-table-tests/EXPLAIN select count(*) from T3 where col1 = 0; -  ՝(-0F8F@ISCAN(T3_I1 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +agg-empty-table-tests/EXPLAIN select count(*) from T3 where col1 = 0; + Ţ(-0%8F@ISCAN(T3_I1 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q89> label="q89" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q98> label="q98" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} H -agg-empty-table-tests/EXPLAIN select count(*) from T3 where col1 > 0; -  (.0F8H@ISCAN(T3_I1 [[GREATER_THAN promote(@c11 AS LONG)]]) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +agg-empty-table-tests/EXPLAIN select count(*) from T3 where col1 > 0; +  (.018H@ISCAN(T3_I1 [[GREATER_THAN promote(@c11 AS LONG)]]) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q93> label="q93" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q102> label="q102" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} G -agg-empty-table-tests.EXPLAIN select count(*) from T3 group by col1; -L ̅(08@mISCAN(T3_I1 <,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0)digraph G { +agg-empty-table-tests.EXPLAIN select count(*) from T3 group by col1; +P (08@mISCAN(T3_I1 <,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    GROUP BY (q47._0.COL1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q47> label="q47" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    GROUP BY (q50._0.COL1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, LONG AS _0 AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 5 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ label=< q50> label="q50" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} V -agg-empty-table-tests=EXPLAIN select count(*) from T3 where col1 = 0 group by col1; -g ("08#@ISCAN(T3_I1 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (count_star(*) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0)digraph G { +agg-empty-table-tests=EXPLAIN select count(*) from T3 where col1 = 0 group by col1; +k ("08#@ISCAN(T3_I1 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (count_star(*) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    GROUP BY (q55._0.COL1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 4 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q55> label="q55" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    GROUP BY (q58._0.COL1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, LONG AS _0 AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 4 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 5 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ label=< q58> label="q58" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} V -agg-empty-table-tests=EXPLAIN select count(*) from T3 where col1 > 0 group by col1; -g ("08#@ISCAN(T3_I1 [[GREATER_THAN promote(@c11 AS LONG)]]) | MAP (_ AS _0) | AGG (count_star(*) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0)digraph G { +agg-empty-table-tests=EXPLAIN select count(*) from T3 where col1 > 0 group by col1; +̎k ג("08#@ISCAN(T3_I1 [[GREATER_THAN promote(@c11 AS LONG)]]) | MAP (_ AS _0) | AGG (count_star(*) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    GROUP BY (q55._0.COL1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 4 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q55> label="q55" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    GROUP BY (q58._0.COL1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, LONG AS _0 AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 4 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 5 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ label=< q58> label="q58" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} < -agg-empty-table-tests#EXPLAIN select count(col2) from T1; -@ (08@SCAN(<,>) | TFILTER T1 | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +agg-empty-table-tests#EXPLAIN select count(col2) from T1; +ԣD h(0 8@SCAN(<,>) | TFILTER T1 | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q34._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q37._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 6 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 7 [ label=<
    Primary Storage
    record types: [T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q34> label="q34" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q37> label="q37" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q25> label="q25" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} K -agg-empty-table-tests2EXPLAIN select count(col2) from T1 where col1 = 0; -U Ì(08@SCAN(<,>) | TFILTER T1 | FILTER _.COL1 EQUALS promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +agg-empty-table-tests2EXPLAIN select count(col2) from T1 where col1 = 0; +ˁY ש(08@SCAN(<,>) | TFILTER T1 | FILTER _.COL1 EQUALS promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q39._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q30 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 EQUALS promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q42._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q32 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 EQUALS promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 7 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 8 [ label=<
    Primary Storage
    record types: [T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q39> label="q39" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q30> label="q30" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q42> label="q42" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q32> label="q32" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 6 [ label=< q25> label="q25" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} K -agg-empty-table-tests2EXPLAIN select count(col2) from T1 where col1 > 0; -U (0݉8@SCAN(<,>) | TFILTER T1 | FILTER _.COL1 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +agg-empty-table-tests2EXPLAIN select count(col2) from T1 where col1 > 0; +üY (08@SCAN(<,>) | TFILTER T1 | FILTER _.COL1 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q39._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q30 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 GREATER_THAN promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q42._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q32 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 GREATER_THAN promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 7 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 8 [ label=<
    Primary Storage
    record types: [T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q39> label="q39" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q30> label="q30" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q42> label="q42" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q32> label="q32" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 6 [ label=< q25> label="q25" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} < -agg-empty-table-tests#EXPLAIN select count(col2) from T2; - (30 8)@AISCAN(T2_I3 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +agg-empty-table-tests#EXPLAIN select count(col2) from T2; + (<0387@AISCAN(T2_I3 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; @@ -333,303 +329,302 @@ K 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Value Computation
    MAP (q4 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 5 [ label=<
    Index
    T2_I3
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 5 [ label=<
    Index
    T2_I3
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q4> label="q4" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} K -agg-empty-table-tests2EXPLAIN select count(col2) from T2 where col1 = 0; -ѵ ✜ -(:078/@AISCAN(T2_I4 [EQUALS promote(@c11 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +agg-empty-table-tests2EXPLAIN select count(col2) from T2 where col1 = 0; + + (:0 8/@AISCAN(T2_I4 [EQUALS promote(@c11 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Value Computation
    MAP ((q4._1 AS _0) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 5 [ label=<
    Index
    T2_I4
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 5 [ label=<
    Index
    T2_I4
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q4> label="q4" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} K -agg-empty-table-tests2EXPLAIN select count(col2) from T2 where col1 > 0; -p (-08@SCAN(<,>) | TFILTER T2 | FILTER _.COL1 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +agg-empty-table-tests2EXPLAIN select count(col2) from T2 where col1 > 0; + (:0582@AISCAN(T2_I4 [[GREATER_THAN promote(@c11 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | AGG sum_l(_._1) GROUP BY () | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q93._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q84 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 GREATER_THAN promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Type Filter
    WHERE record IS [T2]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 7 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 8 [ label=<
    Primary Storage
    record types: [T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; + 3 [ label=<
    Value Computation
    MAP ((q4._1 AS _0) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Streaming Aggregate
    COLLECT sum_l(q102._1)
    GROUP BY ()
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; + 5 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 6 [ label=<
    Index
    T2_I4
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q93> label="q93" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q84> label="q84" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q78> label="q78" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q4> label="q4" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q102> label="q102" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} J -agg-empty-table-tests1EXPLAIN select count(col2) from T2 group by col1; -v 璑(00 8@MAISCAN(T2_I4 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) +agg-empty-table-tests1EXPLAIN select count(col2) from T2 group by col1; + +} ۯ(008@MAISCAN(T2_I4 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    T2_I4
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    T2_I4
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} Y -agg-empty-table-tests@EXPLAIN select count(col2) from T2 where col1 = 0 group by col1; -x ƍ(008@hAISCAN(T2_I4 [EQUALS promote(@c11 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) +agg-empty-table-tests@EXPLAIN select count(col2) from T2 where col1 = 0 group by col1; +  (008@hAISCAN(T2_I4 [EQUALS promote(@c11 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    T2_I4
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    T2_I4
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} Y -agg-empty-table-tests@EXPLAIN select count(col2) from T2 where col1 > 0 group by col1; -ڭ x (008@pAISCAN(T2_I4 [[GREATER_THAN promote(@c11 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) +agg-empty-table-tests@EXPLAIN select count(col2) from T2 where col1 > 0 group by col1; +̎  ˄(008@pAISCAN(T2_I4 [[GREATER_THAN promote(@c11 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    T2_I4
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    T2_I4
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} < -agg-empty-table-tests#EXPLAIN select count(col2) from T3; -\ (%0*80@ISCAN(T3_I1 <,>) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +agg-empty-table-tests#EXPLAIN select count(col2) from T3; +` ު(%0ѯ-80@ISCAN(T3_I1 <,>) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q74._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q83._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q74> label="q74" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q83> label="q83" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} K -agg-empty-table-tests2EXPLAIN select count(col2) from T3 where col1 = 0; -  (-0G8F@ISCAN(T3_I1 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +agg-empty-table-tests2EXPLAIN select count(col2) from T3 where col1 = 0; +  (-008F@ISCAN(T3_I1 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q89._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q98._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q89> label="q89" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q98> label="q98" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} K -agg-empty-table-tests2EXPLAIN select count(col2) from T3 where col1 > 0; -  (.0C8H@ISCAN(T3_I1 [[GREATER_THAN promote(@c11 AS LONG)]]) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +agg-empty-table-tests2EXPLAIN select count(col2) from T3 where col1 > 0; +  (.0E8H@ISCAN(T3_I1 [[GREATER_THAN promote(@c11 AS LONG)]]) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q93._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q102._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q93> label="q93" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q102> label="q102" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} J -agg-empty-table-tests1EXPLAIN select count(col2) from T3 group by col1; -L (08@pISCAN(T3_I1 <,>) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0)digraph G { +agg-empty-table-tests1EXPLAIN select count(col2) from T3 group by col1; +ٷP ԍ(08@pISCAN(T3_I1 <,>) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Streaming Aggregate
    COLLECT (count(q47._0.COL2) AS _0)
    GROUP BY (q47._0.COL1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q47> label="q47" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT (count(q50._0.COL2) AS _0)
    GROUP BY (q50._0.COL1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, LONG AS _0 AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 5 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ label=< q50> label="q50" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} Y -agg-empty-table-tests@EXPLAIN select count(col2) from T3 where col1 = 0 group by col1; -g ("08#@ISCAN(T3_I1 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0)digraph G { +agg-empty-table-tests@EXPLAIN select count(col2) from T3 where col1 = 0 group by col1; +k ("0 +8#@ISCAN(T3_I1 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Streaming Aggregate
    COLLECT (count(q55._0.COL2) AS _0)
    GROUP BY (q55._0.COL1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 4 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q55> label="q55" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT (count(q58._0.COL2) AS _0)
    GROUP BY (q58._0.COL1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, LONG AS _0 AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 4 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 5 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ label=< q58> label="q58" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} Y -agg-empty-table-tests@EXPLAIN select count(col2) from T3 where col1 > 0 group by col1; -ݿg ("0̃8#@ISCAN(T3_I1 [[GREATER_THAN promote(@c11 AS LONG)]]) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0)digraph G { +agg-empty-table-tests@EXPLAIN select count(col2) from T3 where col1 > 0 group by col1; +k ("08#@ISCAN(T3_I1 [[GREATER_THAN promote(@c11 AS LONG)]]) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Streaming Aggregate
    COLLECT (count(q55._0.COL2) AS _0)
    GROUP BY (q55._0.COL1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 4 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q55> label="q55" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT (count(q58._0.COL2) AS _0)
    GROUP BY (q58._0.COL1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, LONG AS _0 AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 4 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 5 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ label=< q58> label="q58" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} : -agg-empty-table-tests!EXPLAIN select sum(col1) from T1; -@ F(0Ɍ 8@kSCAN(<,>) | TFILTER T1 | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +agg-empty-table-tests!EXPLAIN select sum(col1) from T1; +ЕD g(08@kSCAN(<,>) | TFILTER T1 | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q34._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q37._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 6 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 7 [ label=<
    Primary Storage
    record types: [T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q34> label="q34" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q37> label="q37" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q25> label="q25" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} I -agg-empty-table-tests0EXPLAIN select sum(col1) from T1 where col1 = 0; -U (08@SCAN(<,>) | TFILTER T1 | FILTER _.COL1 EQUALS promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +agg-empty-table-tests0EXPLAIN select sum(col1) from T1 where col1 = 0; +ťY ə(08@SCAN(<,>) | TFILTER T1 | FILTER _.COL1 EQUALS promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q39._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q30 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 EQUALS promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q42._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q32 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 EQUALS promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 7 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 8 [ label=<
    Primary Storage
    record types: [T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q39> label="q39" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q30> label="q30" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q42> label="q42" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q32> label="q32" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 6 [ label=< q25> label="q25" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} I -agg-empty-table-tests0EXPLAIN select sum(col1) from T1 where col2 = 0; -U (08@SCAN(<,>) | TFILTER T1 | FILTER _.COL2 EQUALS promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +agg-empty-table-tests0EXPLAIN select sum(col1) from T1 where col2 = 0; +ӋY Ӑ(08@SCAN(<,>) | TFILTER T1 | FILTER _.COL2 EQUALS promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q39._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q30 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q2.COL2 EQUALS promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q42._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q32 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Predicate Filter
    WHERE q2.COL2 EQUALS promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 7 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 8 [ label=<
    Primary Storage
    record types: [T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q39> label="q39" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q30> label="q30" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q42> label="q42" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q32> label="q32" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 6 [ label=< q25> label="q25" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} I -agg-empty-table-tests0EXPLAIN select sum(col1) from T1 where col1 > 0; -U (08@SCAN(<,>) | TFILTER T1 | FILTER _.COL1 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +agg-empty-table-tests0EXPLAIN select sum(col1) from T1 where col1 > 0; +ƻY v(08@SCAN(<,>) | TFILTER T1 | FILTER _.COL1 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q39._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q30 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 GREATER_THAN promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q42._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q32 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 GREATER_THAN promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 7 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 8 [ label=<
    Primary Storage
    record types: [T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q39> label="q39" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q30> label="q30" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q42> label="q42" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q32> label="q32" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 6 [ label=< q25> label="q25" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} I -agg-empty-table-tests0EXPLAIN select sum(col1) from T1 where col2 > 0; -U (08@SCAN(<,>) | TFILTER T1 | FILTER _.COL2 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +agg-empty-table-tests0EXPLAIN select sum(col1) from T1 where col2 > 0; +Y M(0 8@SCAN(<,>) | TFILTER T1 | FILTER _.COL2 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q39._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q30 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q2.COL2 GREATER_THAN promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q42._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q32 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Predicate Filter
    WHERE q2.COL2 GREATER_THAN promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 7 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 8 [ label=<
    Primary Storage
    record types: [T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q39> label="q39" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q30> label="q30" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q42> label="q42" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q32> label="q32" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 6 [ label=< q25> label="q25" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} : -agg-empty-table-tests!EXPLAIN select sum(col1) from T2; -  (30+8)@cAISCAN(T2_I5 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +agg-empty-table-tests!EXPLAIN select sum(col1) from T2; + ւ +(<0@87@cAISCAN(T2_I5 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; @@ -637,347 +632,342 @@ I 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Value Computation
    MAP (q4 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 5 [ label=<
    Index
    T2_I5
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 5 [ label=<
    Index
    T2_I5
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q4> label="q4" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} I -agg-empty-table-tests0EXPLAIN select sum(col1) from T2 where col1 = 0; -p 䨂(-08@SCAN(<,>) | TFILTER T2 | FILTER _.COL1 EQUALS promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +agg-empty-table-tests0EXPLAIN select sum(col1) from T2 where col1 = 0; +͍ x (008 @SCAN(<,>) | TFILTER T2 | FILTER _.COL1 EQUALS promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q93._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q84 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 EQUALS promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Type Filter
    WHERE record IS [T2]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q96._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q86 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 EQUALS promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Type Filter
    WHERE record IS [T2]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 7 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 8 [ label=<
    Primary Storage
    record types: [T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q93> label="q93" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q84> label="q84" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q96> label="q96" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q86> label="q86" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q78> label="q78" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 6 [ label=< q79> label="q79" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} I -agg-empty-table-tests0EXPLAIN select sum(col1) from T2 where col2 = 0; - Å(:0,8/@AISCAN(T2_I6 [EQUALS promote(@c11 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +agg-empty-table-tests0EXPLAIN select sum(col1) from T2 where col2 = 0; +Ρ (:0.8/@AISCAN(T2_I6 [EQUALS promote(@c11 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Value Computation
    MAP ((q4._1 AS _0) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 5 [ label=<
    Index
    T2_I6
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 5 [ label=<
    Index
    T2_I6
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q4> label="q4" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} I -agg-empty-table-tests0EXPLAIN select sum(col1) from T2 where col1 > 0; -p Ҧ(-08@SCAN(<,>) | TFILTER T2 | FILTER _.COL1 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +agg-empty-table-tests0EXPLAIN select sum(col1) from T2 where col1 > 0; +x ܻ(008 @SCAN(<,>) | TFILTER T2 | FILTER _.COL1 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q93._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q84 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 GREATER_THAN promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Type Filter
    WHERE record IS [T2]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q96._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q86 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 GREATER_THAN promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Type Filter
    WHERE record IS [T2]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 7 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 8 [ label=<
    Primary Storage
    record types: [T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q93> label="q93" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q84> label="q84" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q96> label="q96" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q86> label="q86" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q78> label="q78" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 6 [ label=< q79> label="q79" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} I -agg-empty-table-tests0EXPLAIN select sum(col1) from T2 where col2 > 0; -И p (-08@SCAN(<,>) | TFILTER T2 | FILTER _.COL2 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +agg-empty-table-tests0EXPLAIN select sum(col1) from T2 where col2 > 0; + (:0582@AISCAN(T2_I6 [[GREATER_THAN promote(@c11 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | AGG sum_l(_._1) GROUP BY () | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q93._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q84 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q2.COL2 GREATER_THAN promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Type Filter
    WHERE record IS [T2]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 7 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 8 [ label=<
    Primary Storage
    record types: [T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; + 3 [ label=<
    Value Computation
    MAP ((q4._1 AS _0) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Streaming Aggregate
    COLLECT sum_l(q102._1)
    GROUP BY ()
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; + 5 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 6 [ label=<
    Index
    T2_I6
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q93> label="q93" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q84> label="q84" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q78> label="q78" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q4> label="q4" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q102> label="q102" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} W -agg-empty-table-tests>EXPLAIN select sum(col1) from T2 where col2 = 0 group by col2; - -x ՙ(008@hAISCAN(T2_I6 [EQUALS promote(@c11 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) +agg-empty-table-tests>EXPLAIN select sum(col1) from T2 where col2 = 0 group by col2; +  ڮ(008@hAISCAN(T2_I6 [EQUALS promote(@c11 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    T2_I6
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    T2_I6
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} W -agg-empty-table-tests>EXPLAIN select sum(col1) from T2 where col2 > 0 group by col2; - x (008@pAISCAN(T2_I6 [[GREATER_THAN promote(@c11 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) +agg-empty-table-tests>EXPLAIN select sum(col1) from T2 where col2 > 0 group by col2; +  Σ(008@pAISCAN(T2_I6 [[GREATER_THAN promote(@c11 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    T2_I6
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    T2_I6
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} : -agg-empty-table-tests!EXPLAIN select sum(col1) from T3; -ֆ\ (%0.80@eISCAN(T3_I1 <,>) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +agg-empty-table-tests!EXPLAIN select sum(col1) from T3; +܀` (%0180@eISCAN(T3_I1 <,>) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q74._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q83._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q74> label="q74" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q83> label="q83" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} I -agg-empty-table-tests0EXPLAIN select sum(col1) from T3 where col1 = 0; -ԑ (-0P8F@ISCAN(T3_I1 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +agg-empty-table-tests0EXPLAIN select sum(col1) from T3 where col1 = 0; +  Ѣ(-0B8F@ISCAN(T3_I1 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q89._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q98._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q89> label="q89" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q98> label="q98" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} I -agg-empty-table-tests0EXPLAIN select sum(col1) from T3 where col2 = 0; -ܭ - ą(-068F@ISCAN(T3_I2 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +agg-empty-table-tests0EXPLAIN select sum(col1) from T3 where col2 = 0; +  ӡ(-0ǶC8F@ISCAN(T3_I2 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q89._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    T3_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q98._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    T3_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q89> label="q89" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q98> label="q98" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} I -agg-empty-table-tests0EXPLAIN select sum(col1) from T3 where col1 > 0; -  ̈́(.0@8H@ISCAN(T3_I1 [[GREATER_THAN promote(@c11 AS LONG)]]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +agg-empty-table-tests0EXPLAIN select sum(col1) from T3 where col1 > 0; + + (.0Ѩ=8H@ISCAN(T3_I1 [[GREATER_THAN promote(@c11 AS LONG)]]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q93._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q102._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q93> label="q93" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q102> label="q102" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} I -agg-empty-table-tests0EXPLAIN select sum(col1) from T3 where col2 > 0; -ǟ  (.0K8H@ISCAN(T3_I2 [[GREATER_THAN promote(@c11 AS LONG)]]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +agg-empty-table-tests0EXPLAIN select sum(col1) from T3 where col2 > 0; + (.0%8H@ISCAN(T3_I2 [[GREATER_THAN promote(@c11 AS LONG)]]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q91._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    T3_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q100._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    T3_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q91> label="q91" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q100> label="q100" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} W -agg-empty-table-tests>EXPLAIN select sum(col1) from T3 where col1 = 0 group by col2; -e (!08!@ISCAN(T3_I2 <,>) | FILTER _.COL1 EQUALS promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) GROUP BY (_._0.COL2 AS _0) | MAP (_._1._0 AS _0)digraph G { +agg-empty-table-tests>EXPLAIN select sum(col1) from T3 where col1 = 0 group by col2; +i (!08!@ISCAN(T3_I2 <,>) | FILTER _.COL1 EQUALS promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) GROUP BY (_._0.COL2 AS _0) | MAP (_._1._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q53._0.COL1) AS _0)
    GROUP BY (q53._0.COL2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, )" ]; - 3 [ label=<
    Value Computation
    MAP (q42 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 4 [ label=<
    Predicate Filter
    WHERE q2.COL1 EQUALS promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    T3_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q53> label="q53" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q42> label="q42" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q56._0.COL1) AS _0)
    GROUP BY (q56._0.COL2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, LONG AS _0 AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP (q44 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 4 [ label=<
    Predicate Filter
    WHERE q2.COL1 EQUALS promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    T3_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ label=< q56> label="q56" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q44> label="q44" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} W -agg-empty-table-tests>EXPLAIN select sum(col1) from T3 where col2 = 0 group by col2; -Þg ("08#@ISCAN(T3_I2 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) GROUP BY (_._0.COL2 AS _0) | MAP (_._1._0 AS _0)digraph G { +agg-empty-table-tests>EXPLAIN select sum(col1) from T3 where col2 = 0 group by col2; +հk ("0 8#@ISCAN(T3_I2 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) GROUP BY (_._0.COL2 AS _0) | MAP (_._1._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q55._0.COL1) AS _0)
    GROUP BY (q55._0.COL2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 4 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index
    T3_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q55> label="q55" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q58._0.COL1) AS _0)
    GROUP BY (q58._0.COL2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, LONG AS _0 AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 4 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 5 [ label=<
    Index
    T3_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ label=< q58> label="q58" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} W -agg-empty-table-tests>EXPLAIN select sum(col1) from T3 where col1 > 0 group by col2; -ξe (!08!@ISCAN(T3_I2 <,>) | FILTER _.COL1 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) GROUP BY (_._0.COL2 AS _0) | MAP (_._1._0 AS _0)digraph G { +agg-empty-table-tests>EXPLAIN select sum(col1) from T3 where col1 > 0 group by col2; +i (!08!@ISCAN(T3_I2 <,>) | FILTER _.COL1 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) GROUP BY (_._0.COL2 AS _0) | MAP (_._1._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q53._0.COL1) AS _0)
    GROUP BY (q53._0.COL2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, )" ]; - 3 [ label=<
    Value Computation
    MAP (q42 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 4 [ label=<
    Predicate Filter
    WHERE q2.COL1 GREATER_THAN promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    T3_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q53> label="q53" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q42> label="q42" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q56._0.COL1) AS _0)
    GROUP BY (q56._0.COL2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, LONG AS _0 AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP (q44 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 4 [ label=<
    Predicate Filter
    WHERE q2.COL1 GREATER_THAN promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    T3_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ label=< q56> label="q56" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q44> label="q44" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} W -agg-empty-table-tests>EXPLAIN select sum(col1) from T3 where col2 > 0 group by col2; -g ("08#@ISCAN(T3_I2 [[GREATER_THAN promote(@c11 AS LONG)]]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) GROUP BY (_._0.COL2 AS _0) | MAP (_._1._0 AS _0)digraph G { +agg-empty-table-tests>EXPLAIN select sum(col1) from T3 where col2 > 0 group by col2; +k ("08#@ISCAN(T3_I2 [[GREATER_THAN promote(@c11 AS LONG)]]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) GROUP BY (_._0.COL2 AS _0) | MAP (_._1._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q55._0.COL1) AS _0)
    GROUP BY (q55._0.COL2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 4 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index
    T3_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q55> label="q55" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q58._0.COL1) AS _0)
    GROUP BY (q58._0.COL2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, LONG AS _0 AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 4 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 5 [ label=<
    Index
    T3_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ label=< q58> label="q58" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} M -)agg-empty-table-tests-after-modifications EXPLAIN select count(*) from T1; -@ T(0ǘ 8@SCAN(<,>) | TFILTER T1 | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +)agg-empty-table-tests-after-modifications EXPLAIN select count(*) from T1; +D X(0 8@SCAN(<,>) | TFILTER T1 | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 6 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 7 [ label=<
    Primary Storage
    record types: [T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q34> label="q34" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q37> label="q37" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q25> label="q25" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} \ -)agg-empty-table-tests-after-modifications/EXPLAIN select count(*) from T1 where col1 = 0; -U Ű(0Ͻ8@SCAN(<,>) | TFILTER T1 | FILTER _.COL1 EQUALS promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +)agg-empty-table-tests-after-modifications/EXPLAIN select count(*) from T1 where col1 = 0; +ɘY (08@SCAN(<,>) | TFILTER T1 | FILTER _.COL1 EQUALS promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q30 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 EQUALS promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 4 [ label=<
    Value Computation
    MAP (q32 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 EQUALS promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 7 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 8 [ label=<
    Primary Storage
    record types: [T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q39> label="q39" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q30> label="q30" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q42> label="q42" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q32> label="q32" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 6 [ label=< q25> label="q25" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} \ -)agg-empty-table-tests-after-modifications/EXPLAIN select count(*) from T1 where col1 > 0; -U (08@SCAN(<,>) | TFILTER T1 | FILTER _.COL1 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +)agg-empty-table-tests-after-modifications/EXPLAIN select count(*) from T1 where col1 > 0; +Y (08@SCAN(<,>) | TFILTER T1 | FILTER _.COL1 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q30 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 GREATER_THAN promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 4 [ label=<
    Value Computation
    MAP (q32 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 GREATER_THAN promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 7 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 8 [ label=<
    Primary Storage
    record types: [T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q39> label="q39" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q30> label="q30" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q42> label="q42" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q32> label="q32" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 6 [ label=< q25> label="q25" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} M -)agg-empty-table-tests-after-modifications EXPLAIN select count(*) from T2; -  (30"8)@AISCAN(T2_I1 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +)agg-empty-table-tests-after-modifications EXPLAIN select count(*) from T2; + (<0>87@AISCAN(T2_I1 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; @@ -985,15 +975,15 @@ M 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Value Computation
    MAP (q4 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 5 [ label=<
    Index
    T2_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 5 [ label=<
    Index
    T2_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q4> label="q4" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} P -)agg-empty-table-tests-after-modifications#EXPLAIN select count(col2) from T2; - (30 8)@AISCAN(T2_I3 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +)agg-empty-table-tests-after-modifications#EXPLAIN select count(col2) from T2; + (<0387@AISCAN(T2_I3 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; @@ -1001,264 +991,262 @@ P 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Value Computation
    MAP (q4 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 5 [ label=<
    Index
    T2_I3
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 5 [ label=<
    Index
    T2_I3
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q4> label="q4" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} _ -)agg-empty-table-tests-after-modifications2EXPLAIN select count(col2) from T2 where col1 = 0; -ѵ ✜ -(:078/@AISCAN(T2_I4 [EQUALS promote(@c11 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +)agg-empty-table-tests-after-modifications2EXPLAIN select count(col2) from T2 where col1 = 0; + + (:0 8/@AISCAN(T2_I4 [EQUALS promote(@c11 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Value Computation
    MAP ((q4._1 AS _0) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 5 [ label=<
    Index
    T2_I4
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 5 [ label=<
    Index
    T2_I4
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q4> label="q4" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} _ -)agg-empty-table-tests-after-modifications2EXPLAIN select count(col2) from T2 where col1 > 0; -p (-08@SCAN(<,>) | TFILTER T2 | FILTER _.COL1 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +)agg-empty-table-tests-after-modifications2EXPLAIN select count(col2) from T2 where col1 > 0; + (:0582@AISCAN(T2_I4 [[GREATER_THAN promote(@c11 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | AGG sum_l(_._1) GROUP BY () | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q93._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q84 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 GREATER_THAN promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Type Filter
    WHERE record IS [T2]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 7 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 8 [ label=<
    Primary Storage
    record types: [T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; + 3 [ label=<
    Value Computation
    MAP ((q4._1 AS _0) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Streaming Aggregate
    COLLECT sum_l(q102._1)
    GROUP BY ()
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; + 5 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 6 [ label=<
    Index
    T2_I4
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q93> label="q93" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q84> label="q84" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q78> label="q78" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q4> label="q4" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q102> label="q102" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} P -)agg-empty-table-tests-after-modifications#EXPLAIN select count(col2) from T3; -\ (%0*80@ISCAN(T3_I1 <,>) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +)agg-empty-table-tests-after-modifications#EXPLAIN select count(col2) from T3; +` ު(%0ѯ-80@ISCAN(T3_I1 <,>) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q74._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q83._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q74> label="q74" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q83> label="q83" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} _ -)agg-empty-table-tests-after-modifications2EXPLAIN select count(col2) from T3 where col1 = 0; -  (-0G8F@ISCAN(T3_I1 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +)agg-empty-table-tests-after-modifications2EXPLAIN select count(col2) from T3 where col1 = 0; +  (-008F@ISCAN(T3_I1 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q89._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q98._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q89> label="q89" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q98> label="q98" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} _ -)agg-empty-table-tests-after-modifications2EXPLAIN select count(col2) from T3 where col1 > 0; -  (.0C8H@ISCAN(T3_I1 [[GREATER_THAN promote(@c11 AS LONG)]]) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +)agg-empty-table-tests-after-modifications2EXPLAIN select count(col2) from T3 where col1 > 0; +  (.0E8H@ISCAN(T3_I1 [[GREATER_THAN promote(@c11 AS LONG)]]) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q93._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q102._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q93> label="q93" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q102> label="q102" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} ^ -)agg-empty-table-tests-after-modifications1EXPLAIN select count(col2) from T3 group by col1; -L (08@pISCAN(T3_I1 <,>) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0)digraph G { +)agg-empty-table-tests-after-modifications1EXPLAIN select count(col2) from T3 group by col1; +ٷP ԍ(08@pISCAN(T3_I1 <,>) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Streaming Aggregate
    COLLECT (count(q47._0.COL2) AS _0)
    GROUP BY (q47._0.COL1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q47> label="q47" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT (count(q50._0.COL2) AS _0)
    GROUP BY (q50._0.COL1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, LONG AS _0 AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 5 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ label=< q50> label="q50" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} m -)agg-empty-table-tests-after-modifications@EXPLAIN select count(col2) from T3 where col1 = 0 group by col1; -g ("08#@ISCAN(T3_I1 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0)digraph G { +)agg-empty-table-tests-after-modifications@EXPLAIN select count(col2) from T3 where col1 = 0 group by col1; +k ("0 +8#@ISCAN(T3_I1 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Streaming Aggregate
    COLLECT (count(q55._0.COL2) AS _0)
    GROUP BY (q55._0.COL1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 4 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q55> label="q55" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT (count(q58._0.COL2) AS _0)
    GROUP BY (q58._0.COL1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, LONG AS _0 AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 4 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 5 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ label=< q58> label="q58" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} m -)agg-empty-table-tests-after-modifications@EXPLAIN select count(col2) from T3 where col1 > 0 group by col1; -ݿg ("0̃8#@ISCAN(T3_I1 [[GREATER_THAN promote(@c11 AS LONG)]]) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0)digraph G { +)agg-empty-table-tests-after-modifications@EXPLAIN select count(col2) from T3 where col1 > 0 group by col1; +k ("08#@ISCAN(T3_I1 [[GREATER_THAN promote(@c11 AS LONG)]]) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Streaming Aggregate
    COLLECT (count(q55._0.COL2) AS _0)
    GROUP BY (q55._0.COL1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 4 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q55> label="q55" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT (count(q58._0.COL2) AS _0)
    GROUP BY (q58._0.COL1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, LONG AS _0 AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 4 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 5 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ label=< q58> label="q58" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} N -)agg-empty-table-tests-after-modifications!EXPLAIN select sum(col1) from T1; -@ F(0Ɍ 8@kSCAN(<,>) | TFILTER T1 | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +)agg-empty-table-tests-after-modifications!EXPLAIN select sum(col1) from T1; +ЕD g(08@kSCAN(<,>) | TFILTER T1 | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q34._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q37._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 6 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 7 [ label=<
    Primary Storage
    record types: [T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q34> label="q34" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q37> label="q37" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q25> label="q25" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} ] -)agg-empty-table-tests-after-modifications0EXPLAIN select sum(col1) from T1 where col1 = 0; -U (08@SCAN(<,>) | TFILTER T1 | FILTER _.COL1 EQUALS promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +)agg-empty-table-tests-after-modifications0EXPLAIN select sum(col1) from T1 where col1 = 0; +ťY ə(08@SCAN(<,>) | TFILTER T1 | FILTER _.COL1 EQUALS promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q39._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q30 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 EQUALS promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q42._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q32 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 EQUALS promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 7 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 8 [ label=<
    Primary Storage
    record types: [T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q39> label="q39" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q30> label="q30" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q42> label="q42" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q32> label="q32" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 6 [ label=< q25> label="q25" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} ] -)agg-empty-table-tests-after-modifications0EXPLAIN select sum(col1) from T1 where col2 = 0; -U (08@SCAN(<,>) | TFILTER T1 | FILTER _.COL2 EQUALS promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +)agg-empty-table-tests-after-modifications0EXPLAIN select sum(col1) from T1 where col2 = 0; +ӋY Ӑ(08@SCAN(<,>) | TFILTER T1 | FILTER _.COL2 EQUALS promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q39._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q30 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q2.COL2 EQUALS promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q42._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q32 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Predicate Filter
    WHERE q2.COL2 EQUALS promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 7 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 8 [ label=<
    Primary Storage
    record types: [T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q39> label="q39" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q30> label="q30" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q42> label="q42" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q32> label="q32" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 6 [ label=< q25> label="q25" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} ] -)agg-empty-table-tests-after-modifications0EXPLAIN select sum(col1) from T1 where col1 > 0; -U (08@SCAN(<,>) | TFILTER T1 | FILTER _.COL1 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +)agg-empty-table-tests-after-modifications0EXPLAIN select sum(col1) from T1 where col1 > 0; +ƻY v(08@SCAN(<,>) | TFILTER T1 | FILTER _.COL1 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q39._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q30 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 GREATER_THAN promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q42._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q32 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 GREATER_THAN promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 7 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 8 [ label=<
    Primary Storage
    record types: [T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q39> label="q39" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q30> label="q30" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q42> label="q42" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q32> label="q32" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 6 [ label=< q25> label="q25" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} ] -)agg-empty-table-tests-after-modifications0EXPLAIN select sum(col1) from T1 where col2 > 0; -U (08@SCAN(<,>) | TFILTER T1 | FILTER _.COL2 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +)agg-empty-table-tests-after-modifications0EXPLAIN select sum(col1) from T1 where col2 > 0; +Y M(0 8@SCAN(<,>) | TFILTER T1 | FILTER _.COL2 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q39._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q30 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q2.COL2 GREATER_THAN promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q42._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q32 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Predicate Filter
    WHERE q2.COL2 GREATER_THAN promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 7 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 8 [ label=<
    Primary Storage
    record types: [T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q39> label="q39" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q30> label="q30" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q42> label="q42" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q32> label="q32" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 6 [ label=< q25> label="q25" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} N -)agg-empty-table-tests-after-modifications!EXPLAIN select sum(col1) from T2; -  (30+8)@cAISCAN(T2_I5 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +)agg-empty-table-tests-after-modifications!EXPLAIN select sum(col1) from T2; + ւ +(<0@87@cAISCAN(T2_I5 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; @@ -1266,141 +1254,137 @@ N 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Value Computation
    MAP (q4 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 5 [ label=<
    Index
    T2_I5
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 5 [ label=<
    Index
    T2_I5
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q4> label="q4" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} ] -)agg-empty-table-tests-after-modifications0EXPLAIN select sum(col1) from T2 where col2 = 0; - Å(:0,8/@AISCAN(T2_I6 [EQUALS promote(@c11 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +)agg-empty-table-tests-after-modifications0EXPLAIN select sum(col1) from T2 where col2 = 0; +Ρ (:0.8/@AISCAN(T2_I6 [EQUALS promote(@c11 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Value Computation
    MAP ((q4._1 AS _0) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 5 [ label=<
    Index
    T2_I6
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 5 [ label=<
    Index
    T2_I6
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q4> label="q4" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} ] -)agg-empty-table-tests-after-modifications0EXPLAIN select sum(col1) from T2 where col1 > 0; -p Ҧ(-08@SCAN(<,>) | TFILTER T2 | FILTER _.COL1 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +)agg-empty-table-tests-after-modifications0EXPLAIN select sum(col1) from T2 where col1 > 0; +x ܻ(008 @SCAN(<,>) | TFILTER T2 | FILTER _.COL1 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q93._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q84 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 GREATER_THAN promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Type Filter
    WHERE record IS [T2]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q96._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q86 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Predicate Filter
    WHERE q2.COL1 GREATER_THAN promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Type Filter
    WHERE record IS [T2]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 7 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 8 [ label=<
    Primary Storage
    record types: [T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q93> label="q93" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q84> label="q84" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q96> label="q96" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q86> label="q86" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q78> label="q78" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 6 [ label=< q79> label="q79" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} ] -)agg-empty-table-tests-after-modifications0EXPLAIN select sum(col1) from T2 where col2 > 0; -И p (-08@SCAN(<,>) | TFILTER T2 | FILTER _.COL2 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +)agg-empty-table-tests-after-modifications0EXPLAIN select sum(col1) from T2 where col2 > 0; + (:0582@AISCAN(T2_I6 [[GREATER_THAN promote(@c11 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | AGG sum_l(_._1) GROUP BY () | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q93._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q84 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q2.COL2 GREATER_THAN promote(@c11 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Type Filter
    WHERE record IS [T2]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 7 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 8 [ label=<
    Primary Storage
    record types: [T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; + 3 [ label=<
    Value Computation
    MAP ((q4._1 AS _0) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Streaming Aggregate
    COLLECT sum_l(q102._1)
    GROUP BY ()
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; + 5 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 6 [ label=<
    Index
    T2_I6
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q93> label="q93" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q84> label="q84" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q78> label="q78" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q4> label="q4" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q102> label="q102" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} ] -)agg-empty-table-tests-after-modifications0EXPLAIN select sum(col1) from T3 where col1 = 0; -ԑ (-0P8F@ISCAN(T3_I1 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +)agg-empty-table-tests-after-modifications0EXPLAIN select sum(col1) from T3 where col1 = 0; +  Ѣ(-0B8F@ISCAN(T3_I1 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q89._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q98._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q89> label="q89" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q98> label="q98" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} ] -)agg-empty-table-tests-after-modifications0EXPLAIN select sum(col1) from T3 where col2 = 0; -ܭ - ą(-068F@ISCAN(T3_I2 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +)agg-empty-table-tests-after-modifications0EXPLAIN select sum(col1) from T3 where col2 = 0; +  ӡ(-0ǶC8F@ISCAN(T3_I2 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q89._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    T3_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q98._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    T3_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q89> label="q89" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q98> label="q98" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} ] -)agg-empty-table-tests-after-modifications0EXPLAIN select sum(col1) from T3 where col1 > 0; -  ̈́(.0@8H@ISCAN(T3_I1 [[GREATER_THAN promote(@c11 AS LONG)]]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +)agg-empty-table-tests-after-modifications0EXPLAIN select sum(col1) from T3 where col1 > 0; + + (.0Ѩ=8H@ISCAN(T3_I1 [[GREATER_THAN promote(@c11 AS LONG)]]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q93._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q102._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q93> label="q93" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q102> label="q102" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} ] -)agg-empty-table-tests-after-modifications0EXPLAIN select sum(col1) from T3 where col2 > 0; -ǟ  (.0K8H@ISCAN(T3_I2 [[GREATER_THAN promote(@c11 AS LONG)]]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +)agg-empty-table-tests-after-modifications0EXPLAIN select sum(col1) from T3 where col2 > 0; + (.0%8H@ISCAN(T3_I2 [[GREATER_THAN promote(@c11 AS LONG)]]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q91._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    T3_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q100._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN promote(@c11 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    T3_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q91> label="q91" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q100> label="q100" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; diff --git a/yaml-tests/src/test/resources/aggregate-empty-table.metrics.yaml b/yaml-tests/src/test/resources/aggregate-empty-table.metrics.yaml index 23edb02ba3..0f895ba37a 100644 --- a/yaml-tests/src/test/resources/aggregate-empty-table.metrics.yaml +++ b/yaml-tests/src/test/resources/aggregate-empty-table.metrics.yaml @@ -4,7 +4,7 @@ agg-empty-table-tests: ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 260 task_total_time_ms: 5 - transform_count: 64 + transform_count: 68 transform_time_ms: 1 transform_yield_count: 17 insert_time_ms: 0 @@ -15,8 +15,8 @@ agg-empty-table-tests: MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 331 - task_total_time_ms: 8 - transform_count: 85 + task_total_time_ms: 9 + transform_count: 89 transform_time_ms: 2 transform_yield_count: 19 insert_time_ms: 0 @@ -28,7 +28,7 @@ agg-empty-table-tests: promote(0l AS LONG)) AS _0) task_count: 331 task_total_time_ms: 9 - transform_count: 85 + transform_count: 89 transform_time_ms: 2 transform_yield_count: 19 insert_time_ms: 0 @@ -37,45 +37,46 @@ agg-empty-table-tests: - query: EXPLAIN select count(*) from T2; explain: 'AISCAN(T2_I1 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)' - task_count: 481 - task_total_time_ms: 20 - transform_count: 147 - transform_time_ms: 8 - transform_yield_count: 51 - insert_time_ms: 0 - insert_new_count: 41 - insert_reused_count: 5 + task_count: 608 + task_total_time_ms: 35 + transform_count: 188 + transform_time_ms: 20 + transform_yield_count: 60 + insert_time_ms: 1 + insert_new_count: 55 + insert_reused_count: 7 - query: EXPLAIN select count(*) from T2 where col1 = 0; explain: 'AISCAN(T2_I2 [EQUALS promote(@c11 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)' task_count: 562 - task_total_time_ms: 30 - transform_count: 171 - transform_time_ms: 19 + task_total_time_ms: 26 + transform_count: 178 + transform_time_ms: 16 transform_yield_count: 58 insert_time_ms: 0 insert_new_count: 47 insert_reused_count: 5 - query: EXPLAIN select count(*) from T2 where col1 > 0; - explain: SCAN(<,>) | TFILTER T2 | FILTER _.COL1 GREATER_THAN promote(@c11 AS LONG) - | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, - promote(0l AS LONG)) AS _0) - task_count: 383 - task_total_time_ms: 14 - transform_count: 112 - transform_time_ms: 10 - transform_yield_count: 45 + explain: 'AISCAN(T2_I2 [[GREATER_THAN promote(@c11 AS LONG)]] BY_GROUP -> [_0: + KEY:[0], _1: VALUE:[0]]) | AGG sum_l(_._1) GROUP BY () | MAP ((_._1 AS _0) + AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) + AS _0)' + task_count: 584 + task_total_time_ms: 35 + transform_count: 180 + transform_time_ms: 21 + transform_yield_count: 58 insert_time_ms: 0 - insert_new_count: 30 - insert_reused_count: 2 + insert_new_count: 50 + insert_reused_count: 5 - query: EXPLAIN select count(*) from T2 group by col1; explain: 'AISCAN(T2_I2 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0)' task_count: 364 - task_total_time_ms: 21 - transform_count: 118 - transform_time_ms: 12 + task_total_time_ms: 23 + transform_count: 125 + transform_time_ms: 14 transform_yield_count: 48 insert_time_ms: 0 insert_new_count: 24 @@ -84,9 +85,9 @@ agg-empty-table-tests: explain: 'AISCAN(T2_I2 [EQUALS promote(@c11 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0)' task_count: 364 - task_total_time_ms: 28 - transform_count: 120 - transform_time_ms: 17 + task_total_time_ms: 20 + transform_count: 127 + transform_time_ms: 12 transform_yield_count: 48 insert_time_ms: 0 insert_new_count: 24 @@ -95,9 +96,9 @@ agg-empty-table-tests: explain: 'AISCAN(T2_I2 [[GREATER_THAN promote(@c11 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0)' task_count: 364 - task_total_time_ms: 23 - transform_count: 120 - transform_time_ms: 13 + task_total_time_ms: 19 + transform_count: 127 + transform_time_ms: 11 transform_yield_count: 48 insert_time_ms: 0 insert_new_count: 24 @@ -106,9 +107,9 @@ agg-empty-table-tests: explain: ISCAN(T3_I2 <,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 404 - task_total_time_ms: 18 - transform_count: 92 - transform_time_ms: 6 + task_total_time_ms: 12 + transform_count: 96 + transform_time_ms: 4 transform_yield_count: 37 insert_time_ms: 0 insert_new_count: 48 @@ -118,11 +119,11 @@ agg-empty-table-tests: AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 635 - task_total_time_ms: 27 - transform_count: 160 - transform_time_ms: 8 + task_total_time_ms: 13 + transform_count: 164 + transform_time_ms: 4 transform_yield_count: 45 - insert_time_ms: 1 + insert_time_ms: 0 insert_new_count: 70 insert_reused_count: 5 - query: EXPLAIN select count(*) from T3 where col1 > 0; @@ -130,19 +131,19 @@ agg-empty-table-tests: AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 650 - task_total_time_ms: 26 - transform_count: 161 - transform_time_ms: 8 + task_total_time_ms: 20 + transform_count: 165 + transform_time_ms: 5 transform_yield_count: 46 - insert_time_ms: 1 + insert_time_ms: 0 insert_new_count: 72 insert_reused_count: 5 - query: EXPLAIN select count(*) from T3 group by col1; explain: ISCAN(T3_I1 <,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0) task_count: 285 - task_total_time_ms: 10 - transform_count: 76 + task_total_time_ms: 11 + transform_count: 80 transform_time_ms: 4 transform_yield_count: 30 insert_time_ms: 0 @@ -152,9 +153,9 @@ agg-empty-table-tests: explain: ISCAN(T3_I1 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (count_star(*) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0) task_count: 382 - task_total_time_ms: 18 - transform_count: 103 - transform_time_ms: 6 + task_total_time_ms: 16 + transform_count: 107 + transform_time_ms: 5 transform_yield_count: 34 insert_time_ms: 0 insert_new_count: 35 @@ -163,9 +164,9 @@ agg-empty-table-tests: explain: ISCAN(T3_I1 [[GREATER_THAN promote(@c11 AS LONG)]]) | MAP (_ AS _0) | AGG (count_star(*) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0) task_count: 382 - task_total_time_ms: 16 - transform_count: 103 - transform_time_ms: 5 + task_total_time_ms: 17 + transform_count: 107 + transform_time_ms: 6 transform_yield_count: 34 insert_time_ms: 0 insert_new_count: 35 @@ -174,9 +175,9 @@ agg-empty-table-tests: explain: SCAN(<,>) | TFILTER T1 | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 260 - task_total_time_ms: 9 - transform_count: 64 - transform_time_ms: 4 + task_total_time_ms: 6 + transform_count: 68 + transform_time_ms: 1 transform_yield_count: 17 insert_time_ms: 0 insert_new_count: 24 @@ -186,8 +187,8 @@ agg-empty-table-tests: MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 331 - task_total_time_ms: 10 - transform_count: 85 + task_total_time_ms: 9 + transform_count: 89 transform_time_ms: 2 transform_yield_count: 19 insert_time_ms: 0 @@ -198,8 +199,8 @@ agg-empty-table-tests: | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 331 - task_total_time_ms: 11 - transform_count: 85 + task_total_time_ms: 9 + transform_count: 89 transform_time_ms: 2 transform_yield_count: 19 insert_time_ms: 0 @@ -208,45 +209,46 @@ agg-empty-table-tests: - query: EXPLAIN select count(col2) from T2; explain: 'AISCAN(T2_I3 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)' - task_count: 481 - task_total_time_ms: 15 - transform_count: 147 - transform_time_ms: 8 - transform_yield_count: 51 - insert_time_ms: 0 - insert_new_count: 41 - insert_reused_count: 5 + task_count: 608 + task_total_time_ms: 31 + transform_count: 188 + transform_time_ms: 18 + transform_yield_count: 60 + insert_time_ms: 0 + insert_new_count: 55 + insert_reused_count: 7 - query: EXPLAIN select count(col2) from T2 where col1 = 0; explain: 'AISCAN(T2_I4 [EQUALS promote(@c11 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)' task_count: 562 - task_total_time_ms: 38 - transform_count: 171 - transform_time_ms: 21 + task_total_time_ms: 22 + transform_count: 178 + transform_time_ms: 12 transform_yield_count: 58 insert_time_ms: 0 insert_new_count: 47 insert_reused_count: 5 - query: EXPLAIN select count(col2) from T2 where col1 > 0; - explain: SCAN(<,>) | TFILTER T2 | FILTER _.COL1 GREATER_THAN promote(@c11 AS LONG) - | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, - promote(0l AS LONG)) AS _0) - task_count: 383 - task_total_time_ms: 16 - transform_count: 112 - transform_time_ms: 10 - transform_yield_count: 45 + explain: 'AISCAN(T2_I4 [[GREATER_THAN promote(@c11 AS LONG)]] BY_GROUP -> [_0: + KEY:[0], _1: VALUE:[0]]) | AGG sum_l(_._1) GROUP BY () | MAP ((_._1 AS _0) + AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) + AS _0)' + task_count: 584 + task_total_time_ms: 38 + transform_count: 180 + transform_time_ms: 24 + transform_yield_count: 58 insert_time_ms: 0 - insert_new_count: 30 - insert_reused_count: 2 + insert_new_count: 50 + insert_reused_count: 5 - query: EXPLAIN select count(col2) from T2 group by col1; explain: 'AISCAN(T2_I4 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0)' task_count: 364 - task_total_time_ms: 14 - transform_count: 118 - transform_time_ms: 8 + task_total_time_ms: 21 + transform_count: 125 + transform_time_ms: 13 transform_yield_count: 48 insert_time_ms: 0 insert_new_count: 24 @@ -255,9 +257,9 @@ agg-empty-table-tests: explain: 'AISCAN(T2_I4 [EQUALS promote(@c11 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0)' task_count: 364 - task_total_time_ms: 14 - transform_count: 120 - transform_time_ms: 8 + task_total_time_ms: 24 + transform_count: 127 + transform_time_ms: 13 transform_yield_count: 48 insert_time_ms: 0 insert_new_count: 24 @@ -266,9 +268,9 @@ agg-empty-table-tests: explain: 'AISCAN(T2_I4 [[GREATER_THAN promote(@c11 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0)' task_count: 364 - task_total_time_ms: 23 - transform_count: 120 - transform_time_ms: 13 + task_total_time_ms: 25 + transform_count: 127 + transform_time_ms: 16 transform_yield_count: 48 insert_time_ms: 0 insert_new_count: 24 @@ -277,9 +279,9 @@ agg-empty-table-tests: explain: ISCAN(T3_I1 <,>) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 404 - task_total_time_ms: 14 - transform_count: 92 - transform_time_ms: 5 + task_total_time_ms: 15 + transform_count: 96 + transform_time_ms: 6 transform_yield_count: 37 insert_time_ms: 0 insert_new_count: 48 @@ -289,11 +291,11 @@ agg-empty-table-tests: AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 635 - task_total_time_ms: 26 - transform_count: 160 - transform_time_ms: 8 + task_total_time_ms: 20 + transform_count: 164 + transform_time_ms: 6 transform_yield_count: 45 - insert_time_ms: 1 + insert_time_ms: 0 insert_new_count: 70 insert_reused_count: 5 - query: EXPLAIN select count(col2) from T3 where col1 > 0; @@ -301,9 +303,9 @@ agg-empty-table-tests: AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 650 - task_total_time_ms: 24 - transform_count: 161 - transform_time_ms: 7 + task_total_time_ms: 25 + transform_count: 165 + transform_time_ms: 10 transform_yield_count: 46 insert_time_ms: 1 insert_new_count: 72 @@ -312,8 +314,8 @@ agg-empty-table-tests: explain: ISCAN(T3_I1 <,>) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0) task_count: 285 - task_total_time_ms: 12 - transform_count: 76 + task_total_time_ms: 11 + transform_count: 80 transform_time_ms: 4 transform_yield_count: 30 insert_time_ms: 0 @@ -323,9 +325,9 @@ agg-empty-table-tests: explain: ISCAN(T3_I1 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0) task_count: 382 - task_total_time_ms: 15 - transform_count: 103 - transform_time_ms: 5 + task_total_time_ms: 10 + transform_count: 107 + transform_time_ms: 3 transform_yield_count: 34 insert_time_ms: 0 insert_new_count: 35 @@ -335,19 +337,19 @@ agg-empty-table-tests: AGG (count(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0) task_count: 382 - task_total_time_ms: 17 - transform_count: 103 - transform_time_ms: 5 + task_total_time_ms: 11 + transform_count: 107 + transform_time_ms: 4 transform_yield_count: 34 - insert_time_ms: 2 + insert_time_ms: 0 insert_new_count: 35 insert_reused_count: 1 - query: EXPLAIN select sum(col1) from T1; explain: SCAN(<,>) | TFILTER T1 | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0) task_count: 260 - task_total_time_ms: 4 - transform_count: 64 + task_total_time_ms: 7 + transform_count: 68 transform_time_ms: 1 transform_yield_count: 17 insert_time_ms: 0 @@ -358,8 +360,8 @@ agg-empty-table-tests: MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0) task_count: 331 - task_total_time_ms: 10 - transform_count: 85 + task_total_time_ms: 9 + transform_count: 89 transform_time_ms: 2 transform_yield_count: 19 insert_time_ms: 0 @@ -370,8 +372,8 @@ agg-empty-table-tests: MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0) task_count: 331 - task_total_time_ms: 12 - transform_count: 85 + task_total_time_ms: 8 + transform_count: 89 transform_time_ms: 2 transform_yield_count: 19 insert_time_ms: 0 @@ -382,9 +384,9 @@ agg-empty-table-tests: | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0) task_count: 331 - task_total_time_ms: 11 - transform_count: 85 - transform_time_ms: 3 + task_total_time_ms: 7 + transform_count: 89 + transform_time_ms: 1 transform_yield_count: 19 insert_time_ms: 0 insert_new_count: 30 @@ -394,9 +396,9 @@ agg-empty-table-tests: | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0) task_count: 331 - task_total_time_ms: 10 - transform_count: 85 - transform_time_ms: 2 + task_total_time_ms: 3 + transform_count: 89 + transform_time_ms: 1 transform_yield_count: 19 insert_time_ms: 0 insert_new_count: 30 @@ -404,34 +406,34 @@ agg-empty-table-tests: - query: EXPLAIN select sum(col1) from T2; explain: 'AISCAN(T2_I5 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)' - task_count: 481 - task_total_time_ms: 24 - transform_count: 147 - transform_time_ms: 11 - transform_yield_count: 51 - insert_time_ms: 0 - insert_new_count: 41 - insert_reused_count: 5 + task_count: 608 + task_total_time_ms: 35 + transform_count: 188 + transform_time_ms: 21 + transform_yield_count: 60 + insert_time_ms: 1 + insert_new_count: 55 + insert_reused_count: 7 - query: EXPLAIN select sum(col1) from T2 where col1 = 0; explain: SCAN(<,>) | TFILTER T2 | FILTER _.COL1 EQUALS promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0) - task_count: 383 - task_total_time_ms: 16 - transform_count: 112 - transform_time_ms: 10 - transform_yield_count: 45 + task_count: 389 + task_total_time_ms: 29 + transform_count: 120 + transform_time_ms: 20 + transform_yield_count: 48 insert_time_ms: 0 - insert_new_count: 30 + insert_new_count: 32 insert_reused_count: 2 - query: EXPLAIN select sum(col1) from T2 where col2 = 0; explain: 'AISCAN(T2_I6 [EQUALS promote(@c11 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)' task_count: 562 - task_total_time_ms: 29 - transform_count: 171 - transform_time_ms: 17 + task_total_time_ms: 40 + transform_count: 178 + transform_time_ms: 25 transform_yield_count: 58 insert_time_ms: 0 insert_new_count: 47 @@ -440,32 +442,32 @@ agg-empty-table-tests: explain: SCAN(<,>) | TFILTER T2 | FILTER _.COL1 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0) - task_count: 383 - task_total_time_ms: 15 - transform_count: 112 - transform_time_ms: 9 - transform_yield_count: 45 + task_count: 389 + task_total_time_ms: 17 + transform_count: 120 + transform_time_ms: 11 + transform_yield_count: 48 insert_time_ms: 0 - insert_new_count: 30 + insert_new_count: 32 insert_reused_count: 2 - query: EXPLAIN select sum(col1) from T2 where col2 > 0; - explain: SCAN(<,>) | TFILTER T2 | FILTER _.COL2 GREATER_THAN promote(@c11 AS LONG) - | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 - AS _0) - task_count: 383 - task_total_time_ms: 20 - transform_count: 112 - transform_time_ms: 13 - transform_yield_count: 45 + explain: 'AISCAN(T2_I6 [[GREATER_THAN promote(@c11 AS LONG)]] BY_GROUP -> [_0: + KEY:[0], _1: VALUE:[0]]) | AGG sum_l(_._1) GROUP BY () | MAP ((_._1 AS _0) + AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)' + task_count: 584 + task_total_time_ms: 39 + transform_count: 180 + transform_time_ms: 24 + transform_yield_count: 58 insert_time_ms: 0 - insert_new_count: 30 - insert_reused_count: 2 + insert_new_count: 50 + insert_reused_count: 5 - query: EXPLAIN select sum(col1) from T2 where col2 = 0 group by col2; explain: 'AISCAN(T2_I6 [EQUALS promote(@c11 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0)' task_count: 364 - task_total_time_ms: 22 - transform_count: 120 + task_total_time_ms: 24 + transform_count: 127 transform_time_ms: 13 transform_yield_count: 48 insert_time_ms: 0 @@ -475,9 +477,9 @@ agg-empty-table-tests: explain: 'AISCAN(T2_I6 [[GREATER_THAN promote(@c11 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0)' task_count: 364 - task_total_time_ms: 19 - transform_count: 120 - transform_time_ms: 11 + task_total_time_ms: 26 + transform_count: 127 + transform_time_ms: 17 transform_yield_count: 48 insert_time_ms: 0 insert_new_count: 24 @@ -486,9 +488,9 @@ agg-empty-table-tests: explain: ISCAN(T3_I1 <,>) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0) task_count: 404 - task_total_time_ms: 14 - transform_count: 92 - transform_time_ms: 5 + task_total_time_ms: 16 + transform_count: 96 + transform_time_ms: 6 transform_yield_count: 37 insert_time_ms: 0 insert_new_count: 48 @@ -497,8 +499,8 @@ agg-empty-table-tests: explain: ISCAN(T3_I1 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0) task_count: 635 - task_total_time_ms: 29 - transform_count: 160 + task_total_time_ms: 27 + transform_count: 164 transform_time_ms: 10 transform_yield_count: 45 insert_time_ms: 1 @@ -508,19 +510,19 @@ agg-empty-table-tests: explain: ISCAN(T3_I2 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0) task_count: 635 - task_total_time_ms: 21 - transform_count: 160 - transform_time_ms: 7 + task_total_time_ms: 25 + transform_count: 164 + transform_time_ms: 8 transform_yield_count: 45 - insert_time_ms: 0 + insert_time_ms: 1 insert_new_count: 70 insert_reused_count: 5 - query: EXPLAIN select sum(col1) from T3 where col1 > 0; explain: ISCAN(T3_I1 [[GREATER_THAN promote(@c11 AS LONG)]]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0) task_count: 650 - task_total_time_ms: 27 - transform_count: 161 + task_total_time_ms: 22 + transform_count: 165 transform_time_ms: 7 transform_yield_count: 46 insert_time_ms: 1 @@ -530,11 +532,11 @@ agg-empty-table-tests: explain: ISCAN(T3_I2 [[GREATER_THAN promote(@c11 AS LONG)]]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0) task_count: 650 - task_total_time_ms: 24 - transform_count: 161 - transform_time_ms: 7 + task_total_time_ms: 12 + transform_count: 165 + transform_time_ms: 4 transform_yield_count: 46 - insert_time_ms: 1 + insert_time_ms: 0 insert_new_count: 72 insert_reused_count: 5 - query: EXPLAIN select sum(col1) from T3 where col1 = 0 group by col2; @@ -542,9 +544,9 @@ agg-empty-table-tests: AS _0) | AGG (sum_l(_._0.COL1) AS _0) GROUP BY (_._0.COL2 AS _0) | MAP (_._1._0 AS _0) task_count: 363 - task_total_time_ms: 18 - transform_count: 101 - transform_time_ms: 6 + task_total_time_ms: 14 + transform_count: 105 + transform_time_ms: 5 transform_yield_count: 33 insert_time_ms: 0 insert_new_count: 33 @@ -553,9 +555,9 @@ agg-empty-table-tests: explain: ISCAN(T3_I2 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) GROUP BY (_._0.COL2 AS _0) | MAP (_._1._0 AS _0) task_count: 382 - task_total_time_ms: 18 - transform_count: 103 - transform_time_ms: 6 + task_total_time_ms: 7 + transform_count: 107 + transform_time_ms: 2 transform_yield_count: 34 insert_time_ms: 0 insert_new_count: 35 @@ -565,8 +567,8 @@ agg-empty-table-tests: MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) GROUP BY (_._0.COL2 AS _0) | MAP (_._1._0 AS _0) task_count: 363 - task_total_time_ms: 15 - transform_count: 101 + task_total_time_ms: 14 + transform_count: 105 transform_time_ms: 5 transform_yield_count: 33 insert_time_ms: 0 @@ -578,8 +580,8 @@ agg-empty-table-tests: _0) task_count: 382 task_total_time_ms: 16 - transform_count: 103 - transform_time_ms: 5 + transform_count: 107 + transform_time_ms: 6 transform_yield_count: 34 insert_time_ms: 0 insert_new_count: 35 @@ -590,7 +592,7 @@ agg-empty-table-tests-after-modifications: ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 260 task_total_time_ms: 5 - transform_count: 64 + transform_count: 68 transform_time_ms: 1 transform_yield_count: 17 insert_time_ms: 0 @@ -601,8 +603,8 @@ agg-empty-table-tests-after-modifications: MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 331 - task_total_time_ms: 8 - transform_count: 85 + task_total_time_ms: 9 + transform_count: 89 transform_time_ms: 2 transform_yield_count: 19 insert_time_ms: 0 @@ -614,7 +616,7 @@ agg-empty-table-tests-after-modifications: promote(0l AS LONG)) AS _0) task_count: 331 task_total_time_ms: 9 - transform_count: 85 + transform_count: 89 transform_time_ms: 2 transform_yield_count: 19 insert_time_ms: 0 @@ -623,56 +625,57 @@ agg-empty-table-tests-after-modifications: - query: EXPLAIN select count(*) from T2; explain: 'AISCAN(T2_I1 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)' - task_count: 481 - task_total_time_ms: 20 - transform_count: 147 - transform_time_ms: 8 - transform_yield_count: 51 - insert_time_ms: 0 - insert_new_count: 41 - insert_reused_count: 5 + task_count: 608 + task_total_time_ms: 35 + transform_count: 188 + transform_time_ms: 20 + transform_yield_count: 60 + insert_time_ms: 1 + insert_new_count: 55 + insert_reused_count: 7 - query: EXPLAIN select count(col2) from T2; explain: 'AISCAN(T2_I3 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)' - task_count: 481 - task_total_time_ms: 15 - transform_count: 147 - transform_time_ms: 8 - transform_yield_count: 51 - insert_time_ms: 0 - insert_new_count: 41 - insert_reused_count: 5 + task_count: 608 + task_total_time_ms: 31 + transform_count: 188 + transform_time_ms: 18 + transform_yield_count: 60 + insert_time_ms: 0 + insert_new_count: 55 + insert_reused_count: 7 - query: EXPLAIN select count(col2) from T2 where col1 = 0; explain: 'AISCAN(T2_I4 [EQUALS promote(@c11 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)' task_count: 562 - task_total_time_ms: 38 - transform_count: 171 - transform_time_ms: 21 + task_total_time_ms: 22 + transform_count: 178 + transform_time_ms: 12 transform_yield_count: 58 insert_time_ms: 0 insert_new_count: 47 insert_reused_count: 5 - query: EXPLAIN select count(col2) from T2 where col1 > 0; - explain: SCAN(<,>) | TFILTER T2 | FILTER _.COL1 GREATER_THAN promote(@c11 AS LONG) - | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, - promote(0l AS LONG)) AS _0) - task_count: 383 - task_total_time_ms: 16 - transform_count: 112 - transform_time_ms: 10 - transform_yield_count: 45 + explain: 'AISCAN(T2_I4 [[GREATER_THAN promote(@c11 AS LONG)]] BY_GROUP -> [_0: + KEY:[0], _1: VALUE:[0]]) | AGG sum_l(_._1) GROUP BY () | MAP ((_._1 AS _0) + AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) + AS _0)' + task_count: 584 + task_total_time_ms: 38 + transform_count: 180 + transform_time_ms: 24 + transform_yield_count: 58 insert_time_ms: 0 - insert_new_count: 30 - insert_reused_count: 2 + insert_new_count: 50 + insert_reused_count: 5 - query: EXPLAIN select count(col2) from T3; explain: ISCAN(T3_I1 <,>) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 404 - task_total_time_ms: 14 - transform_count: 92 - transform_time_ms: 5 + task_total_time_ms: 15 + transform_count: 96 + transform_time_ms: 6 transform_yield_count: 37 insert_time_ms: 0 insert_new_count: 48 @@ -682,11 +685,11 @@ agg-empty-table-tests-after-modifications: AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 635 - task_total_time_ms: 26 - transform_count: 160 - transform_time_ms: 8 + task_total_time_ms: 20 + transform_count: 164 + transform_time_ms: 6 transform_yield_count: 45 - insert_time_ms: 1 + insert_time_ms: 0 insert_new_count: 70 insert_reused_count: 5 - query: EXPLAIN select count(col2) from T3 where col1 > 0; @@ -694,9 +697,9 @@ agg-empty-table-tests-after-modifications: AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 650 - task_total_time_ms: 24 - transform_count: 161 - transform_time_ms: 7 + task_total_time_ms: 25 + transform_count: 165 + transform_time_ms: 10 transform_yield_count: 46 insert_time_ms: 1 insert_new_count: 72 @@ -705,8 +708,8 @@ agg-empty-table-tests-after-modifications: explain: ISCAN(T3_I1 <,>) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0) task_count: 285 - task_total_time_ms: 12 - transform_count: 76 + task_total_time_ms: 11 + transform_count: 80 transform_time_ms: 4 transform_yield_count: 30 insert_time_ms: 0 @@ -716,9 +719,9 @@ agg-empty-table-tests-after-modifications: explain: ISCAN(T3_I1 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0) task_count: 382 - task_total_time_ms: 15 - transform_count: 103 - transform_time_ms: 5 + task_total_time_ms: 10 + transform_count: 107 + transform_time_ms: 3 transform_yield_count: 34 insert_time_ms: 0 insert_new_count: 35 @@ -728,19 +731,19 @@ agg-empty-table-tests-after-modifications: AGG (count(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0) task_count: 382 - task_total_time_ms: 17 - transform_count: 103 - transform_time_ms: 5 + task_total_time_ms: 11 + transform_count: 107 + transform_time_ms: 4 transform_yield_count: 34 - insert_time_ms: 2 + insert_time_ms: 0 insert_new_count: 35 insert_reused_count: 1 - query: EXPLAIN select sum(col1) from T1; explain: SCAN(<,>) | TFILTER T1 | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0) task_count: 260 - task_total_time_ms: 4 - transform_count: 64 + task_total_time_ms: 7 + transform_count: 68 transform_time_ms: 1 transform_yield_count: 17 insert_time_ms: 0 @@ -751,8 +754,8 @@ agg-empty-table-tests-after-modifications: MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0) task_count: 331 - task_total_time_ms: 10 - transform_count: 85 + task_total_time_ms: 9 + transform_count: 89 transform_time_ms: 2 transform_yield_count: 19 insert_time_ms: 0 @@ -763,8 +766,8 @@ agg-empty-table-tests-after-modifications: MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0) task_count: 331 - task_total_time_ms: 12 - transform_count: 85 + task_total_time_ms: 8 + transform_count: 89 transform_time_ms: 2 transform_yield_count: 19 insert_time_ms: 0 @@ -775,9 +778,9 @@ agg-empty-table-tests-after-modifications: | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0) task_count: 331 - task_total_time_ms: 11 - transform_count: 85 - transform_time_ms: 3 + task_total_time_ms: 7 + transform_count: 89 + transform_time_ms: 1 transform_yield_count: 19 insert_time_ms: 0 insert_new_count: 30 @@ -787,9 +790,9 @@ agg-empty-table-tests-after-modifications: | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0) task_count: 331 - task_total_time_ms: 10 - transform_count: 85 - transform_time_ms: 2 + task_total_time_ms: 3 + transform_count: 89 + transform_time_ms: 1 transform_yield_count: 19 insert_time_ms: 0 insert_new_count: 30 @@ -797,22 +800,22 @@ agg-empty-table-tests-after-modifications: - query: EXPLAIN select sum(col1) from T2; explain: 'AISCAN(T2_I5 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)' - task_count: 481 - task_total_time_ms: 24 - transform_count: 147 - transform_time_ms: 11 - transform_yield_count: 51 - insert_time_ms: 0 - insert_new_count: 41 - insert_reused_count: 5 + task_count: 608 + task_total_time_ms: 35 + transform_count: 188 + transform_time_ms: 21 + transform_yield_count: 60 + insert_time_ms: 1 + insert_new_count: 55 + insert_reused_count: 7 - query: EXPLAIN select sum(col1) from T2 where col2 = 0; explain: 'AISCAN(T2_I6 [EQUALS promote(@c11 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)' task_count: 562 - task_total_time_ms: 29 - transform_count: 171 - transform_time_ms: 17 + task_total_time_ms: 40 + transform_count: 178 + transform_time_ms: 25 transform_yield_count: 58 insert_time_ms: 0 insert_new_count: 47 @@ -821,32 +824,32 @@ agg-empty-table-tests-after-modifications: explain: SCAN(<,>) | TFILTER T2 | FILTER _.COL1 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0) - task_count: 383 - task_total_time_ms: 15 - transform_count: 112 - transform_time_ms: 9 - transform_yield_count: 45 + task_count: 389 + task_total_time_ms: 17 + transform_count: 120 + transform_time_ms: 11 + transform_yield_count: 48 insert_time_ms: 0 - insert_new_count: 30 + insert_new_count: 32 insert_reused_count: 2 - query: EXPLAIN select sum(col1) from T2 where col2 > 0; - explain: SCAN(<,>) | TFILTER T2 | FILTER _.COL2 GREATER_THAN promote(@c11 AS LONG) - | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 - AS _0) - task_count: 383 - task_total_time_ms: 20 - transform_count: 112 - transform_time_ms: 13 - transform_yield_count: 45 + explain: 'AISCAN(T2_I6 [[GREATER_THAN promote(@c11 AS LONG)]] BY_GROUP -> [_0: + KEY:[0], _1: VALUE:[0]]) | AGG sum_l(_._1) GROUP BY () | MAP ((_._1 AS _0) + AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)' + task_count: 584 + task_total_time_ms: 39 + transform_count: 180 + transform_time_ms: 24 + transform_yield_count: 58 insert_time_ms: 0 - insert_new_count: 30 - insert_reused_count: 2 + insert_new_count: 50 + insert_reused_count: 5 - query: EXPLAIN select sum(col1) from T3 where col1 = 0; explain: ISCAN(T3_I1 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0) task_count: 635 - task_total_time_ms: 29 - transform_count: 160 + task_total_time_ms: 27 + transform_count: 164 transform_time_ms: 10 transform_yield_count: 45 insert_time_ms: 1 @@ -856,19 +859,19 @@ agg-empty-table-tests-after-modifications: explain: ISCAN(T3_I2 [EQUALS promote(@c11 AS LONG)]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0) task_count: 635 - task_total_time_ms: 21 - transform_count: 160 - transform_time_ms: 7 + task_total_time_ms: 25 + transform_count: 164 + transform_time_ms: 8 transform_yield_count: 45 - insert_time_ms: 0 + insert_time_ms: 1 insert_new_count: 70 insert_reused_count: 5 - query: EXPLAIN select sum(col1) from T3 where col1 > 0; explain: ISCAN(T3_I1 [[GREATER_THAN promote(@c11 AS LONG)]]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0) task_count: 650 - task_total_time_ms: 27 - transform_count: 161 + task_total_time_ms: 22 + transform_count: 165 transform_time_ms: 7 transform_yield_count: 46 insert_time_ms: 1 @@ -878,10 +881,10 @@ agg-empty-table-tests-after-modifications: explain: ISCAN(T3_I2 [[GREATER_THAN promote(@c11 AS LONG)]]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0) task_count: 650 - task_total_time_ms: 24 - transform_count: 161 - transform_time_ms: 7 + task_total_time_ms: 12 + transform_count: 165 + transform_time_ms: 4 transform_yield_count: 46 - insert_time_ms: 1 + insert_time_ms: 0 insert_new_count: 72 insert_reused_count: 5 diff --git a/yaml-tests/src/test/resources/aggregate-empty-table.yamsql b/yaml-tests/src/test/resources/aggregate-empty-table.yamsql index ab0c3c5044..ba7f2fa770 100644 --- a/yaml-tests/src/test/resources/aggregate-empty-table.yamsql +++ b/yaml-tests/src/test/resources/aggregate-empty-table.yamsql @@ -74,7 +74,7 @@ test_block: - result: [{0}] - - query: select count(*) from T2 where col1 > 0; - - explain: "SCAN(<,>) | TFILTER T2 | FILTER _.COL1 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)" + - explain: "AISCAN(T2_I2 [[GREATER_THAN promote(@c11 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | AGG sum_l(_._1) GROUP BY () | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)" - result: [{0}] - - query: select count(*) from T2 group by col1; @@ -152,7 +152,7 @@ test_block: - result: [{0}] - - query: select count(col2) from T2 where col1 > 0; - - explain: "SCAN(<,>) | TFILTER T2 | FILTER _.COL1 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)" + - explain: "AISCAN(T2_I4 [[GREATER_THAN promote(@c11 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | AGG sum_l(_._1) GROUP BY () | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)" - result: [{0}] - - query: select count(col2) from T2 group by col1; @@ -231,7 +231,7 @@ test_block: - result: [{!null _}] - - query: select sum(col1) from T2 where col2 > 0; - - explain: "SCAN(<,>) | TFILTER T2 | FILTER _.COL2 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)" + - explain: "AISCAN(T2_I6 [[GREATER_THAN promote(@c11 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | AGG sum_l(_._1) GROUP BY () | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)" - result: [{!null _}] - - query: select sum(col1) from T2 where col1 = 0 group by col2; @@ -415,7 +415,7 @@ test_block: - result: [{0}] - - query: select count(col2) from T2 where col1 > 0; - - explain: "SCAN(<,>) | TFILTER T2 | FILTER _.COL1 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)" + - explain: "AISCAN(T2_I4 [[GREATER_THAN promote(@c11 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | AGG sum_l(_._1) GROUP BY () | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)" - result: [{0}] # - # # TODO ([POST] count index returns 0 instead of nothing when running on a table that was cleared) @@ -497,8 +497,9 @@ test_block: - result: [{!null _}] - - query: select sum(col1) from T2 where col2 > 0; - - explain: "SCAN(<,>) | TFILTER T2 | FILTER _.COL2 GREATER_THAN promote(@c11 AS LONG) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)" - - result: [{!null _}] + - supported_version: !current_version + - explain: "AISCAN(T2_I6 [[GREATER_THAN promote(@c11 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | AGG sum_l(_._1) GROUP BY () | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)" + - result: [{!l 0}] - - query: select sum(col1) from T2 where col1 = 0 group by col2; - error: "0AF00" diff --git a/yaml-tests/src/test/resources/aggregate-index-tests-count-empty.metrics.binpb b/yaml-tests/src/test/resources/aggregate-index-tests-count-empty.metrics.binpb index efc80de415..cf83215b7b 100644 --- a/yaml-tests/src/test/resources/aggregate-index-tests-count-empty.metrics.binpb +++ b/yaml-tests/src/test/resources/aggregate-index-tests-count-empty.metrics.binpb @@ -1,8 +1,7 @@ - + > -agg-index-tests-count-emptyEXPLAIN select count(*) from t1 - - (+038)@AISCAN(MV1 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +agg-index-tests-count-emptyEXPLAIN select count(*) from t1 + (40%87@AISCAN(MV1 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; @@ -10,29 +9,28 @@ 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Value Computation
    MAP (q4 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 5 [ label=<
    Index
    MV1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 5 [ label=<
    Index
    MV1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q4> label="q4" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} L -agg-index-tests-count-empty-EXPLAIN select count(*) from t1 group by col2 -n ȟ((0 8@KAISCAN(MV2 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) +agg-index-tests-count-empty-EXPLAIN select count(*) from t1 group by col2 + u ((08@KAISCAN(MV2 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    MV2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} A -agg-index-tests-count-empty"EXPLAIN select count(col1) from t1 - - (+0*8)@AISCAN(MV3 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +agg-index-tests-count-empty"EXPLAIN select count(col1) from t1 +럖 (40R87@AISCAN(MV3 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; @@ -40,90 +38,90 @@ A 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Value Computation
    MAP (q4 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 5 [ label=<
    Index
    MV3
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 5 [ label=<
    Index
    MV3
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q4> label="q4" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} O -agg-index-tests-count-empty0EXPLAIN select count(col1) from t1 group by col2 - -n ((0Ө8@KAISCAN(MV4 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) +agg-index-tests-count-empty0EXPLAIN select count(col1) from t1 group by col2 + +u ((08@KAISCAN(MV4 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV4
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    MV4
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} > -agg-index-tests-count-emptyEXPLAIN select count(*) from t2 -N (08$@ISCAN(MV5 <,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +agg-index-tests-count-emptyEXPLAIN select count(*) from t2 +R Ջ(08$@ISCAN(MV5 <,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    MV5
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3 AS _0)" ]; + 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 6 [ label=<
    Index
    MV5
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q54> label="q54" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q60> label="q60" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} L -agg-index-tests-count-empty-EXPLAIN select count(*) from t2 group by col2 -H (08@kISCAN(MV5 <,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) GROUP BY (_._0.COL2 AS _0) | MAP (_._1._0 AS _0)digraph G { +agg-index-tests-count-empty-EXPLAIN select count(*) from t2 group by col2 +L (08@kISCAN(MV5 <,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) GROUP BY (_._0.COL2 AS _0) | MAP (_._1._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    GROUP BY (q41._0.COL2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index
    MV5
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    GROUP BY (q44._0.COL2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, LONG AS _0 AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3 AS _0)" ]; + 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 5 [ label=<
    Index
    MV5
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 3 -> 2 [ label=< q44> label="q44" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} A -agg-index-tests-count-empty"EXPLAIN select count(col1) from t2 -N (0#8$@ISCAN(MV5 <,>) | MAP (_ AS _0) | AGG (count(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +agg-index-tests-count-empty"EXPLAIN select count(col1) from t2 +R (08$@ISCAN(MV5 <,>) | MAP (_ AS _0) | AGG (count(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q54._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    MV5
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q60._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3 AS _0)" ]; + 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 6 [ label=<
    Index
    MV5
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q54> label="q54" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q60> label="q60" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} O -agg-index-tests-count-empty0EXPLAIN select count(col1) from t2 group by col2 -H ہ(08@nISCAN(MV5 <,>) | MAP (_ AS _0) | AGG (count(_._0.COL1) AS _0) GROUP BY (_._0.COL2 AS _0) | MAP (_._1._0 AS _0)digraph G { +agg-index-tests-count-empty0EXPLAIN select count(col1) from t2 group by col2 +L (0 8@nISCAN(MV5 <,>) | MAP (_ AS _0) | AGG (count(_._0.COL1) AS _0) GROUP BY (_._0.COL2 AS _0) | MAP (_._1._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Streaming Aggregate
    COLLECT (count(q41._0.COL1) AS _0)
    GROUP BY (q41._0.COL2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index
    MV5
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT (count(q44._0.COL1) AS _0)
    GROUP BY (q44._0.COL2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, LONG AS _0 AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3 AS _0)" ]; + 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 5 [ label=<
    Index
    MV5
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 3 -> 2 [ label=< q44> label="q44" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; diff --git a/yaml-tests/src/test/resources/aggregate-index-tests-count-empty.metrics.yaml b/yaml-tests/src/test/resources/aggregate-index-tests-count-empty.metrics.yaml index 0bd40480b3..9dd45023a8 100644 --- a/yaml-tests/src/test/resources/aggregate-index-tests-count-empty.metrics.yaml +++ b/yaml-tests/src/test/resources/aggregate-index-tests-count-empty.metrics.yaml @@ -2,21 +2,21 @@ agg-index-tests-count-empty: - query: EXPLAIN select count(*) from t1 explain: 'AISCAN(MV1 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)' - task_count: 465 - task_total_time_ms: 22 - transform_count: 139 - transform_time_ms: 10 - transform_yield_count: 43 + task_count: 592 + task_total_time_ms: 15 + transform_count: 180 + transform_time_ms: 8 + transform_yield_count: 52 insert_time_ms: 0 - insert_new_count: 41 - insert_reused_count: 5 + insert_new_count: 55 + insert_reused_count: 7 - query: EXPLAIN select count(*) from t1 group by col2 explain: 'AISCAN(MV2 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0)' task_count: 348 - task_total_time_ms: 9 - transform_count: 110 - transform_time_ms: 5 + task_total_time_ms: 20 + transform_count: 117 + transform_time_ms: 12 transform_yield_count: 40 insert_time_ms: 0 insert_new_count: 24 @@ -24,21 +24,21 @@ agg-index-tests-count-empty: - query: EXPLAIN select count(col1) from t1 explain: 'AISCAN(MV3 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)' - task_count: 465 - task_total_time_ms: 22 - transform_count: 139 - transform_time_ms: 8 - transform_yield_count: 43 - insert_time_ms: 0 - insert_new_count: 41 - insert_reused_count: 5 + task_count: 592 + task_total_time_ms: 33 + transform_count: 180 + transform_time_ms: 18 + transform_yield_count: 52 + insert_time_ms: 1 + insert_new_count: 55 + insert_reused_count: 7 - query: EXPLAIN select count(col1) from t1 group by col2 explain: 'AISCAN(MV4 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0)' task_count: 348 task_total_time_ms: 22 - transform_count: 110 - transform_time_ms: 10 + transform_count: 117 + transform_time_ms: 13 transform_yield_count: 40 insert_time_ms: 0 insert_new_count: 24 @@ -47,9 +47,9 @@ agg-index-tests-count-empty: explain: ISCAN(MV5 <,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 332 - task_total_time_ms: 14 - transform_count: 78 - transform_time_ms: 4 + task_total_time_ms: 11 + transform_count: 82 + transform_time_ms: 3 transform_yield_count: 27 insert_time_ms: 0 insert_new_count: 36 @@ -58,9 +58,9 @@ agg-index-tests-count-empty: explain: ISCAN(MV5 <,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) GROUP BY (_._0.COL2 AS _0) | MAP (_._1._0 AS _0) task_count: 273 - task_total_time_ms: 9 - transform_count: 72 - transform_time_ms: 3 + task_total_time_ms: 11 + transform_count: 76 + transform_time_ms: 4 transform_yield_count: 24 insert_time_ms: 0 insert_new_count: 25 @@ -69,9 +69,9 @@ agg-index-tests-count-empty: explain: ISCAN(MV5 <,>) | MAP (_ AS _0) | AGG (count(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 332 - task_total_time_ms: 15 - transform_count: 78 - transform_time_ms: 6 + task_total_time_ms: 11 + transform_count: 82 + transform_time_ms: 3 transform_yield_count: 27 insert_time_ms: 0 insert_new_count: 36 @@ -80,8 +80,8 @@ agg-index-tests-count-empty: explain: ISCAN(MV5 <,>) | MAP (_ AS _0) | AGG (count(_._0.COL1) AS _0) GROUP BY (_._0.COL2 AS _0) | MAP (_._1._0 AS _0) task_count: 273 - task_total_time_ms: 11 - transform_count: 72 + task_total_time_ms: 9 + transform_count: 76 transform_time_ms: 3 transform_yield_count: 24 insert_time_ms: 0 diff --git a/yaml-tests/src/test/resources/aggregate-index-tests-count.metrics.binpb b/yaml-tests/src/test/resources/aggregate-index-tests-count.metrics.binpb index 155e802e42..1daa291af5 100644 --- a/yaml-tests/src/test/resources/aggregate-index-tests-count.metrics.binpb +++ b/yaml-tests/src/test/resources/aggregate-index-tests-count.metrics.binpb @@ -1,7 +1,8 @@ - + 8 -agg-index-tests-countEXPLAIN select count(*) from t1 -  (+0:8)@AISCAN(MV1 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +agg-index-tests-countEXPLAIN select count(*) from t1 +ઞ +(40E87@AISCAN(MV1 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; @@ -9,30 +10,28 @@ 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Value Computation
    MAP (q4 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 5 [ label=<
    Index
    MV1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 5 [ label=<
    Index
    MV1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q4> label="q4" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} F -agg-index-tests-count-EXPLAIN select count(*) from t1 group by col2 - -n ((08@KAISCAN(MV2 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) +agg-index-tests-count-EXPLAIN select count(*) from t1 group by col2 + u ((08@KAISCAN(MV2 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    MV2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} ; -agg-index-tests-count"EXPLAIN select count(col1) from t1 - - (+0-8)@AISCAN(MV3 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +agg-index-tests-count"EXPLAIN select count(col1) from t1 +ʓ (40u87@AISCAN(MV3 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; @@ -40,89 +39,89 @@ digraph G { 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Value Computation
    MAP (q4 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 5 [ label=<
    Index
    MV3
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 5 [ label=<
    Index
    MV3
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q4> label="q4" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} I -agg-index-tests-count0EXPLAIN select count(col1) from t1 group by col2 -n ϋ((0ã8@KAISCAN(MV4 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) +agg-index-tests-count0EXPLAIN select count(col1) from t1 group by col2 + u ((08@KAISCAN(MV4 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV4
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    MV4
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} K -(agg-index-tests-count-after-more-insertsEXPLAIN select count(*) from t2 -N (08$@ISCAN(MV5 <,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +(agg-index-tests-count-after-more-insertsEXPLAIN select count(*) from t2 +R (08$@ISCAN(MV5 <,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    MV5
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3 AS _0)" ]; + 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 6 [ label=<
    Index
    MV5
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q54> label="q54" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q60> label="q60" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} Y -(agg-index-tests-count-after-more-inserts-EXPLAIN select count(*) from t2 group by col2 -H (08@kISCAN(MV5 <,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) GROUP BY (_._0.COL2 AS _0) | MAP (_._1._0 AS _0)digraph G { +(agg-index-tests-count-after-more-inserts-EXPLAIN select count(*) from t2 group by col2 +L (08@kISCAN(MV5 <,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) GROUP BY (_._0.COL2 AS _0) | MAP (_._1._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    GROUP BY (q41._0.COL2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index
    MV5
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    GROUP BY (q44._0.COL2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, LONG AS _0 AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3 AS _0)" ]; + 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 5 [ label=<
    Index
    MV5
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 3 -> 2 [ label=< q44> label="q44" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} N -(agg-index-tests-count-after-more-inserts"EXPLAIN select count(col1) from t2 -N (0#8$@ISCAN(MV5 <,>) | MAP (_ AS _0) | AGG (count(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +(agg-index-tests-count-after-more-inserts"EXPLAIN select count(col1) from t2 +R (08$@ISCAN(MV5 <,>) | MAP (_ AS _0) | AGG (count(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q54._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    MV5
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q60._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3 AS _0)" ]; + 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 6 [ label=<
    Index
    MV5
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q54> label="q54" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q60> label="q60" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} \ -(agg-index-tests-count-after-more-inserts0EXPLAIN select count(col1) from t2 group by col2 -H (08@nISCAN(MV5 <,>) | MAP (_ AS _0) | AGG (count(_._0.COL1) AS _0) GROUP BY (_._0.COL2 AS _0) | MAP (_._1._0 AS _0)digraph G { +(agg-index-tests-count-after-more-inserts0EXPLAIN select count(col1) from t2 group by col2 +ݩL (08@nISCAN(MV5 <,>) | MAP (_ AS _0) | AGG (count(_._0.COL1) AS _0) GROUP BY (_._0.COL2 AS _0) | MAP (_._1._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Streaming Aggregate
    COLLECT (count(q41._0.COL1) AS _0)
    GROUP BY (q41._0.COL2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index
    MV5
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT (count(q44._0.COL1) AS _0)
    GROUP BY (q44._0.COL2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, LONG AS _0 AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3 AS _0)" ]; + 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 5 [ label=<
    Index
    MV5
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 3 -> 2 [ label=< q44> label="q44" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; diff --git a/yaml-tests/src/test/resources/aggregate-index-tests-count.metrics.yaml b/yaml-tests/src/test/resources/aggregate-index-tests-count.metrics.yaml index 7917d2a24a..787f509e1b 100644 --- a/yaml-tests/src/test/resources/aggregate-index-tests-count.metrics.yaml +++ b/yaml-tests/src/test/resources/aggregate-index-tests-count.metrics.yaml @@ -2,21 +2,21 @@ agg-index-tests-count: - query: EXPLAIN select count(*) from t1 explain: 'AISCAN(MV1 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)' - task_count: 465 - task_total_time_ms: 23 - transform_count: 139 - transform_time_ms: 11 - transform_yield_count: 43 - insert_time_ms: 0 - insert_new_count: 41 - insert_reused_count: 5 + task_count: 592 + task_total_time_ms: 36 + transform_count: 180 + transform_time_ms: 21 + transform_yield_count: 52 + insert_time_ms: 1 + insert_new_count: 55 + insert_reused_count: 7 - query: EXPLAIN select count(*) from t1 group by col2 explain: 'AISCAN(MV2 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0)' task_count: 348 - task_total_time_ms: 21 - transform_count: 110 - transform_time_ms: 11 + task_total_time_ms: 28 + transform_count: 117 + transform_time_ms: 18 transform_yield_count: 40 insert_time_ms: 0 insert_new_count: 24 @@ -24,21 +24,21 @@ agg-index-tests-count: - query: EXPLAIN select count(col1) from t1 explain: 'AISCAN(MV3 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)' - task_count: 465 - task_total_time_ms: 22 - transform_count: 139 - transform_time_ms: 10 - transform_yield_count: 43 - insert_time_ms: 0 - insert_new_count: 41 - insert_reused_count: 5 + task_count: 592 + task_total_time_ms: 35 + transform_count: 180 + transform_time_ms: 20 + transform_yield_count: 52 + insert_time_ms: 1 + insert_new_count: 55 + insert_reused_count: 7 - query: EXPLAIN select count(col1) from t1 group by col2 explain: 'AISCAN(MV4 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0)' task_count: 348 - task_total_time_ms: 15 - transform_count: 110 - transform_time_ms: 8 + task_total_time_ms: 26 + transform_count: 117 + transform_time_ms: 17 transform_yield_count: 40 insert_time_ms: 0 insert_new_count: 24 @@ -49,8 +49,8 @@ agg-index-tests-count-after-more-inserts: NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 332 task_total_time_ms: 11 - transform_count: 78 - transform_time_ms: 3 + transform_count: 82 + transform_time_ms: 4 transform_yield_count: 27 insert_time_ms: 0 insert_new_count: 36 @@ -59,9 +59,9 @@ agg-index-tests-count-after-more-inserts: explain: ISCAN(MV5 <,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) GROUP BY (_._0.COL2 AS _0) | MAP (_._1._0 AS _0) task_count: 273 - task_total_time_ms: 11 - transform_count: 72 - transform_time_ms: 4 + task_total_time_ms: 12 + transform_count: 76 + transform_time_ms: 3 transform_yield_count: 24 insert_time_ms: 0 insert_new_count: 25 @@ -70,8 +70,8 @@ agg-index-tests-count-after-more-inserts: explain: ISCAN(MV5 <,>) | MAP (_ AS _0) | AGG (count(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 332 - task_total_time_ms: 11 - transform_count: 78 + task_total_time_ms: 12 + transform_count: 82 transform_time_ms: 3 transform_yield_count: 27 insert_time_ms: 0 @@ -82,7 +82,7 @@ agg-index-tests-count-after-more-inserts: (_._0.COL2 AS _0) | MAP (_._1._0 AS _0) task_count: 273 task_total_time_ms: 11 - transform_count: 72 + transform_count: 76 transform_time_ms: 3 transform_yield_count: 24 insert_time_ms: 0 diff --git a/yaml-tests/src/test/resources/aggregate-index-tests.metrics.binpb b/yaml-tests/src/test/resources/aggregate-index-tests.metrics.binpb index a0f6db7d39..f47854890d 100644 --- a/yaml-tests/src/test/resources/aggregate-index-tests.metrics.binpb +++ b/yaml-tests/src/test/resources/aggregate-index-tests.metrics.binpb @@ -1,412 +1,404 @@ - + H -agg-index-tests5EXPLAIN select col1, sum(col2) from T1 group by col1; - (@0)80@YAISCAN(MV1 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._0 AS COL1, _._1 AS _1) +agg-index-tests5EXPLAIN select col1, sum(col2) from T1 group by col1; + +(@0/80@YAISCAN(MV1 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._0 AS COL1, _._1 AS _1) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL1, q6._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL1, q6._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, LONG AS _1)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    MV1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} = -agg-index-tests*EXPLAIN select col1 from T1 group by col1; - j (60#8%@ZISCAN(VI1 <,>) | MAP (_ AS _0) | AGG () GROUP BY (_._0.COL1 AS _0) | MAP (_._0._0 AS COL1)digraph G { +agg-index-tests*EXPLAIN select col1 from T1 group by col1; +ۆ n (60Ҷ!8%@ZISCAN(VI1 <,>) | MAP (_ AS _0) | AGG () GROUP BY (_._0.COL1 AS _0) | MAP (_._0._0 AS COL1)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS COL1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1)" ]; - 2 [ label=<
    Streaming Aggregate
    COLLECT ()
    GROUP BY (q109._0.COL1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index
    VI1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q109> label="q109" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT ()
    GROUP BY (q115._0.COL1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 5 [ label=<
    Index
    VI1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ label=< q115> label="q115" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} B -agg-index-tests/EXPLAIN select sum(col2) from T1 group by col1; - (@0680@KAISCAN(MV1 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) +agg-index-tests/EXPLAIN select sum(col2) from T1 group by col1; + (@0,80@KAISCAN(MV1 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    MV1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} Z -agg-index-testsGEXPLAIN select col1, sum(col2) from T1 group by col1 order by col1 asc; - ۿ (@0ʭ380@YAISCAN(MV1 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._0 AS COL1, _._1 AS _1) +agg-index-testsGEXPLAIN select col1, sum(col2) from T1 group by col1 order by col1 asc; + Ȇ (@0+80@YAISCAN(MV1 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._0 AS COL1, _._1 AS _1) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL1, q6._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL1, q6._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, LONG AS _1)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    MV1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} [ -agg-index-testsHEXPLAIN select col1, sum(col2) from T1 group by col1 order by col1 desc; -Ӱ (@0380@aAISCAN(MV1 <,> BY_GROUP REVERSE -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._0 AS COL1, _._1 AS _1) -digraph G { +agg-index-testsHEXPLAIN select col1, sum(col2) from T1 group by col1 order by col1 desc; +Ӵ (@0̞*80@aAISCAN(MV1 <,> BY_GROUP REVERSE -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._0 AS COL1, _._1 AS _1) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL1, q6._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL1, q6._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, LONG AS _1)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    MV1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} L -agg-index-tests9EXPLAIN select col1, sum(col2) + 1 from T1 group by col1; - (@0ѳ580@]AISCAN(MV1 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._0 AS COL1, _._1 + 1 AS _1) +agg-index-tests9EXPLAIN select col1, sum(col2) + 1 from T1 group by col1; +Ľ (@0Ҙ+80@]AISCAN(MV1 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._0 AS COL1, _._1 + 1 AS _1) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL1, q6._1 + 1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL1, q6._1 + 1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, LONG AS _1)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    MV1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} H -agg-index-tests5EXPLAIN select col1, max(col2) from T1 group by col1; - 鼆 (B0982@WAISCAN(MV8 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1]]) | MAP (_._0 AS COL1, _._1 AS _1) +agg-index-tests5EXPLAIN select col1, max(col2) from T1 group by col1; + (B0-82@WAISCAN(MV8 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1]]) | MAP (_._0 AS COL1, _._1 AS _1) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL1, q6._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV8
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL1, q6._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, LONG AS _1)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    MV8
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} V -agg-index-testsCEXPLAIN select col1, max(col2) from T1 group by col1 order by col1; -ؚ  (B0)82@WAISCAN(MV8 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1]]) | MAP (_._0 AS COL1, _._1 AS _1) +agg-index-testsCEXPLAIN select col1, max(col2) from T1 group by col1 order by col1; +ů (B0382@WAISCAN(MV8 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1]]) | MAP (_._0 AS COL1, _._1 AS _1) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL1, q6._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV8
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL1, q6._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, LONG AS _1)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    MV8
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} [ -agg-index-testsHEXPLAIN select col1, max(col2) from T1 group by col1 order by col1 desc; -Ѡ Ͱ -(B0C82@_AISCAN(MV8 <,> BY_GROUP REVERSE -> [_0: KEY:[0], _1: KEY:[1]]) | MAP (_._0 AS COL1, _._1 AS _1) -digraph G { +agg-index-testsHEXPLAIN select col1, max(col2) from T1 group by col1 order by col1 desc; + (B0682@_AISCAN(MV8 <,> BY_GROUP REVERSE -> [_0: KEY:[0], _1: KEY:[1]]) | MAP (_._0 AS COL1, _._1 AS _1) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL1, q6._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV8
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL1, q6._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, LONG AS _1)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    MV8
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} X -agg-index-testsEEXPLAIN select col1, max(col2) from T1 where col1 = 10 group by col1; - (J0ďG8F@rAISCAN(MV8 [EQUALS promote(@c13 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1]]) | MAP (_._0 AS COL1, _._1 AS _1) +agg-index-testsEEXPLAIN select col1, max(col2) from T1 where col1 = 10 group by col1; + (J0;8F@rAISCAN(MV8 [EQUALS promote(@c13 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1]]) | MAP (_._0 AS COL1, _._1 AS _1) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL1, q6._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c13 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV8
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL1, q6._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, LONG AS _1)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c13 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    MV8
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} D -agg-index-tests1EXPLAIN select max(col2) from T1 use index (mv8); -H (0ئ8@cISCAN(MV8 <,>) | MAP (_ AS _0) | AGG (max_l(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +agg-index-tests1EXPLAIN select max(col2) from T1 use index (mv8); +ü  ׷("018.@AISCAN(MV8 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1]]) | AGG max_l(_._1) GROUP BY () | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (max_l(q97._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    MV8
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Value Computation
    MAP ((q4._1 AS _0) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Streaming Aggregate
    COLLECT max_l(q104._1)
    GROUP BY ()
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; + 5 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 6 [ label=<
    Index
    MV8
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q97> label="q97" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q4> label="q4" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q104> label="q104" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} ? -agg-index-tests,EXPLAIN select col2 from T1 where col1 = 10; - (E0ՏS8D@nCOVERING(MV8 [EQUALS promote(@c8 AS LONG)] -> [COL1: KEY[0], COL2: KEY[1], ID: KEY[3]]) | MAP (_.COL2 AS COL2) +agg-index-tests,EXPLAIN select col2 from T1 where col1 = 10; + (E0Q8D@nCOVERING(MV8 [EQUALS promote(@c8 AS LONG)] -> [COL1: KEY[0], COL2: KEY[1], ID: KEY[3]]) | MAP (_.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q133.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL2)" ]; - 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c8 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index
    MV8
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q142.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL2)" ]; + 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c8 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Index
    MV8
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q133> label="q133" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q142> label="q142" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} R -agg-index-tests?EXPLAIN select col2 from T1 where col1 = 10 order by col2 desc; -X ڽ(008@vCOVERING(MV8 [EQUALS promote(@c8 AS LONG)] REVERSE -> [COL1: KEY[0], COL2: KEY[1], ID: KEY[3]]) | MAP (_.COL2 AS COL2) +agg-index-tests?EXPLAIN select col2 from T1 where col1 = 10 order by col2 desc; +\ ڮ(008@vCOVERING(MV8 [EQUALS promote(@c8 AS LONG)] REVERSE -> [COL1: KEY[0], COL2: KEY[1], ID: KEY[3]]) | MAP (_.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q84.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL2)" ]; - 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c8 AS LONG)]
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index
    MV8
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q85.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL2)" ]; + 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c8 AS LONG)]
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Index
    MV8
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q84> label="q84" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q85> label="q85" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} H -agg-index-tests5EXPLAIN select min(col3) from T2 group by col1, col2; - ` ʍ(408@ISCAN(MV2 <,>) | MAP (_ AS _0) | AGG (min_l(_._0.COL3) AS _0) GROUP BY (_._0.COL1 AS _0, _._0.COL2 AS _1) | MAP (_._1._0 AS _0)digraph G { +agg-index-tests5EXPLAIN select min(col3) from T2 group by col1, col2; + +d (408@ISCAN(MV2 <,>) | MAP (_ AS _0) | AGG (min_l(_._0.COL3) AS _0) GROUP BY (_._0.COL1 AS _0, _._0.COL2 AS _1) | MAP (_._1._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Streaming Aggregate
    COLLECT (min_l(q91._0.COL3) AS _0)
    GROUP BY (q91._0.COL1 AS _0, q91._0.COL2 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, AS _0, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index
    MV2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q91> label="q91" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT (min_l(q94._0.COL3) AS _0)
    GROUP BY (q94._0.COL1 AS _0, q94._0.COL2 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1 AS _0, LONG AS _0 AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3 AS _0)" ]; + 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 5 [ label=<
    Index
    MV2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 3 -> 2 [ label=< q94> label="q94" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} 4 -agg-index-tests!EXPLAIN select max(col2) from t2; -z (?0N8<@cISCAN(MV3 <,>) | MAP (_ AS _0) | AGG (max_l(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +agg-index-tests!EXPLAIN select max(col2) from t2; + (N0p8V@ AISCAN(MV9 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) | AGG max_l(_._2) GROUP BY () | MAP ((_._2 AS _0) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (max_l(q130._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    MV3
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Value Computation
    MAP ((q4._2 AS _0) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Streaming Aggregate
    COLLECT max_l(q148._2)
    GROUP BY ()
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; + 5 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2)" ]; + 6 [ label=<
    Index
    MV9
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q130> label="q130" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q4> label="q4" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q148> label="q148" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} X -agg-index-testsEEXPLAIN select col1, sum(col2) from T1 USE INDEX (vi1) group by col1; -熝D (08@ISCAN(VI1 <,>) | MAP (_ AS _0) | AGG (sum_l(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._0._0 AS COL1, _._1._0 AS _1)digraph G { +agg-index-testsEEXPLAIN select col1, sum(col2) from T1 USE INDEX (vi1) group by col1; +榨H (08@ISCAN(VI1 <,>) | MAP (_ AS _0) | AGG (sum_l(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._0._0 AS COL1, _._1._0 AS _1)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS COL1, q6._1._0 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q97._0.COL2) AS _0)
    GROUP BY (q97._0.COL1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index
    VI1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q97> label="q97" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS COL1, q6._1._0 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, LONG AS _1)" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q100._0.COL2) AS _0)
    GROUP BY (q100._0.COL1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, LONG AS _0 AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 5 [ label=<
    Index
    VI1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ label=< q100> label="q100" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} H -agg-index-tests5EXPLAIN select max(col2) from t2 group by col1, col3; -죲  (D0-82@VAISCAN(MV9 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) | MAP (_._2 AS _0) +agg-index-tests5EXPLAIN select max(col2) from t2 group by col1, col3; +Ý (D0882@VAISCAN(MV9 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) | MAP (_._2 AS _0) digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV9
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2)" ]; + 3 [ label=<
    Index
    MV9
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} T -agg-index-testsAEXPLAIN select col1, col3, max(col2) from t2 group by col1, col3; - (D0>82@rAISCAN(MV9 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) | MAP (_._0 AS COL1, _._1 AS COL3, _._2 AS _2) -digraph G { +agg-index-testsAEXPLAIN select col1, col3, max(col2) from t2 group by col1, col3; + (D0382@rAISCAN(MV9 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) | MAP (_._0 AS COL1, _._1 AS COL3, _._2 AS _2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL1, q6._1 AS COL3, q6._2 AS _2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV9
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL1, q6._1 AS COL3, q6._2 AS _2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, LONG AS COL3, LONG AS _2)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2)" ]; + 3 [ label=<
    Index
    MV9
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} ] -agg-index-testsJEXPLAIN select col3, max(col2) from t2 where col1 = 2 group by col1, col3; - (L0;8F@AISCAN(MV9 [EQUALS promote(@c13 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) | MAP (_._1 AS COL3, _._2 AS _1) -digraph G { +agg-index-testsJEXPLAIN select col3, max(col2) from t2 where col1 = 2 group by col1, col3; +Ʀ μ(L0<8F@AISCAN(MV9 [EQUALS promote(@c13 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) | MAP (_._1 AS COL3, _._2 AS _1) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._1 AS COL3, q6._2 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL3, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c13 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV9
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._1 AS COL3, q6._2 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL3, LONG AS _1)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c13 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2)" ]; + 3 [ label=<
    Index
    MV9
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} u -agg-index-testsbEXPLAIN select col3, max(col2) from t2 where col1 = 1 group by col1, col3 order by max(col2) desc; -| Ь (:08@AISCAN(MV9 [EQUALS promote(@c13 AS LONG)] BY_GROUP REVERSE -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) | MAP (_._1 AS COL3, _._2 AS _1) -digraph G { +agg-index-testsbEXPLAIN select col3, max(col2) from t2 where col1 = 1 group by col1, col3 order by max(col2) desc; +ϙ ȳ (:08@AISCAN(MV9 [EQUALS promote(@c13 AS LONG)] BY_GROUP REVERSE -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) | MAP (_._1 AS COL3, _._2 AS _1) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._1 AS COL3, q6._2 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL3, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c13 AS LONG)]
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV9
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._1 AS COL3, q6._2 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL3, LONG AS _1)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c13 AS LONG)]
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2)" ]; + 3 [ label=<
    Index
    MV9
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +}  -agg-index-testswEXPLAIN select col3, max(col2) from t2 where col1 = 1 group by col1, col3 having max(col2) < 2 order by max(col2) desc; -  (:08@AISCAN(MV9 [EQUALS promote(@c13 AS LONG), [LESS_THAN promote(@c25 AS LONG)]] BY_GROUP REVERSE -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) | MAP (_._1 AS COL3, _._2 AS _1) digraph G { +agg-index-testswEXPLAIN select col3, max(col2) from t2 where col1 = 1 group by col1, col3 having max(col2) < 2 order by max(col2) desc; + ӑ(:08@AISCAN(MV9 [EQUALS promote(@c13 AS LONG), [LESS_THAN promote(@c25 AS LONG)]] BY_GROUP REVERSE -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) | MAP (_._1 AS COL3, _._2 AS _1) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._1 AS COL3, q6._2 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL3, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c13 AS LONG), [LESS_THAN promote(@c25 AS LONG)]]
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV9
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._1 AS COL3, q6._2 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL3, LONG AS _1)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c13 AS LONG), [LESS_THAN promote(@c25 AS LONG)]]
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2)" ]; + 3 [ label=<
    Index
    MV9
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +}  -agg-index-testsEXPLAIN select col3, max(col2) from t2 where col1 = 1 group by col1, col3 having max(col2) < 2 and max(col2) >= 1 order by max(col2) desc; - (:08@AISCAN(MV9 [EQUALS promote(@c13 AS LONG), [GREATER_THAN_OR_EQUALS promote(@c13 AS LONG) && LESS_THAN promote(@c25 AS LONG)]] BY_GROUP REVERSE -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) | MAP (_._1 AS COL3, _._2 AS _1) digraph G { +agg-index-testsEXPLAIN select col3, max(col2) from t2 where col1 = 1 group by col1, col3 having max(col2) < 2 and max(col2) >= 1 order by max(col2) desc; + (:08@AISCAN(MV9 [EQUALS promote(@c13 AS LONG), [GREATER_THAN_OR_EQUALS promote(@c13 AS LONG) && LESS_THAN promote(@c25 AS LONG)]] BY_GROUP REVERSE -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) | MAP (_._1 AS COL3, _._2 AS _1) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._1 AS COL3, q6._2 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL3, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c13 AS LONG), [GREATER_THAN_OR_EQUALS promote(@c13 AS LONG) && LESS_THAN promote(@c25 AS LONG)]]
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV9
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._1 AS COL3, q6._2 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL3, LONG AS _1)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c13 AS LONG), [GREATER_THAN_OR_EQUALS promote(@c13 AS LONG) && LESS_THAN promote(@c25 AS LONG)]]
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2)" ]; + 3 [ label=<
    Index
    MV9
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +}  -agg-index-testsEXPLAIN select t.* from (select col3, max(col2) as m from t2 where col1 = 1 group by col1, col3) as t where m < 2 order by m desc; -ͳ (?0*8$@AISCAN(MV9 [EQUALS promote(@c21 AS LONG), [LESS_THAN promote(@c33 AS LONG)]] BY_GROUP REVERSE -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) | MAP (_._1 AS COL3, _._2 AS M) digraph G { +agg-index-testsEXPLAIN select t.* from (select col3, max(col2) as m from t2 where col1 = 1 group by col1, col3) as t where m < 2 order by m desc; + (?0!8$@AISCAN(MV9 [EQUALS promote(@c21 AS LONG), [LESS_THAN promote(@c33 AS LONG)]] BY_GROUP REVERSE -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) | MAP (_._1 AS COL3, _._2 AS M) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._1 AS COL3, q6._2 AS M)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL3, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c21 AS LONG), [LESS_THAN promote(@c33 AS LONG)]]
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV9
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._1 AS COL3, q6._2 AS M)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL3, LONG AS M)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c21 AS LONG), [LESS_THAN promote(@c33 AS LONG)]]
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2)" ]; + 3 [ label=<
    Index
    MV9
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +}  -agg-index-testszEXPLAIN select col3, m from (select col3, max(col2) as m from t2 where col1 = 1 group by col1, col3) as t order by m desc; -ؤ (<08@AISCAN(MV9 [EQUALS promote(@c21 AS LONG)] BY_GROUP REVERSE -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) | MAP (_._1 AS COL3, _._2 AS M) -digraph G { +agg-index-testszEXPLAIN select col3, m from (select col3, max(col2) as m from t2 where col1 = 1 group by col1, col3) as t order by m desc; + (<08@AISCAN(MV9 [EQUALS promote(@c21 AS LONG)] BY_GROUP REVERSE -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) | MAP (_._1 AS COL3, _._2 AS M) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._1 AS COL3, q6._2 AS M)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL3, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c21 AS LONG)]
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV9
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._1 AS COL3, q6._2 AS M)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL3, LONG AS M)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c21 AS LONG)]
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2)" ]; + 3 [ label=<
    Index
    MV9
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} V -agg-index-testsCEXPLAIN select col3, col2 from t2 where col1 = 1 order by col3 asc; -ϵ m (608@COVERING(MV9 [EQUALS promote(@c10 AS LONG)] -> [COL1: KEY[0], COL2: KEY[2], COL3: KEY[1], ID: KEY[4]]) | MAP (_.COL3 AS COL3, _.COL2 AS COL2) +agg-index-testsCEXPLAIN select col3, col2 from t2 where col1 = 1 order by col3 asc; + q ˡ(608@COVERING(MV9 [EQUALS promote(@c10 AS LONG)] -> [COL1: KEY[0], COL2: KEY[2], COL3: KEY[1], ID: KEY[4]]) | MAP (_.COL3 AS COL3, _.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q84.COL3 AS COL3, q84.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL3, )" ]; - 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c10 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index
    MV9
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q86.COL3 AS COL3, q86.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL3, LONG AS COL2)" ]; + 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c10 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 3 [ label=<
    Index
    MV9
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q84> label="q84" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q86> label="q86" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} W -agg-index-testsDEXPLAIN select col3, col2 from t2 where col1 = 1 order by col3 desc; - m (608@COVERING(MV9 [EQUALS promote(@c10 AS LONG)] REVERSE -> [COL1: KEY[0], COL2: KEY[2], COL3: KEY[1], ID: KEY[4]]) | MAP (_.COL3 AS COL3, _.COL2 AS COL2) -digraph G { +agg-index-testsDEXPLAIN select col3, col2 from t2 where col1 = 1 order by col3 desc; + q (608@COVERING(MV9 [EQUALS promote(@c10 AS LONG)] REVERSE -> [COL1: KEY[0], COL2: KEY[2], COL3: KEY[1], ID: KEY[4]]) | MAP (_.COL3 AS COL3, _.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q84.COL3 AS COL3, q84.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL3, )" ]; - 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c10 AS LONG)]
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index
    MV9
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q86.COL3 AS COL3, q86.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL3, LONG AS COL2)" ]; + 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c10 AS LONG)]
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 3 [ label=<
    Index
    MV9
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q84> label="q84" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q86> label="q86" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}  -agg-index-testsqEXPLAIN select col3, sum(col2) as s from t2 use index (mv9) where col1 = 1 group by col1, col3 order by col3 asc; - T (0ɏ -8@ISCAN(MV9 [EQUALS promote(@c20 AS LONG)]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0, _._0.COL3 AS _1) | MAP (_._0._1 AS COL3, _._1._0 AS S)digraph G { +agg-index-testsqEXPLAIN select col3, sum(col2) as s from t2 use index (mv9) where col1 = 1 group by col1, col3 order by col3 asc; +X Ų(08@ISCAN(MV9 [EQUALS promote(@c20 AS LONG)]) | MAP (_ AS _0) | AGG (sum_l(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0, _._0.COL3 AS _1) | MAP (_._0._1 AS COL3, _._1._0 AS S)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._0._1 AS COL3, q6._1._0 AS S)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL3, )" ]; - 2 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q85._0.COL2) AS _0)
    GROUP BY (q85._0.COL1 AS _0, q85._0.COL3 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, AS _0, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 4 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c20 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index
    MV9
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q85> label="q85" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 1 [ label=<
    Value Computation
    MAP (q6._0._1 AS COL3, q6._1._0 AS S)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL3, LONG AS S)" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q86._0.COL2) AS _0)
    GROUP BY (q86._0.COL1 AS _0, q86._0.COL3 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1 AS _0, LONG AS _0 AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3 AS _0)" ]; + 4 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c20 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 5 [ label=<
    Index
    MV9
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 3 -> 2 [ label=< q86> label="q86" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +}  -agg-index-testsrEXPLAIN select col3, sum(col2) as s from t2 use index (mv9) where col1 = 1 group by col1, col3 order by col3 desc; - -T (0 8@ISCAN(MV9 [EQUALS promote(@c20 AS LONG)] REVERSE) | MAP (_ AS _0) | AGG (sum_l(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0, _._0.COL3 AS _1) | MAP (_._0._1 AS COL3, _._1._0 AS S)digraph G { +agg-index-testsrEXPLAIN select col3, sum(col2) as s from t2 use index (mv9) where col1 = 1 group by col1, col3 order by col3 desc; + X (08@ISCAN(MV9 [EQUALS promote(@c20 AS LONG)] REVERSE) | MAP (_ AS _0) | AGG (sum_l(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0, _._0.COL3 AS _1) | MAP (_._0._1 AS COL3, _._1._0 AS S)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._0._1 AS COL3, q6._1._0 AS S)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL3, )" ]; - 2 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q85._0.COL2) AS _0)
    GROUP BY (q85._0.COL1 AS _0, q85._0.COL3 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, AS _0, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 4 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c20 AS LONG)]
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index
    MV9
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q85> label="q85" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 1 [ label=<
    Value Computation
    MAP (q6._0._1 AS COL3, q6._1._0 AS S)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL3, LONG AS S)" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q86._0.COL2) AS _0)
    GROUP BY (q86._0.COL1 AS _0, q86._0.COL3 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1 AS _0, LONG AS _0 AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3 AS _0)" ]; + 4 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c20 AS LONG)]
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 5 [ label=<
    Index
    MV9
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 3 -> 2 [ label=< q86> label="q86" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} H -agg-index-tests5EXPLAIN select max(col3) from t2 group by col1, col3; -г j π(80'8%@ISCAN(MV3 <,>) | MAP (_ AS _0) | AGG (max_l(_._0.COL3) AS _0) GROUP BY (_._0.COL1 AS _0, _._0.COL3 AS _1) | MAP (_._1._0 AS _0)digraph G { +agg-index-tests5EXPLAIN select max(col3) from t2 group by col1, col3; + n (80ۅ'8%@ISCAN(MV3 <,>) | MAP (_ AS _0) | AGG (max_l(_._0.COL3) AS _0) GROUP BY (_._0.COL1 AS _0, _._0.COL3 AS _1) | MAP (_._1._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Streaming Aggregate
    COLLECT (max_l(q105._0.COL3) AS _0)
    GROUP BY (q105._0.COL1 AS _0, q105._0.COL3 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, AS _0, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index
    MV3
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q105> label="q105" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT (max_l(q111._0.COL3) AS _0)
    GROUP BY (q111._0.COL1 AS _0, q111._0.COL3 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1 AS _0, LONG AS _0 AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3 AS _0)" ]; + 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 5 [ label=<
    Index
    MV3
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 3 -> 2 [ label=< q111> label="q111" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} 8 -agg-index-tests%EXPLAIN select min_ever(col3) from t2 - ќ (C0L8>@ aAISCAN(MV7 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +agg-index-tests%EXPLAIN select min_ever(col3) from t2 + (C0G8>@ aAISCAN(MV7 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; @@ -414,296 +406,290 @@ H 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Value Computation
    MAP (q4 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 5 [ label=<
    Index
    MV7
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 5 [ label=<
    Index
    MV7
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q4> label="q4" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} M -agg-index-tests:EXPLAIN select col1, max_ever(col2) from T1 group by col1; - ܑ (H0F85@YAISCAN(MV6 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._0 AS COL1, _._1 AS _1) +agg-index-tests:EXPLAIN select col1, max_ever(col2) from T1 group by col1; + ߙ +(H0+85@YAISCAN(MV6 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._0 AS COL1, _._1 AS _1) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL1, q6._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV6
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL1, q6._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, LONG AS _1)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    MV6
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} M -agg-index-tests:EXPLAIN select col1, min_ever(col2) from T1 group by col1; -̳ (>0,8*@ZAISCAN(MV12 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._0 AS COL1, _._1 AS _1) +agg-index-tests:EXPLAIN select col1, min_ever(col2) from T1 group by col1; + (>0(8*@ZAISCAN(MV12 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._0 AS COL1, _._1 AS _1) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL1, q6._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV12
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL1, q6._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, LONG AS _1)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    MV12
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} M -agg-index-tests:EXPLAIN select col2, max_ever(col1) from T4 group by col2; -e ( 0؍8@ZAISCAN(MV15 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._0 AS COL2, _._1 AS _1) +agg-index-tests:EXPLAIN select col2, max_ever(col1) from T4 group by col2; + +l ڥ( 08@ZAISCAN(MV15 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._0 AS COL2, _._1 AS _1) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL2, q6._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL2, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV15
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL2, q6._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL2, STRING AS _1)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, STRING AS _1)" ]; + 3 [ label=<
    Index
    MV15
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} M -agg-index-tests:EXPLAIN select col2, min_ever(col1) from T4 group by col2; -缢 e 䮨( 08@ZAISCAN(MV14 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._0 AS COL2, _._1 AS _1) +agg-index-tests:EXPLAIN select col2, min_ever(col1) from T4 group by col2; +я +l ( 08@ZAISCAN(MV14 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._0 AS COL2, _._1 AS _1) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL2, q6._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL2, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV14
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL2, q6._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL2, STRING AS _1)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, STRING AS _1)" ]; + 3 [ label=<
    Index
    MV14
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} X -agg-index-testsEEXPLAIN select col1, sum(col2) from T1 where col1 > 15 group by col1; - (H048D@|AISCAN(MV1 [[GREATER_THAN promote(@c13 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._0 AS COL1, _._1 AS _1) +agg-index-testsEEXPLAIN select col1, sum(col2) from T1 where col1 > 15 group by col1; + (H0=8D@|AISCAN(MV1 [[GREATER_THAN promote(@c13 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._0 AS COL1, _._1 AS _1) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL1, q6._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[GREATER_THAN promote(@c13 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL1, q6._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, LONG AS _1)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[GREATER_THAN promote(@c13 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    MV1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} R -agg-index-tests?EXPLAIN select sum(col2) from T1 where col1 = 10 group by col1 - ɩ (H0L8D@fAISCAN(MV1 [EQUALS promote(@c11 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) +agg-index-tests?EXPLAIN select sum(col2) from T1 where col1 = 10 group by col1 + (H0<8D@fAISCAN(MV1 [EQUALS promote(@c11 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c11 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    MV1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} c -agg-index-testsPEXPLAIN select sum(col2) from T1 where col1 <= 10 group by col1 having col1 > 0; - (H0J8E@AISCAN(MV1 [[GREATER_THAN promote(@c19 AS LONG) && LESS_THAN_OR_EQUALS promote(@c12 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) -digraph G { +agg-index-testsPEXPLAIN select sum(col2) from T1 where col1 <= 10 group by col1 having col1 > 0; + (H0>8E@AISCAN(MV1 [[GREATER_THAN promote(@c19 AS LONG) && LESS_THAN_OR_EQUALS promote(@c12 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0) digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[GREATER_THAN promote(@c19 AS LONG) && LESS_THAN_OR_EQUALS promote(@c12 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[GREATER_THAN promote(@c19 AS LONG) && LESS_THAN_OR_EQUALS promote(@c12 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    MV1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} O -agg-index-tests BY_GROUP -> [_0: KEY:[0], _1: KEY:[1]]) | MAP (_._1 AS X1, _._0 AS X2) +agg-index-tests BY_GROUP -> [_0: KEY:[0], _1: KEY:[1]]) | MAP (_._1 AS X1, _._0 AS X2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._1 AS X1, q6._0 AS X2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X1, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV10
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._1 AS X1, q6._0 AS X2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X1, LONG AS X2)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    MV10
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, LONG AS B)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} O -agg-index-tests BY_GROUP -> [_0: KEY:[0], _1: KEY:[1]]) | MAP (_._0 AS X1, _._1 AS X2) +agg-index-tests BY_GROUP -> [_0: KEY:[0], _1: KEY:[1]]) | MAP (_._0 AS X1, _._1 AS X2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._0 AS X1, q6._1 AS X2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X1, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV10
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._0 AS X1, q6._1 AS X2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X1, LONG AS X2)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    MV10
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, LONG AS B)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} U -agg-index-testsBEXPLAIN select a+b as x1, min(b) as x2 from t3 group by a+b, b+10; -w ظ (/08!@cAISCAN(MV11 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[2]]) | MAP (_._0 AS X1, _._2 AS X2) +agg-index-testsBEXPLAIN select a+b as x1, min(b) as x2 from t3 group by a+b, b+10; +~ (/08!@cAISCAN(MV11 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[2]]) | MAP (_._0 AS X1, _._2 AS X2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._0 AS X1, q6._2 AS X2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X1, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV11
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._0 AS X1, q6._2 AS X2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X1, LONG AS X2)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2)" ]; + 3 [ label=<
    Index
    MV11
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, LONG AS B)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} X -agg-index-testsEEXPLAIN select M as x1, min(b) as x2 from t3 group by a+b as M, b+10; -w (/0"8!@cAISCAN(MV11 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[2]]) | MAP (_._0 AS X1, _._2 AS X2) +agg-index-testsEEXPLAIN select M as x1, min(b) as x2 from t3 group by a+b as M, b+10; +~ (/08!@cAISCAN(MV11 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[2]]) | MAP (_._0 AS X1, _._2 AS X2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._0 AS X1, q6._2 AS X2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X1, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV11
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._0 AS X1, q6._2 AS X2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X1, LONG AS X2)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2)" ]; + 3 [ label=<
    Index
    MV11
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, LONG AS B)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} ] -agg-index-testsJEXPLAIN select M as x1, min(b) as x2 from t3 group by a+b as M, b+10 as N; -w (/0"8!@cAISCAN(MV11 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[2]]) | MAP (_._0 AS X1, _._2 AS X2) +agg-index-testsJEXPLAIN select M as x1, min(b) as x2 from t3 group by a+b as M, b+10 as N; +޻~ շ (/08!@cAISCAN(MV11 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[2]]) | MAP (_._0 AS X1, _._2 AS X2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._0 AS X1, q6._2 AS X2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X1, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV11
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._0 AS X1, q6._2 AS X2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X1, LONG AS X2)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2)" ]; + 3 [ label=<
    Index
    MV11
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, LONG AS B)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} c -agg-index-testsPEXPLAIN select max(b) as x1, a+3 as x2 from t3 where a + 3 < 10000 group by a+3; -  ɰ(20Ү8'@vAISCAN(MV10 [[LESS_THAN promote(@c21 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1]]) | MAP (_._1 AS X1, _._0 AS X2) +agg-index-testsPEXPLAIN select max(b) as x1, a+3 as x2 from t3 where a + 3 < 10000 group by a+3; + (208'@vAISCAN(MV10 [[LESS_THAN promote(@c21 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1]]) | MAP (_._1 AS X1, _._0 AS X2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._1 AS X1, q6._0 AS X2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X1, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[LESS_THAN promote(@c21 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV10
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._1 AS X1, q6._0 AS X2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X1, LONG AS X2)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[LESS_THAN promote(@c21 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 3 [ label=<
    Index
    MV10
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, LONG AS B)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} { -agg-index-testshEXPLAIN select b, c, d, e, max(x) from t5 where a = 0 group by a, b, c, d, e order by b, max(x), c, d, e -! (E08@AISCAN(MV16 [EQUALS promote(@c19 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) -digraph G { +agg-index-testshEXPLAIN select b, c, d, e, max(x) from t5 where a = 0 group by a, b, c, d, e order by b, max(x), c, d, e +˺G =(E0؟8@AISCAN(MV16 [EQUALS promote(@c19 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV16
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, STRING AS _1, LONG AS _2, LONG AS _3, STRING AS _4, LONG AS _5)" ]; + 3 [ label=<
    Index
    MV16
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS X)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} r -agg-index-tests_EXPLAIN select b, c, d, e, max(x) from t5 where a = 0 group by a, b, c, d, e order by b, max(x) -! (E08@AISCAN(MV16 [EQUALS promote(@c19 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) -digraph G { +agg-index-tests_EXPLAIN select b, c, d, e, max(x) from t5 where a = 0 group by a, b, c, d, e order by b, max(x) +: 1(E08@AISCAN(MV16 [EQUALS promote(@c19 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV16
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, STRING AS _1, LONG AS _2, LONG AS _3, STRING AS _4, LONG AS _5)" ]; + 3 [ label=<
    Index
    MV16
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS X)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} { -agg-index-testshEXPLAIN select b, c, d, e, min(x) from t5 where a = 0 group by a, b, c, d, e order by b, min(x), c, d, e -% (E08@AISCAN(MV17 [EQUALS promote(@c19 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) -digraph G { +agg-index-testshEXPLAIN select b, c, d, e, min(x) from t5 where a = 0 group by a, b, c, d, e order by b, min(x), c, d, e +̢B 9(E08@AISCAN(MV17 [EQUALS promote(@c19 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV17
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, STRING AS _1, LONG AS _2, LONG AS _3, STRING AS _4, LONG AS _5)" ]; + 3 [ label=<
    Index
    MV17
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS X)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} r -agg-index-tests_EXPLAIN select b, c, d, e, min(x) from t5 where a = 0 group by a, b, c, d, e order by b, min(x) - ʧ(E08@AISCAN(MV17 [EQUALS promote(@c19 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) -digraph G { +agg-index-tests_EXPLAIN select b, c, d, e, min(x) from t5 where a = 0 group by a, b, c, d, e order by b, min(x) +; 2(E08@AISCAN(MV17 [EQUALS promote(@c19 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV17
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, STRING AS _1, LONG AS _2, LONG AS _3, STRING AS _4, LONG AS _5)" ]; + 3 [ label=<
    Index
    MV17
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS X)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} { -agg-index-testshEXPLAIN select b, c, d, e, max(x) from t5 where a = 0 group by a, b, c, d, e order by b, c, max(x), d, e -# (E08@AISCAN(MV18 [EQUALS promote(@c19 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[2], _3: KEY:[4], _4: KEY:[5], _5: KEY:[3]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) -digraph G { +agg-index-testshEXPLAIN select b, c, d, e, max(x) from t5 where a = 0 group by a, b, c, d, e order by b, c, max(x), d, e +˞F <(E08@AISCAN(MV18 [EQUALS promote(@c19 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[2], _3: KEY:[4], _4: KEY:[5], _5: KEY:[3]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV18
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, STRING AS _1, LONG AS _2, LONG AS _3, STRING AS _4, LONG AS _5)" ]; + 3 [ label=<
    Index
    MV18
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS X)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} u -agg-index-testsbEXPLAIN select b, c, d, e, max(x) from t5 where a = 0 group by a, b, c, d, e order by b, c, max(x) -# (E08@AISCAN(MV18 [EQUALS promote(@c19 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[2], _3: KEY:[4], _4: KEY:[5], _5: KEY:[3]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) -digraph G { +agg-index-testsbEXPLAIN select b, c, d, e, max(x) from t5 where a = 0 group by a, b, c, d, e order by b, c, max(x) +< 3(E08@AISCAN(MV18 [EQUALS promote(@c19 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[2], _3: KEY:[4], _4: KEY:[5], _5: KEY:[3]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV18
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, STRING AS _1, LONG AS _2, LONG AS _3, STRING AS _4, LONG AS _5)" ]; + 3 [ label=<
    Index
    MV18
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS X)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} { -agg-index-testshEXPLAIN select b, c, d, e, min(x) from t5 where a = 0 group by a, b, c, d, e order by b, c, min(x), d, e -& ܺ(E08@AISCAN(MV19 [EQUALS promote(@c19 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[2], _3: KEY:[4], _4: KEY:[5], _5: KEY:[3]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) -digraph G { +agg-index-testshEXPLAIN select b, c, d, e, min(x) from t5 where a = 0 group by a, b, c, d, e order by b, c, min(x), d, e +9 Ց2(E08@AISCAN(MV19 [EQUALS promote(@c19 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[2], _3: KEY:[4], _4: KEY:[5], _5: KEY:[3]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV19
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, STRING AS _1, LONG AS _2, LONG AS _3, STRING AS _4, LONG AS _5)" ]; + 3 [ label=<
    Index
    MV19
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS X)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} u -agg-index-testsbEXPLAIN select b, c, d, e, min(x) from t5 where a = 0 group by a, b, c, d, e order by b, c, min(x) - (E08@AISCAN(MV19 [EQUALS promote(@c19 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[2], _3: KEY:[4], _4: KEY:[5], _5: KEY:[3]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) -digraph G { +agg-index-testsbEXPLAIN select b, c, d, e, min(x) from t5 where a = 0 group by a, b, c, d, e order by b, c, min(x) +> 5(E08@AISCAN(MV19 [EQUALS promote(@c19 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[2], _3: KEY:[4], _4: KEY:[5], _5: KEY:[3]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    MV19
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, STRING AS _1, LONG AS _2, LONG AS _3, STRING AS _4, LONG AS _5)" ]; + 3 [ label=<
    Index
    MV19
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS X)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +}  -agg-index-testszEXPLAIN select b, c, d, e, max(x) from t5 where a = 0 group by a, b, c, d, e having b IN ('foo', 'bar') order by max(x), c -ԃ1 ׽(U0ɷB8'@[IN @c34] INUNION q0 -> { AISCAN(MV16 [EQUALS promote(@c19 AS LONG), EQUALS q0] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) } COMPARE BY (_._4, _.C, _.B, _.D, _.E)digraph G { +agg-index-testszEXPLAIN select b, c, d, e, max(x) from t5 where a = 0 group by a, b, c, d, e having b IN ('foo', 'bar') order by max(x), c +ߪi Z(U0"8'@[IN @c34] INUNION q0 -> { AISCAN(MV16 [EQUALS promote(@c19 AS LONG), EQUALS q0] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) } COMPARE BY (_._4, _.C, _.B, _.D, _.E)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    In Union
    COMPARE BY (_._4, _.C, _.B, _.D, _.E)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 2 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 3 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG), EQUALS q87]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 4 [ label=<
    Index
    MV16
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Values
    VALUES([__corr_q87 IN @c34]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; + 1 [ label=<
    In Union
    COMPARE BY (_._4, _.C, _.B, _.D, _.E)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 2 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 3 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG), EQUALS q87]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, STRING AS _1, LONG AS _2, LONG AS _3, STRING AS _4, LONG AS _5)" ]; + 4 [ label=<
    Index
    MV16
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS X)" ]; + 5 [ label=<
    Values
    VALUES([__corr_q87 IN @c34]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 1 [ color="black" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; @@ -713,18 +699,18 @@ digraph G { rankDir=LR; 5 -> 2 [ color="red" style="invis" ]; } -} +}  -agg-index-testszEXPLAIN select b, c, d, e, min(x) from t5 where a = 0 group by a, b, c, d, e having b IN ('foo', 'bar') order by min(x), c -2 (U0(8'@[IN @c34] INUNION q0 -> { AISCAN(MV17 [EQUALS promote(@c19 AS LONG), EQUALS q0] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) } COMPARE BY (_._4, _.C, _.B, _.D, _.E)digraph G { +agg-index-testszEXPLAIN select b, c, d, e, min(x) from t5 where a = 0 group by a, b, c, d, e having b IN ('foo', 'bar') order by min(x), c +n Ƀ^(U078'@[IN @c34] INUNION q0 -> { AISCAN(MV17 [EQUALS promote(@c19 AS LONG), EQUALS q0] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) } COMPARE BY (_._4, _.C, _.B, _.D, _.E)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    In Union
    COMPARE BY (_._4, _.C, _.B, _.D, _.E)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 2 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 3 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG), EQUALS q87]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 4 [ label=<
    Index
    MV17
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Values
    VALUES([__corr_q87 IN @c34]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; + 1 [ label=<
    In Union
    COMPARE BY (_._4, _.C, _.B, _.D, _.E)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 2 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 3 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG), EQUALS q87]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, STRING AS _1, LONG AS _2, LONG AS _3, STRING AS _4, LONG AS _5)" ]; + 4 [ label=<
    Index
    MV17
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS X)" ]; + 5 [ label=<
    Values
    VALUES([__corr_q87 IN @c34]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 1 [ color="black" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; @@ -734,19 +720,19 @@ digraph G { rankDir=LR; 5 -> 2 [ color="red" style="invis" ]; } -} +}  -agg-index-testsEXPLAIN select b, c, d, e, max(x) from t5 where a = 0 group by a, b, c, d, e having b IN ('foo', 'bar') and d = 1 order by max(x), c -A $(\0<83@[IN @c34] INUNION q0 -> { AISCAN(MV16 [EQUALS promote(@c19 AS LONG), EQUALS q0] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | FILTER _._3 EQUALS promote(@c42 AS LONG) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) } COMPARE BY (_._4, _.C, _.B, _.D, _.E)digraph G { +agg-index-testsEXPLAIN select b, c, d, e, max(x) from t5 where a = 0 group by a, b, c, d, e having b IN ('foo', 'bar') and d = 1 order by max(x), c +v ^(\0/83@[IN @c34] INUNION q0 -> { AISCAN(MV16 [EQUALS promote(@c19 AS LONG), EQUALS q0] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | FILTER _._3 EQUALS promote(@c42 AS LONG) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) } COMPARE BY (_._4, _.C, _.B, _.D, _.E)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    In Union
    COMPARE BY (_._4, _.C, _.B, _.D, _.E)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 2 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 3 [ label=<
    Predicate Filter
    WHERE q6._3 EQUALS promote(@c42 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG), EQUALS q87]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 5 [ label=<
    Index
    MV16
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Values
    VALUES([__corr_q87 IN @c34]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; + 1 [ label=<
    In Union
    COMPARE BY (_._4, _.C, _.B, _.D, _.E)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 2 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 3 [ label=<
    Predicate Filter
    WHERE q6._3 EQUALS promote(@c42 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, STRING AS _1, LONG AS _2, LONG AS _3, STRING AS _4, LONG AS _5)" ]; + 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG), EQUALS q87]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, STRING AS _1, LONG AS _2, LONG AS _3, STRING AS _4, LONG AS _5)" ]; + 5 [ label=<
    Index
    MV16
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS X)" ]; + 6 [ label=<
    Values
    VALUES([__corr_q87 IN @c34]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; @@ -757,19 +743,19 @@ digraph G { rankDir=LR; 6 -> 2 [ color="red" style="invis" ]; } -} +}  -agg-index-testsEXPLAIN select b, c, d, e, min(x) from t5 where a = 0 group by a, b, c, d, e having b IN ('foo', 'bar') and d = 1 order by min(x), c -; (\0583@[IN @c34] INUNION q0 -> { AISCAN(MV17 [EQUALS promote(@c19 AS LONG), EQUALS q0] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | FILTER _._3 EQUALS promote(@c42 AS LONG) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) } COMPARE BY (_._4, _.C, _.B, _.D, _.E)digraph G { +agg-index-testsEXPLAIN select b, c, d, e, min(x) from t5 where a = 0 group by a, b, c, d, e having b IN ('foo', 'bar') and d = 1 order by min(x), c +k ˍV(\0+83@[IN @c34] INUNION q0 -> { AISCAN(MV17 [EQUALS promote(@c19 AS LONG), EQUALS q0] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | FILTER _._3 EQUALS promote(@c42 AS LONG) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) } COMPARE BY (_._4, _.C, _.B, _.D, _.E)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    In Union
    COMPARE BY (_._4, _.C, _.B, _.D, _.E)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 2 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 3 [ label=<
    Predicate Filter
    WHERE q6._3 EQUALS promote(@c42 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG), EQUALS q87]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 5 [ label=<
    Index
    MV17
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Values
    VALUES([__corr_q87 IN @c34]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; + 1 [ label=<
    In Union
    COMPARE BY (_._4, _.C, _.B, _.D, _.E)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 2 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 3 [ label=<
    Predicate Filter
    WHERE q6._3 EQUALS promote(@c42 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, STRING AS _1, LONG AS _2, LONG AS _3, STRING AS _4, LONG AS _5)" ]; + 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG), EQUALS q87]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, STRING AS _1, LONG AS _2, LONG AS _3, STRING AS _4, LONG AS _5)" ]; + 5 [ label=<
    Index
    MV17
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS X)" ]; + 6 [ label=<
    Values
    VALUES([__corr_q87 IN @c34]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; @@ -780,24 +766,24 @@ digraph G { rankDir=LR; 6 -> 2 [ color="red" style="invis" ]; } -}" +}%  -agg-index-testsEXPLAIN select b, c, d, e, max(x) from t5 where a = 0 group by a, b, c, d, e having b IN ('foo', 'bar') and d IN (1, 2) order by max(x), c - ߱,(0ݏ 8@[IN @c34] INUNION q0 -> { [IN promote(@c42 AS ARRAY(LONG))] INUNION q1 -> { AISCAN(MV16 [EQUALS promote(@c19 AS LONG), EQUALS q0] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | FILTER _._3 EQUALS q1 | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) } COMPARE BY (_._4, _.C, _.D, _.E) } COMPARE BY (_._4, _.C, _.B, _.E)digraph G { +agg-index-testsEXPLAIN select b, c, d, e, max(x) from t5 where a = 0 group by a, b, c, d, e having b IN ('foo', 'bar') and d IN (1, 2) order by max(x), c$ + |(0 8@[IN @c34] INUNION q0 -> { [IN promote(@c42 AS ARRAY(LONG))] INUNION q1 -> { AISCAN(MV16 [EQUALS promote(@c19 AS LONG), EQUALS q0] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | FILTER _._3 EQUALS q1 | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) } COMPARE BY (_._4, _.C, _.D, _.E) } COMPARE BY (_._4, _.C, _.B, _.E) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    In Union
    COMPARE BY (_._4, _.C, _.B, _.E)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 2 [ label=<
    In Union
    COMPARE BY (_._4, _.C, _.D, _.E)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 3 [ label=<
    Values
    VALUES([__corr_q89 IN promote(@c42 AS ARRAY(LONG))]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 4 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 5 [ label=<
    Predicate Filter
    WHERE q6._3 EQUALS q89
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 6 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG), EQUALS q87]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 7 [ label=<
    Index
    MV16
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 8 [ label=<
    Values
    VALUES([__corr_q87 IN @c34]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; + 1 [ label=<
    In Union
    COMPARE BY (_._4, _.C, _.B, _.E)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 2 [ label=<
    In Union
    COMPARE BY (_._4, _.C, _.D, _.E)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 3 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 4 [ label=<
    Values
    VALUES([__corr_q89 IN promote(@c42 AS ARRAY(LONG))]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 5 [ label=<
    Predicate Filter
    WHERE q6._3 EQUALS q89
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, STRING AS _1, LONG AS _2, LONG AS _3, STRING AS _4, LONG AS _5)" ]; + 6 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG), EQUALS q87]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, STRING AS _1, LONG AS _2, LONG AS _3, STRING AS _4, LONG AS _5)" ]; + 7 [ label=<
    Index
    MV16
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS X)" ]; + 8 [ label=<
    Values
    VALUES([__corr_q87 IN @c34]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; 3 -> 2 [ color="black" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 2 [ color="black" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 3 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 1 [ color="black" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; @@ -805,28 +791,28 @@ digraph G { { rank=same; rankDir=LR; - 3 -> 4 [ color="red" style="invis" ]; + 4 -> 3 [ color="red" style="invis" ]; } { rank=same; rankDir=LR; 8 -> 2 [ color="red" style="invis" ]; } -}" +}%  -agg-index-testsEXPLAIN select b, c, d, e, min(x) from t5 where a = 0 group by a, b, c, d, e having b IN ('foo', 'bar') and d IN (1, 2) order by min(x), c -< ݶ(0ˑ8@[IN @c34] INUNION q0 -> { [IN promote(@c42 AS ARRAY(LONG))] INUNION q1 -> { AISCAN(MV17 [EQUALS promote(@c19 AS LONG), EQUALS q0] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | FILTER _._3 EQUALS q1 | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) } COMPARE BY (_._4, _.C, _.D, _.E) } COMPARE BY (_._4, _.C, _.B, _.E)digraph G { +agg-index-testsEXPLAIN select b, c, d, e, min(x) from t5 where a = 0 group by a, b, c, d, e having b IN ('foo', 'bar') and d IN (1, 2) order by min(x), c$ + ϒ(0 8@[IN @c34] INUNION q0 -> { [IN promote(@c42 AS ARRAY(LONG))] INUNION q1 -> { AISCAN(MV17 [EQUALS promote(@c19 AS LONG), EQUALS q0] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | FILTER _._3 EQUALS q1 | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) } COMPARE BY (_._4, _.C, _.D, _.E) } COMPARE BY (_._4, _.C, _.B, _.E) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    In Union
    COMPARE BY (_._4, _.C, _.B, _.E)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 2 [ label=<
    In Union
    COMPARE BY (_._4, _.C, _.D, _.E)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 3 [ label=<
    Values
    VALUES([__corr_q89 IN promote(@c42 AS ARRAY(LONG))]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 4 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 5 [ label=<
    Predicate Filter
    WHERE q6._3 EQUALS q89
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 6 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG), EQUALS q87]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 7 [ label=<
    Index
    MV17
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 8 [ label=<
    Values
    VALUES([__corr_q87 IN @c34]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; + 1 [ label=<
    In Union
    COMPARE BY (_._4, _.C, _.B, _.E)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 2 [ label=<
    In Union
    COMPARE BY (_._4, _.C, _.D, _.E)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 3 [ label=<
    Values
    VALUES([__corr_q89 IN promote(@c42 AS ARRAY(LONG))]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 4 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 5 [ label=<
    Predicate Filter
    WHERE q6._3 EQUALS q89
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, STRING AS _1, LONG AS _2, LONG AS _3, STRING AS _4, LONG AS _5)" ]; + 6 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG), EQUALS q87]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, STRING AS _1, LONG AS _2, LONG AS _3, STRING AS _4, LONG AS _5)" ]; + 7 [ label=<
    Index
    MV17
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS X)" ]; + 8 [ label=<
    Values
    VALUES([__corr_q87 IN @c34]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; 3 -> 2 [ color="black" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 2 [ color="black" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; @@ -844,21 +830,21 @@ digraph G { rankDir=LR; 3 -> 4 [ color="red" style="invis" ]; } -}" +}%  -agg-index-testsEXPLAIN select b, c, d, e, max(x) from t5 where a = 0 group by a, b, c, d, e having b IN ('foo', 'bar') and d IN (1, 2) order by max(x), c, e -q ۆ-(08@[IN @c34] INUNION q0 -> { [IN promote(@c42 AS ARRAY(LONG))] INUNION q1 -> { AISCAN(MV16 [EQUALS promote(@c19 AS LONG), EQUALS q0] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | FILTER _._3 EQUALS q1 | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) } COMPARE BY (_._4, _.C, _.E, _.D) } COMPARE BY (_._4, _.C, _.E, _.B)digraph G { +agg-index-testsEXPLAIN select b, c, d, e, max(x) from t5 where a = 0 group by a, b, c, d, e having b IN ('foo', 'bar') and d IN (1, 2) order by max(x), c, e$ +ʭ (0 8@[IN @c34] INUNION q0 -> { [IN promote(@c42 AS ARRAY(LONG))] INUNION q1 -> { AISCAN(MV16 [EQUALS promote(@c19 AS LONG), EQUALS q0] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | FILTER _._3 EQUALS q1 | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) } COMPARE BY (_._4, _.C, _.E, _.D) } COMPARE BY (_._4, _.C, _.E, _.B) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    In Union
    COMPARE BY (_._4, _.C, _.E, _.B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 2 [ label=<
    In Union
    COMPARE BY (_._4, _.C, _.E, _.D)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 3 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 4 [ label=<
    Values
    VALUES([__corr_q89 IN promote(@c42 AS ARRAY(LONG))]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 5 [ label=<
    Predicate Filter
    WHERE q6._3 EQUALS q89
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 6 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG), EQUALS q87]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 7 [ label=<
    Index
    MV16
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 8 [ label=<
    Values
    VALUES([__corr_q87 IN @c34]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; + 1 [ label=<
    In Union
    COMPARE BY (_._4, _.C, _.E, _.B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 2 [ label=<
    In Union
    COMPARE BY (_._4, _.C, _.E, _.D)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 3 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 4 [ label=<
    Values
    VALUES([__corr_q89 IN promote(@c42 AS ARRAY(LONG))]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 5 [ label=<
    Predicate Filter
    WHERE q6._3 EQUALS q89
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, STRING AS _1, LONG AS _2, LONG AS _3, STRING AS _4, LONG AS _5)" ]; + 6 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG), EQUALS q87]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, STRING AS _1, LONG AS _2, LONG AS _3, STRING AS _4, LONG AS _5)" ]; + 7 [ label=<
    Index
    MV16
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS X)" ]; + 8 [ label=<
    Values
    VALUES([__corr_q87 IN @c34]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; 3 -> 2 [ color="black" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 2 [ color="black" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 3 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; @@ -876,24 +862,24 @@ digraph G { rankDir=LR; 8 -> 2 [ color="red" style="invis" ]; } -}" +}%  -agg-index-testsEXPLAIN select b, c, d, e, min(x) from t5 where a = 0 group by a, b, c, d, e having b IN ('foo', 'bar') and d IN (1, 2) order by min(x), c, e -5 Ũ(0ے8@[IN @c34] INUNION q0 -> { [IN promote(@c42 AS ARRAY(LONG))] INUNION q1 -> { AISCAN(MV17 [EQUALS promote(@c19 AS LONG), EQUALS q0] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | FILTER _._3 EQUALS q1 | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) } COMPARE BY (_._4, _.C, _.E, _.D) } COMPARE BY (_._4, _.C, _.E, _.B)digraph G { +agg-index-testsEXPLAIN select b, c, d, e, min(x) from t5 where a = 0 group by a, b, c, d, e having b IN ('foo', 'bar') and d IN (1, 2) order by min(x), c, e$ + Ӓ(0 8@[IN @c34] INUNION q0 -> { [IN promote(@c42 AS ARRAY(LONG))] INUNION q1 -> { AISCAN(MV17 [EQUALS promote(@c19 AS LONG), EQUALS q0] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | FILTER _._3 EQUALS q1 | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) } COMPARE BY (_._4, _.C, _.E, _.D) } COMPARE BY (_._4, _.C, _.E, _.B) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    In Union
    COMPARE BY (_._4, _.C, _.E, _.B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 2 [ label=<
    In Union
    COMPARE BY (_._4, _.C, _.E, _.D)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 3 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 4 [ label=<
    Values
    VALUES([__corr_q89 IN promote(@c42 AS ARRAY(LONG))]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 5 [ label=<
    Predicate Filter
    WHERE q6._3 EQUALS q89
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 6 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG), EQUALS q87]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 7 [ label=<
    Index
    MV17
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 8 [ label=<
    Values
    VALUES([__corr_q87 IN @c34]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; + 1 [ label=<
    In Union
    COMPARE BY (_._4, _.C, _.E, _.B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 2 [ label=<
    In Union
    COMPARE BY (_._4, _.C, _.E, _.D)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 3 [ label=<
    Values
    VALUES([__corr_q89 IN promote(@c42 AS ARRAY(LONG))]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 4 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 5 [ label=<
    Predicate Filter
    WHERE q6._3 EQUALS q89
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, STRING AS _1, LONG AS _2, LONG AS _3, STRING AS _4, LONG AS _5)" ]; + 6 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG), EQUALS q87]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, STRING AS _1, LONG AS _2, LONG AS _3, STRING AS _4, LONG AS _5)" ]; + 7 [ label=<
    Index
    MV17
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS X)" ]; + 8 [ label=<
    Values
    VALUES([__corr_q87 IN @c34]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; 3 -> 2 [ color="black" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 2 [ color="black" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 3 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 1 [ color="black" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; @@ -901,25 +887,25 @@ digraph G { { rank=same; rankDir=LR; - 4 -> 3 [ color="red" style="invis" ]; + 3 -> 4 [ color="red" style="invis" ]; } { rank=same; rankDir=LR; 8 -> 2 [ color="red" style="invis" ]; } -} +}  -agg-index-testsEXPLAIN select b, c, d, e, max(x) from t5 where a = 0 and c = 0 group by a, b, c, d, e having b IN ('foo', 'bar') order by max(x), d -= "([0680@[IN @c38] INUNION q0 -> { AISCAN(MV18 [EQUALS promote(@c19 AS LONG), EQUALS q0, EQUALS promote(@c19 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[2], _3: KEY:[4], _4: KEY:[5], _5: KEY:[3]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) } COMPARE BY (_._4, _.D, _.B, _.C, _.E)digraph G { +agg-index-testsEXPLAIN select b, c, d, e, max(x) from t5 where a = 0 and c = 0 group by a, b, c, d, e having b IN ('foo', 'bar') order by max(x), d +Ս~ c(]0385@[IN @c38] INUNION q0 -> { AISCAN(MV18 [EQUALS promote(@c19 AS LONG), EQUALS q0, EQUALS promote(@c19 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[2], _3: KEY:[4], _4: KEY:[5], _5: KEY:[3]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) } COMPARE BY (_._4, _.D, _.B, _.C, _.E)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    In Union
    COMPARE BY (_._4, _.D, _.B, _.C, _.E)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 2 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 3 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG), EQUALS q87, EQUALS promote(@c19 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 4 [ label=<
    Index
    MV18
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Values
    VALUES([__corr_q87 IN @c38]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; + 1 [ label=<
    In Union
    COMPARE BY (_._4, _.D, _.B, _.C, _.E)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 2 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 3 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG), EQUALS q87, EQUALS promote(@c19 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, STRING AS _1, LONG AS _2, LONG AS _3, STRING AS _4, LONG AS _5)" ]; + 4 [ label=<
    Index
    MV18
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS X)" ]; + 5 [ label=<
    Values
    VALUES([__corr_q87 IN @c38]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 1 [ color="black" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; @@ -929,18 +915,18 @@ digraph G { rankDir=LR; 5 -> 2 [ color="red" style="invis" ]; } -} +}  -agg-index-testsEXPLAIN select b, c, d, e, min(x) from t5 where a = 0 and c = 0 group by a, b, c, d, e having b IN ('foo', 'bar') order by min(x), d -5 ([0080@[IN @c38] INUNION q0 -> { AISCAN(MV19 [EQUALS promote(@c19 AS LONG), EQUALS q0, EQUALS promote(@c19 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[2], _3: KEY:[4], _4: KEY:[5], _5: KEY:[3]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) } COMPARE BY (_._4, _.D, _.B, _.C, _.E)digraph G { +agg-index-testsEXPLAIN select b, c, d, e, min(x) from t5 where a = 0 and c = 0 group by a, b, c, d, e having b IN ('foo', 'bar') order by min(x), d + ْd(]0:85@[IN @c38] INUNION q0 -> { AISCAN(MV19 [EQUALS promote(@c19 AS LONG), EQUALS q0, EQUALS promote(@c19 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[2], _3: KEY:[4], _4: KEY:[5], _5: KEY:[3]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) } COMPARE BY (_._4, _.D, _.B, _.C, _.E)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    In Union
    COMPARE BY (_._4, _.D, _.B, _.C, _.E)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 2 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; - 3 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG), EQUALS q87, EQUALS promote(@c19 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 4 [ label=<
    Index
    MV19
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Values
    VALUES([__corr_q87 IN @c38]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, )" ]; + 1 [ label=<
    In Union
    COMPARE BY (_._4, _.D, _.B, _.C, _.E)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 2 [ label=<
    Value Computation
    MAP (q6._1 AS B, q6._2 AS C, q6._3 AS D, q6._4 AS E, q6._5 AS _4)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; + 3 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c19 AS LONG), EQUALS q87, EQUALS promote(@c19 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, STRING AS _1, LONG AS _2, LONG AS _3, STRING AS _4, LONG AS _5)" ]; + 4 [ label=<
    Index
    MV19
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS X)" ]; + 5 [ label=<
    Values
    VALUES([__corr_q87 IN @c38]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS B, LONG AS C, LONG AS D, STRING AS E, LONG AS _4)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 1 [ color="black" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; diff --git a/yaml-tests/src/test/resources/aggregate-index-tests.metrics.yaml b/yaml-tests/src/test/resources/aggregate-index-tests.metrics.yaml index 85bd49a601..dda78dcaee 100644 --- a/yaml-tests/src/test/resources/aggregate-index-tests.metrics.yaml +++ b/yaml-tests/src/test/resources/aggregate-index-tests.metrics.yaml @@ -3,9 +3,9 @@ agg-index-tests: explain: 'AISCAN(MV1 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._0 AS COL1, _._1 AS _1)' task_count: 500 - task_total_time_ms: 35 - transform_count: 142 - transform_time_ms: 9 + task_total_time_ms: 37 + transform_count: 149 + transform_time_ms: 21 transform_yield_count: 64 insert_time_ms: 0 insert_new_count: 48 @@ -14,9 +14,9 @@ agg-index-tests: explain: ISCAN(VI1 <,>) | MAP (_ AS _0) | AGG () GROUP BY (_._0.COL1 AS _0) | MAP (_._0._0 AS COL1) task_count: 385 - task_total_time_ms: 20 - transform_count: 106 - transform_time_ms: 9 + task_total_time_ms: 23 + transform_count: 110 + transform_time_ms: 12 transform_yield_count: 54 insert_time_ms: 0 insert_new_count: 37 @@ -26,8 +26,8 @@ agg-index-tests: AS _0)' task_count: 500 task_total_time_ms: 35 - transform_count: 142 - transform_time_ms: 18 + transform_count: 149 + transform_time_ms: 20 transform_yield_count: 64 insert_time_ms: 0 insert_new_count: 48 @@ -36,9 +36,9 @@ agg-index-tests: explain: 'AISCAN(MV1 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._0 AS COL1, _._1 AS _1)' task_count: 500 - task_total_time_ms: 35 - transform_count: 142 - transform_time_ms: 19 + task_total_time_ms: 41 + transform_count: 149 + transform_time_ms: 25 transform_yield_count: 64 insert_time_ms: 0 insert_new_count: 48 @@ -47,9 +47,9 @@ agg-index-tests: explain: 'AISCAN(MV1 <,> BY_GROUP REVERSE -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._0 AS COL1, _._1 AS _1)' task_count: 500 - task_total_time_ms: 36 - transform_count: 142 - transform_time_ms: 20 + task_total_time_ms: 38 + transform_count: 149 + transform_time_ms: 23 transform_yield_count: 64 insert_time_ms: 0 insert_new_count: 48 @@ -58,9 +58,9 @@ agg-index-tests: explain: 'AISCAN(MV1 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._0 AS COL1, _._1 + 1 AS _1)' task_count: 500 - task_total_time_ms: 34 - transform_count: 142 - transform_time_ms: 17 + task_total_time_ms: 36 + transform_count: 149 + transform_time_ms: 20 transform_yield_count: 64 insert_time_ms: 0 insert_new_count: 48 @@ -69,9 +69,9 @@ agg-index-tests: explain: 'AISCAN(MV8 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1]]) | MAP (_._0 AS COL1, _._1 AS _1)' task_count: 520 - task_total_time_ms: 37 - transform_count: 146 - transform_time_ms: 18 + task_total_time_ms: 36 + transform_count: 153 + transform_time_ms: 20 transform_yield_count: 66 insert_time_ms: 0 insert_new_count: 50 @@ -80,9 +80,9 @@ agg-index-tests: explain: 'AISCAN(MV8 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1]]) | MAP (_._0 AS COL1, _._1 AS _1)' task_count: 520 - task_total_time_ms: 19 - transform_count: 146 - transform_time_ms: 10 + task_total_time_ms: 45 + transform_count: 153 + transform_time_ms: 27 transform_yield_count: 66 insert_time_ms: 0 insert_new_count: 50 @@ -91,42 +91,42 @@ agg-index-tests: explain: 'AISCAN(MV8 <,> BY_GROUP REVERSE -> [_0: KEY:[0], _1: KEY:[1]]) | MAP (_._0 AS COL1, _._1 AS _1)' task_count: 520 - task_total_time_ms: 40 - transform_count: 146 - transform_time_ms: 21 + task_total_time_ms: 44 + transform_count: 153 + transform_time_ms: 24 transform_yield_count: 66 - insert_time_ms: 1 + insert_time_ms: 0 insert_new_count: 50 insert_reused_count: 5 - query: EXPLAIN select col1, max(col2) from T1 where col1 = 10 group by col1; explain: 'AISCAN(MV8 [EQUALS promote(@c13 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1]]) | MAP (_._0 AS COL1, _._1 AS _1)' task_count: 714 - task_total_time_ms: 50 - transform_count: 198 - transform_time_ms: 23 + task_total_time_ms: 53 + transform_count: 205 + transform_time_ms: 27 transform_yield_count: 74 - insert_time_ms: 1 + insert_time_ms: 0 insert_new_count: 70 insert_reused_count: 3 - query: EXPLAIN select max(col2) from T1 use index (mv8); - explain: ISCAN(MV8 <,>) | MAP (_ AS _0) | AGG (max_l(_._0.COL2) AS _0) | ON EMPTY - NULL | MAP (_._0._0 AS _0) - task_count: 279 - task_total_time_ms: 12 - transform_count: 72 - transform_time_ms: 4 - transform_yield_count: 22 + explain: 'AISCAN(MV8 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1]]) | AGG max_l(_._1) + GROUP BY () | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)' + task_count: 478 + task_total_time_ms: 26 + transform_count: 142 + transform_time_ms: 13 + transform_yield_count: 34 insert_time_ms: 0 - insert_new_count: 26 - insert_reused_count: 2 + insert_new_count: 46 + insert_reused_count: 5 - query: EXPLAIN select col2 from T1 where col1 = 10; explain: 'COVERING(MV8 [EQUALS promote(@c8 AS LONG)] -> [COL1: KEY[0], COL2: KEY[1], ID: KEY[3]]) | MAP (_.COL2 AS COL2)' task_count: 677 task_total_time_ms: 33 - transform_count: 171 - transform_time_ms: 11 + transform_count: 175 + transform_time_ms: 10 transform_yield_count: 69 insert_time_ms: 1 insert_new_count: 68 @@ -135,8 +135,8 @@ agg-index-tests: explain: 'COVERING(MV8 [EQUALS promote(@c8 AS LONG)] REVERSE -> [COL1: KEY[0], COL2: KEY[1], ID: KEY[3]]) | MAP (_.COL2 AS COL2)' task_count: 274 - task_total_time_ms: 15 - transform_count: 88 + task_total_time_ms: 14 + transform_count: 92 transform_time_ms: 7 transform_yield_count: 48 insert_time_ms: 0 @@ -146,31 +146,32 @@ agg-index-tests: explain: ISCAN(MV2 <,>) | MAP (_ AS _0) | AGG (min_l(_._0.COL3) AS _0) GROUP BY (_._0.COL1 AS _0, _._0.COL2 AS _1) | MAP (_._1._0 AS _0) task_count: 329 - task_total_time_ms: 20 - transform_count: 96 - transform_time_ms: 11 + task_total_time_ms: 21 + transform_count: 100 + transform_time_ms: 12 transform_yield_count: 52 insert_time_ms: 0 insert_new_count: 25 insert_reused_count: 2 - query: EXPLAIN select max(col2) from t2; - explain: ISCAN(MV3 <,>) | MAP (_ AS _0) | AGG (max_l(_._0.COL2) AS _0) | ON EMPTY - NULL | MAP (_._0._0 AS _0) - task_count: 508 - task_total_time_ms: 31 - transform_count: 122 - transform_time_ms: 16 - transform_yield_count: 63 + explain: 'AISCAN(MV9 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) + | AGG max_l(_._2) GROUP BY () | MAP ((_._2 AS _0) AS _0) | ON EMPTY NULL | + MAP (_._0._0 AS _0)' + task_count: 734 + task_total_time_ms: 52 + transform_count: 195 + transform_time_ms: 28 + transform_yield_count: 78 insert_time_ms: 1 - insert_new_count: 60 - insert_reused_count: 8 + insert_new_count: 86 + insert_reused_count: 11 - query: EXPLAIN select col1, sum(col2) from T1 USE INDEX (vi1) group by col1; explain: ISCAN(VI1 <,>) | MAP (_ AS _0) | AGG (sum_l(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._0._0 AS COL1, _._1._0 AS _1) task_count: 261 - task_total_time_ms: 13 - transform_count: 68 - transform_time_ms: 4 + task_total_time_ms: 11 + transform_count: 72 + transform_time_ms: 3 transform_yield_count: 18 insert_time_ms: 0 insert_new_count: 25 @@ -179,9 +180,9 @@ agg-index-tests: explain: 'AISCAN(MV9 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) | MAP (_._2 AS _0)' task_count: 524 - task_total_time_ms: 23 - transform_count: 145 - transform_time_ms: 13 + task_total_time_ms: 50 + transform_count: 152 + transform_time_ms: 31 transform_yield_count: 68 insert_time_ms: 0 insert_new_count: 50 @@ -190,20 +191,20 @@ agg-index-tests: explain: 'AISCAN(MV9 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) | MAP (_._0 AS COL1, _._1 AS COL3, _._2 AS _2)' task_count: 524 - task_total_time_ms: 46 - transform_count: 146 - transform_time_ms: 23 + task_total_time_ms: 49 + transform_count: 153 + transform_time_ms: 30 transform_yield_count: 68 - insert_time_ms: 1 + insert_time_ms: 0 insert_new_count: 50 insert_reused_count: 5 - query: EXPLAIN select col3, max(col2) from t2 where col1 = 2 group by col1, col3; explain: 'AISCAN(MV9 [EQUALS promote(@c13 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) | MAP (_._1 AS COL3, _._2 AS _1)' task_count: 718 - task_total_time_ms: 37 - transform_count: 198 - transform_time_ms: 16 + task_total_time_ms: 63 + transform_count: 205 + transform_time_ms: 33 transform_yield_count: 76 insert_time_ms: 0 insert_new_count: 70 @@ -213,9 +214,9 @@ agg-index-tests: explain: 'AISCAN(MV9 [EQUALS promote(@c13 AS LONG)] BY_GROUP REVERSE -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) | MAP (_._1 AS COL3, _._2 AS _1)' task_count: 383 - task_total_time_ms: 35 - transform_count: 124 - transform_time_ms: 19 + task_total_time_ms: 42 + transform_count: 131 + transform_time_ms: 28 transform_yield_count: 58 insert_time_ms: 0 insert_new_count: 24 @@ -225,9 +226,9 @@ agg-index-tests: explain: 'AISCAN(MV9 [EQUALS promote(@c13 AS LONG)] BY_GROUP REVERSE -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) | MAP (_._1 AS COL3, _._2 AS _1)' task_count: 383 - task_total_time_ms: 35 - transform_count: 124 - transform_time_ms: 19 + task_total_time_ms: 42 + transform_count: 131 + transform_time_ms: 28 transform_yield_count: 58 insert_time_ms: 0 insert_new_count: 24 @@ -238,9 +239,9 @@ agg-index-tests: LONG)]] BY_GROUP REVERSE -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) | MAP (_._1 AS COL3, _._2 AS _1)' task_count: 394 - task_total_time_ms: 28 - transform_count: 127 - transform_time_ms: 15 + task_total_time_ms: 43 + transform_count: 134 + transform_time_ms: 29 transform_yield_count: 58 insert_time_ms: 0 insert_new_count: 25 @@ -251,9 +252,9 @@ agg-index-tests: AS LONG) && LESS_THAN promote(@c25 AS LONG)]] BY_GROUP REVERSE -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) | MAP (_._1 AS COL3, _._2 AS _1)' task_count: 394 - task_total_time_ms: 37 - transform_count: 127 - transform_time_ms: 20 + task_total_time_ms: 39 + transform_count: 134 + transform_time_ms: 26 transform_yield_count: 58 insert_time_ms: 0 insert_new_count: 25 @@ -264,9 +265,9 @@ agg-index-tests: LONG)]] BY_GROUP REVERSE -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) | MAP (_._1 AS COL3, _._2 AS M)' task_count: 453 - task_total_time_ms: 45 - transform_count: 154 - transform_time_ms: 23 + task_total_time_ms: 49 + transform_count: 161 + transform_time_ms: 32 transform_yield_count: 63 insert_time_ms: 0 insert_new_count: 36 @@ -276,9 +277,9 @@ agg-index-tests: explain: 'AISCAN(MV9 [EQUALS promote(@c21 AS LONG)] BY_GROUP REVERSE -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) | MAP (_._1 AS COL3, _._2 AS M)' task_count: 409 - task_total_time_ms: 42 - transform_count: 134 - transform_time_ms: 25 + task_total_time_ms: 47 + transform_count: 141 + transform_time_ms: 32 transform_yield_count: 60 insert_time_ms: 0 insert_new_count: 28 @@ -287,9 +288,9 @@ agg-index-tests: explain: 'COVERING(MV9 [EQUALS promote(@c10 AS LONG)] -> [COL1: KEY[0], COL2: KEY[2], COL3: KEY[1], ID: KEY[4]]) | MAP (_.COL3 AS COL3, _.COL2 AS COL2)' task_count: 345 - task_total_time_ms: 23 - transform_count: 109 - transform_time_ms: 10 + task_total_time_ms: 24 + transform_count: 113 + transform_time_ms: 11 transform_yield_count: 54 insert_time_ms: 0 insert_new_count: 26 @@ -299,8 +300,8 @@ agg-index-tests: COL2: KEY[2], COL3: KEY[1], ID: KEY[4]]) | MAP (_.COL3 AS COL3, _.COL2 AS COL2)' task_count: 345 - task_total_time_ms: 27 - transform_count: 109 + task_total_time_ms: 24 + transform_count: 113 transform_time_ms: 11 transform_yield_count: 54 insert_time_ms: 0 @@ -312,8 +313,8 @@ agg-index-tests: AS _0) GROUP BY (_._0.COL1 AS _0, _._0.COL3 AS _1) | MAP (_._0._1 AS COL3, _._1._0 AS S) task_count: 281 - task_total_time_ms: 19 - transform_count: 84 + task_total_time_ms: 17 + transform_count: 88 transform_time_ms: 7 transform_yield_count: 22 insert_time_ms: 0 @@ -325,9 +326,9 @@ agg-index-tests: (sum_l(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0, _._0.COL3 AS _1) | MAP (_._0._1 AS COL3, _._1._0 AS S) task_count: 281 - task_total_time_ms: 22 - transform_count: 84 - transform_time_ms: 9 + task_total_time_ms: 20 + transform_count: 88 + transform_time_ms: 7 transform_yield_count: 22 insert_time_ms: 0 insert_new_count: 23 @@ -336,8 +337,8 @@ agg-index-tests: explain: ISCAN(MV3 <,>) | MAP (_ AS _0) | AGG (max_l(_._0.COL3) AS _0) GROUP BY (_._0.COL1 AS _0, _._0.COL3 AS _1) | MAP (_._1._0 AS _0) task_count: 389 - task_total_time_ms: 28 - transform_count: 106 + task_total_time_ms: 26 + transform_count: 110 transform_time_ms: 14 transform_yield_count: 56 insert_time_ms: 0 @@ -347,9 +348,9 @@ agg-index-tests: explain: 'AISCAN(MV7 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)' task_count: 592 - task_total_time_ms: 40 - transform_count: 173 - transform_time_ms: 19 + task_total_time_ms: 34 + transform_count: 180 + transform_time_ms: 18 transform_yield_count: 67 insert_time_ms: 1 insert_new_count: 62 @@ -358,9 +359,9 @@ agg-index-tests: explain: 'AISCAN(MV7 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)' task_count: 592 - task_total_time_ms: 40 - transform_count: 173 - transform_time_ms: 19 + task_total_time_ms: 34 + transform_count: 180 + transform_time_ms: 18 transform_yield_count: 67 insert_time_ms: 1 insert_new_count: 62 @@ -369,20 +370,20 @@ agg-index-tests: explain: 'AISCAN(MV6 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._0 AS COL1, _._1 AS _1)' task_count: 585 - task_total_time_ms: 45 - transform_count: 172 - transform_time_ms: 25 + task_total_time_ms: 35 + transform_count: 179 + transform_time_ms: 21 transform_yield_count: 72 - insert_time_ms: 1 + insert_time_ms: 0 insert_new_count: 53 insert_reused_count: 6 - query: EXPLAIN select col1, min_ever(col2) from T1 group by col1; explain: 'AISCAN(MV12 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._0 AS COL1, _._1 AS _1)' task_count: 470 - task_total_time_ms: 30 - transform_count: 139 - transform_time_ms: 16 + task_total_time_ms: 36 + transform_count: 146 + transform_time_ms: 20 transform_yield_count: 62 insert_time_ms: 0 insert_new_count: 42 @@ -391,9 +392,9 @@ agg-index-tests: explain: 'AISCAN(MV15 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._0 AS COL2, _._1 AS _1)' task_count: 332 - task_total_time_ms: 18 - transform_count: 101 - transform_time_ms: 8 + task_total_time_ms: 23 + transform_count: 108 + transform_time_ms: 13 transform_yield_count: 32 insert_time_ms: 0 insert_new_count: 24 @@ -402,9 +403,9 @@ agg-index-tests: explain: 'AISCAN(MV14 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._0 AS COL2, _._1 AS _1)' task_count: 332 - task_total_time_ms: 19 - transform_count: 101 - transform_time_ms: 9 + task_total_time_ms: 21 + transform_count: 108 + transform_time_ms: 12 transform_yield_count: 32 insert_time_ms: 0 insert_new_count: 24 @@ -413,22 +414,22 @@ agg-index-tests: explain: 'AISCAN(MV1 [[GREATER_THAN promote(@c13 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._0 AS COL1, _._1 AS _1)' task_count: 694 - task_total_time_ms: 30 - transform_count: 194 - transform_time_ms: 14 + task_total_time_ms: 45 + transform_count: 201 + transform_time_ms: 24 transform_yield_count: 72 - insert_time_ms: 0 + insert_time_ms: 1 insert_new_count: 68 insert_reused_count: 3 - query: EXPLAIN select sum(col2) from T1 where col1 = 10 group by col1 explain: 'AISCAN(MV1 [EQUALS promote(@c11 AS LONG)] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0)' task_count: 694 - task_total_time_ms: 51 - transform_count: 194 - transform_time_ms: 23 + task_total_time_ms: 50 + transform_count: 201 + transform_time_ms: 25 transform_yield_count: 72 - insert_time_ms: 1 + insert_time_ms: 0 insert_new_count: 68 insert_reused_count: 3 - query: EXPLAIN select sum(col2) from T1 where col1 <= 10 group by col1 having @@ -437,8 +438,8 @@ agg-index-tests: promote(@c12 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS _0)' task_count: 705 - task_total_time_ms: 49 - transform_count: 197 + task_total_time_ms: 45 + transform_count: 204 transform_time_ms: 23 transform_yield_count: 72 insert_time_ms: 1 @@ -448,9 +449,9 @@ agg-index-tests: explain: 'AISCAN(MV10 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1]]) | MAP (_._1 AS X1, _._0 AS X2)' task_count: 401 - task_total_time_ms: 29 - transform_count: 119 - transform_time_ms: 13 + task_total_time_ms: 30 + transform_count: 126 + transform_time_ms: 16 transform_yield_count: 47 insert_time_ms: 0 insert_new_count: 33 @@ -459,8 +460,8 @@ agg-index-tests: explain: 'AISCAN(MV10 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1]]) | MAP (_._0 AS X1, _._1 AS X2)' task_count: 401 - task_total_time_ms: 32 - transform_count: 119 + task_total_time_ms: 28 + transform_count: 126 transform_time_ms: 17 transform_yield_count: 47 insert_time_ms: 0 @@ -470,9 +471,9 @@ agg-index-tests: explain: 'AISCAN(MV11 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[2]]) | MAP (_._0 AS X1, _._2 AS X2)' task_count: 401 - task_total_time_ms: 35 - transform_count: 119 - transform_time_ms: 19 + task_total_time_ms: 40 + transform_count: 126 + transform_time_ms: 28 transform_yield_count: 47 insert_time_ms: 0 insert_new_count: 33 @@ -481,9 +482,9 @@ agg-index-tests: explain: 'AISCAN(MV11 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: KEY:[2]]) | MAP (_._0 AS X1, _._2 AS X2)' task_count: 401 - task_total_time_ms: 31 - transform_count: 119 - transform_time_ms: 17 + task_total_time_ms: 40 + transform_count: 126 + transform_time_ms: 26 transform_yield_count: 47 insert_time_ms: 0 insert_new_count: 33 @@ -494,8 +495,8 @@ agg-index-tests: | MAP (_._0 AS X1, _._2 AS X2)' task_count: 401 task_total_time_ms: 40 - transform_count: 119 - transform_time_ms: 24 + transform_count: 126 + transform_time_ms: 28 transform_yield_count: 47 insert_time_ms: 0 insert_new_count: 33 @@ -505,9 +506,9 @@ agg-index-tests: explain: 'AISCAN(MV10 [[LESS_THAN promote(@c21 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1]]) | MAP (_._1 AS X1, _._0 AS X2)' task_count: 469 - task_total_time_ms: 24 - transform_count: 141 - transform_time_ms: 13 + task_total_time_ms: 33 + transform_count: 148 + transform_time_ms: 19 transform_yield_count: 50 insert_time_ms: 0 insert_new_count: 39 @@ -518,9 +519,9 @@ agg-index-tests: _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4)' task_count: 405 - task_total_time_ms: 70 - transform_count: 131 - transform_time_ms: 50 + task_total_time_ms: 149 + transform_count: 138 + transform_time_ms: 129 transform_yield_count: 69 insert_time_ms: 0 insert_new_count: 24 @@ -531,9 +532,9 @@ agg-index-tests: _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4)' task_count: 405 - task_total_time_ms: 69 - transform_count: 131 - transform_time_ms: 46 + task_total_time_ms: 121 + transform_count: 138 + transform_time_ms: 103 transform_yield_count: 69 insert_time_ms: 0 insert_new_count: 24 @@ -544,9 +545,9 @@ agg-index-tests: _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4)' task_count: 405 - task_total_time_ms: 77 - transform_count: 131 - transform_time_ms: 57 + task_total_time_ms: 138 + transform_count: 138 + transform_time_ms: 120 transform_yield_count: 69 insert_time_ms: 0 insert_new_count: 24 @@ -557,9 +558,9 @@ agg-index-tests: _1: KEY:[1], _2: KEY:[3], _3: KEY:[4], _4: KEY:[5], _5: KEY:[2]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4)' task_count: 405 - task_total_time_ms: 66 - transform_count: 131 - transform_time_ms: 46 + task_total_time_ms: 124 + transform_count: 138 + transform_time_ms: 105 transform_yield_count: 69 insert_time_ms: 0 insert_new_count: 24 @@ -570,9 +571,9 @@ agg-index-tests: _1: KEY:[1], _2: KEY:[2], _3: KEY:[4], _4: KEY:[5], _5: KEY:[3]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4)' task_count: 405 - task_total_time_ms: 75 - transform_count: 131 - transform_time_ms: 53 + task_total_time_ms: 147 + transform_count: 138 + transform_time_ms: 127 transform_yield_count: 69 insert_time_ms: 0 insert_new_count: 24 @@ -583,9 +584,9 @@ agg-index-tests: _1: KEY:[1], _2: KEY:[2], _3: KEY:[4], _4: KEY:[5], _5: KEY:[3]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4)' task_count: 405 - task_total_time_ms: 74 - transform_count: 131 - transform_time_ms: 57 + task_total_time_ms: 127 + transform_count: 138 + transform_time_ms: 108 transform_yield_count: 69 insert_time_ms: 0 insert_new_count: 24 @@ -596,9 +597,9 @@ agg-index-tests: _1: KEY:[1], _2: KEY:[2], _3: KEY:[4], _4: KEY:[5], _5: KEY:[3]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4)' task_count: 405 - task_total_time_ms: 80 - transform_count: 131 - transform_time_ms: 57 + task_total_time_ms: 121 + transform_count: 138 + transform_time_ms: 105 transform_yield_count: 69 insert_time_ms: 0 insert_new_count: 24 @@ -609,9 +610,9 @@ agg-index-tests: _1: KEY:[1], _2: KEY:[2], _3: KEY:[4], _4: KEY:[5], _5: KEY:[3]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4)' task_count: 405 - task_total_time_ms: 62 - transform_count: 131 - transform_time_ms: 43 + task_total_time_ms: 131 + transform_count: 138 + transform_time_ms: 111 transform_yield_count: 69 insert_time_ms: 0 insert_new_count: 24 @@ -623,11 +624,11 @@ agg-index-tests: _4: KEY:[5], _5: KEY:[2]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) } COMPARE BY (_._4, _.C, _.B, _.D, _.E)' task_count: 614 - task_total_time_ms: 102 - transform_count: 230 - transform_time_ms: 64 + task_total_time_ms: 221 + transform_count: 239 + transform_time_ms: 190 transform_yield_count: 85 - insert_time_ms: 1 + insert_time_ms: 0 insert_new_count: 39 insert_reused_count: 0 - query: EXPLAIN select b, c, d, e, min(x) from t5 where a = 0 group by a, b, c, @@ -637,9 +638,9 @@ agg-index-tests: _4: KEY:[5], _5: KEY:[2]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) } COMPARE BY (_._4, _.C, _.B, _.D, _.E)' task_count: 614 - task_total_time_ms: 106 - transform_count: 230 - transform_time_ms: 62 + task_total_time_ms: 232 + transform_count: 239 + transform_time_ms: 198 transform_yield_count: 85 insert_time_ms: 0 insert_new_count: 39 @@ -652,9 +653,9 @@ agg-index-tests: (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) } COMPARE BY (_._4, _.C, _.B, _.D, _.E)' task_count: 694 - task_total_time_ms: 137 - transform_count: 246 - transform_time_ms: 75 + task_total_time_ms: 248 + transform_count: 255 + transform_time_ms: 197 transform_yield_count: 92 insert_time_ms: 0 insert_new_count: 51 @@ -667,9 +668,9 @@ agg-index-tests: (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) } COMPARE BY (_._4, _.C, _.B, _.D, _.E)' task_count: 694 - task_total_time_ms: 125 - transform_count: 246 - transform_time_ms: 63 + task_total_time_ms: 225 + transform_count: 255 + transform_time_ms: 180 transform_yield_count: 92 insert_time_ms: 0 insert_new_count: 51 @@ -683,11 +684,11 @@ agg-index-tests: _._5 AS _4) } COMPARE BY (_._4, _.C, _.D, _.E) } COMPARE BY (_._4, _.C, _.B, _.E)' task_count: 2115 - task_total_time_ms: 268 - transform_count: 971 - transform_time_ms: 93 + task_total_time_ms: 405 + transform_count: 982 + transform_time_ms: 261 transform_yield_count: 149 - insert_time_ms: 27 + insert_time_ms: 23 insert_new_count: 152 insert_reused_count: 19 - query: EXPLAIN select b, c, d, e, min(x) from t5 where a = 0 group by a, b, c, @@ -699,11 +700,11 @@ agg-index-tests: _._5 AS _4) } COMPARE BY (_._4, _.C, _.D, _.E) } COMPARE BY (_._4, _.C, _.B, _.E)' task_count: 2115 - task_total_time_ms: 127 - transform_count: 971 - transform_time_ms: 45 + task_total_time_ms: 466 + transform_count: 982 + transform_time_ms: 307 transform_yield_count: 149 - insert_time_ms: 14 + insert_time_ms: 25 insert_new_count: 152 insert_reused_count: 19 - query: EXPLAIN select b, c, d, e, max(x) from t5 where a = 0 group by a, b, c, @@ -715,11 +716,11 @@ agg-index-tests: _._5 AS _4) } COMPARE BY (_._4, _.C, _.E, _.D) } COMPARE BY (_._4, _.C, _.E, _.B)' task_count: 2041 - task_total_time_ms: 237 - transform_count: 951 - transform_time_ms: 94 + task_total_time_ms: 422 + transform_count: 962 + transform_time_ms: 300 transform_yield_count: 135 - insert_time_ms: 29 + insert_time_ms: 25 insert_new_count: 130 insert_reused_count: 23 - query: EXPLAIN select b, c, d, e, min(x) from t5 where a = 0 group by a, b, c, @@ -731,11 +732,11 @@ agg-index-tests: _._5 AS _4) } COMPARE BY (_._4, _.C, _.E, _.D) } COMPARE BY (_._4, _.C, _.E, _.B)' task_count: 2041 - task_total_time_ms: 111 - transform_count: 951 - transform_time_ms: 46 + task_total_time_ms: 424 + transform_count: 962 + transform_time_ms: 307 transform_yield_count: 135 - insert_time_ms: 18 + insert_time_ms: 25 insert_new_count: 130 insert_reused_count: 23 - query: EXPLAIN select b, c, d, e, max(x) from t5 where a = 0 and c = 0 group by @@ -745,13 +746,13 @@ agg-index-tests: _2: KEY:[2], _3: KEY:[4], _4: KEY:[5], _5: KEY:[3]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) } COMPARE BY (_._4, _.D, _.B, _.C, _.E)' - task_count: 674 - task_total_time_ms: 127 - transform_count: 242 - transform_time_ms: 71 - transform_yield_count: 91 + task_count: 713 + task_total_time_ms: 264 + transform_count: 265 + transform_time_ms: 209 + transform_yield_count: 93 insert_time_ms: 0 - insert_new_count: 48 + insert_new_count: 53 insert_reused_count: 0 - query: EXPLAIN select b, c, d, e, min(x) from t5 where a = 0 and c = 0 group by a, b, c, d, e having b IN ('foo', 'bar') order by min(x), d @@ -760,11 +761,11 @@ agg-index-tests: _2: KEY:[2], _3: KEY:[4], _4: KEY:[5], _5: KEY:[3]]) | MAP (_._1 AS B, _._2 AS C, _._3 AS D, _._4 AS E, _._5 AS _4) } COMPARE BY (_._4, _.D, _.B, _.C, _.E)' - task_count: 674 - task_total_time_ms: 112 - transform_count: 242 - transform_time_ms: 63 - transform_yield_count: 91 + task_count: 713 + task_total_time_ms: 266 + transform_count: 265 + transform_time_ms: 211 + transform_yield_count: 93 insert_time_ms: 0 - insert_new_count: 48 + insert_new_count: 53 insert_reused_count: 0 diff --git a/yaml-tests/src/test/resources/aggregate-index-tests.yamsql b/yaml-tests/src/test/resources/aggregate-index-tests.yamsql index 96551b98be..145cca14a8 100644 --- a/yaml-tests/src/test/resources/aggregate-index-tests.yamsql +++ b/yaml-tests/src/test/resources/aggregate-index-tests.yamsql @@ -156,7 +156,7 @@ test_block: # At some point, should be able to roll up values from the aggregate index. However, even # controlling for that, it can still use the index - query: select max(col2) from T1 use index (mv8); - - explain: "ISCAN(MV8 <,>) | MAP (_ AS _0) | AGG (max_l(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)" + - explain: "AISCAN(MV8 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1]]) | AGG max_l(_._1) GROUP BY () | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)" - result: [{!l 13}] - # Min/max indexes need keep what amounts to a standard value index on their keys (in order to properly look up @@ -177,7 +177,7 @@ test_block: # this should use the aggregate index in the future, for now, it is using streaming aggregate # over base table scan. - query: select max(col2) from t2; - - explain: "ISCAN(MV3 <,>) | MAP (_ AS _0) | AGG (max_l(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)" + - explain: "AISCAN(MV9 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[2], _2: KEY:[1]]) | AGG max_l(_._2) GROUP BY () | MAP ((_._2 AS _0) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)" - result: [{!l 2}] - - query: select col1, sum(col2) from T1 USE INDEX (vi1) group by col1; diff --git a/yaml-tests/src/test/resources/between.metrics.binpb b/yaml-tests/src/test/resources/between.metrics.binpb index 8b09cc668a..6c6b04a6ae 100644 --- a/yaml-tests/src/test/resources/between.metrics.binpb +++ b/yaml-tests/src/test/resources/between.metrics.binpb @@ -1,37 +1,36 @@ - + L -between-index-tests5EXPLAIN select * from t1 WHERE col1 BETWEEN 10 AND 10 -Z (!0'8%@cISCAN(I1 [[GREATER_THAN_OR_EQUALS promote(@c8 AS INT) && LESS_THAN_OR_EQUALS promote(@c8 AS INT)]])digraph G { +between-index-tests5EXPLAIN select * from t1 WHERE col1 BETWEEN 10 AND 10 +Ż^ 繐(!0'8%@cISCAN(I1 [[GREATER_THAN_OR_EQUALS promote(@c8 AS INT) && LESS_THAN_OR_EQUALS promote(@c8 AS INT)]])digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN_OR_EQUALS promote(@c8 AS INT) && LESS_THAN_OR_EQUALS promote(@c8 AS INT)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS ID, )" ]; - 2 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS ID, )" ]; + 1 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN_OR_EQUALS promote(@c8 AS INT) && LESS_THAN_OR_EQUALS promote(@c8 AS INT)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS ID, INT AS COL1, INT AS COL2)" ]; + 2 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS ID, INT AS COL1, INT AS COL2)" ]; 2 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} P -between-index-tests9EXPLAIN select * from t1 WHERE col1 + 5 BETWEEN 10 AND 20 -יV ۏ(0!8#@ISCAN(I1 <,>) | FILTER _.COL1 + @c8 GREATER_THAN_OR_EQUALS promote(@c10 AS INT) AND _.COL1 + @c8 LESS_THAN_OR_EQUALS promote(@c12 AS INT) -digraph G { +between-index-tests9EXPLAIN select * from t1 WHERE col1 + 5 BETWEEN 10 AND 20 +Z Ь(0'8#@ISCAN(I1 <,>) | FILTER _.COL1 + @c8 GREATER_THAN_OR_EQUALS promote(@c10 AS INT) AND _.COL1 + @c8 LESS_THAN_OR_EQUALS promote(@c12 AS INT) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Predicate Filter
    WHERE q2.COL1 + @c8 GREATER_THAN_OR_EQUALS promote(@c10 AS INT) AND q2.COL1 + @c8 LESS_THAN_OR_EQUALS promote(@c12 AS INT)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS ID, )" ]; - 2 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS ID, )" ]; - 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS ID, )" ]; + 1 [ label=<
    Predicate Filter
    WHERE q2.COL1 + @c8 GREATER_THAN_OR_EQUALS promote(@c10 AS INT) AND q2.COL1 + @c8 LESS_THAN_OR_EQUALS promote(@c12 AS INT)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS ID, INT AS COL1, INT AS COL2)" ]; + 2 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS ID, INT AS COL1, INT AS COL2)" ]; + 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS ID, INT AS COL1, INT AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} T -between-index-tests=EXPLAIN select * from t1 WHERE col1 + 5 NOT BETWEEN 10 AND 20 -W (0׫28#@tISCAN(I1 <,>) | FILTER _.COL1 + @c8 LESS_THAN promote(@c11 AS INT) OR _.COL1 + @c8 GREATER_THAN promote(@c13 AS INT) +between-index-tests=EXPLAIN select * from t1 WHERE col1 + 5 NOT BETWEEN 10 AND 20 +[ (0'8#@tISCAN(I1 <,>) | FILTER _.COL1 + @c8 LESS_THAN promote(@c11 AS INT) OR _.COL1 + @c8 GREATER_THAN promote(@c13 AS INT) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Predicate Filter
    WHERE q2.COL1 + @c8 LESS_THAN promote(@c11 AS INT) OR q2.COL1 + @c8 GREATER_THAN promote(@c13 AS INT)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS ID, )" ]; - 2 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS ID, )" ]; - 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS ID, )" ]; + 1 [ label=<
    Predicate Filter
    WHERE q2.COL1 + @c8 LESS_THAN promote(@c11 AS INT) OR q2.COL1 + @c8 GREATER_THAN promote(@c13 AS INT)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS ID, INT AS COL1, INT AS COL2)" ]; + 2 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS ID, INT AS COL1, INT AS COL2)" ]; + 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS ID, INT AS COL1, INT AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; } \ No newline at end of file diff --git a/yaml-tests/src/test/resources/between.metrics.yaml b/yaml-tests/src/test/resources/between.metrics.yaml index 64cc5ed4a3..179aa61f9c 100644 --- a/yaml-tests/src/test/resources/between.metrics.yaml +++ b/yaml-tests/src/test/resources/between.metrics.yaml @@ -4,8 +4,8 @@ between-index-tests: promote(@c8 AS INT)]]) task_count: 334 task_total_time_ms: 17 - transform_count: 90 - transform_time_ms: 7 + transform_count: 94 + transform_time_ms: 6 transform_yield_count: 33 insert_time_ms: 0 insert_new_count: 37 @@ -14,9 +14,9 @@ between-index-tests: explain: ISCAN(I1 <,>) | FILTER _.COL1 + @c8 GREATER_THAN_OR_EQUALS promote(@c10 AS INT) AND _.COL1 + @c8 LESS_THAN_OR_EQUALS promote(@c12 AS INT) task_count: 298 - task_total_time_ms: 11 - transform_count: 86 - transform_time_ms: 4 + task_total_time_ms: 16 + transform_count: 90 + transform_time_ms: 7 transform_yield_count: 30 insert_time_ms: 0 insert_new_count: 35 @@ -25,8 +25,8 @@ between-index-tests: explain: ISCAN(I1 <,>) | FILTER _.COL1 + @c8 LESS_THAN promote(@c11 AS INT) OR _.COL1 + @c8 GREATER_THAN promote(@c13 AS INT) task_count: 298 - task_total_time_ms: 14 - transform_count: 87 + task_total_time_ms: 17 + transform_count: 91 transform_time_ms: 7 transform_yield_count: 30 insert_time_ms: 0 diff --git a/yaml-tests/src/test/resources/bitmap-aggregate-index.metrics.binpb b/yaml-tests/src/test/resources/bitmap-aggregate-index.metrics.binpb index 5990d3cf00..4e955779b7 100644 --- a/yaml-tests/src/test/resources/bitmap-aggregate-index.metrics.binpb +++ b/yaml-tests/src/test/resources/bitmap-aggregate-index.metrics.binpb @@ -1,85 +1,57 @@ - - -bitmap-agg-index-testsEXPLAIN SELECT bitmap_construct_agg(bitmap_bit_position(id)) as bitmap, bitmap_bucket_offset(id) as offset FROM T1 GROUP BY bitmap_bucket_offset(id) - Ǻ(40ɫ=8%@hAISCAN(BITMAPINDEX1 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS BITMAP, _._0 AS OFFSET) -digraph G { - fontname=courier; - rankdir=BT; - splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._1 AS BITMAP, q6._0 AS OFFSET)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(BYTES AS BITMAP, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    BITMAPINDEX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} - -bitmap-agg-index-testsEXPLAIN SELECT bitmap_construct_agg(bitmap_bit_position(id)) as bitmap, category, bitmap_bucket_offset(id) as offset FROM T1 GROUP BY category, bitmap_bucket_offset(id) - -(40Ը 8%@AISCAN(BITMAPINDEX2 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: VALUE:[0]]) | MAP (_._2 AS BITMAP, _._0 AS CATEGORY, _._1 AS OFFSET) -digraph G { - fontname=courier; - rankdir=BT; - splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._2 AS BITMAP, q6._0 AS CATEGORY, q6._1 AS OFFSET)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(BYTES AS BITMAP, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS _0, )" ]; - 3 [ label=<
    Index
    BITMAPINDEX2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +  -bitmap-agg-index-testsEXPLAIN SELECT bitmap_construct_agg(bitmap_bit_position(id)) as bitmap, bitmap_bucket_offset(id) as offset FROM T1 GROUP BY bitmap_bucket_offset(id), bitmap_bucket_offset(id), bitmap_bucket_offset(id) -׿ (40/8%@hAISCAN(BITMAPINDEX1 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS BITMAP, _._0 AS OFFSET) +bitmap-agg-index-testsEXPLAIN SELECT bitmap_construct_agg(bitmap_bit_position(id)) as bitmap, bitmap_bucket_offset(id) as offset FROM T1 GROUP BY bitmap_bucket_offset(id), bitmap_bucket_offset(id), bitmap_bucket_offset(id) +Ջ (40*8%@hAISCAN(BITMAPINDEX1 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS BITMAP, _._0 AS OFFSET) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._1 AS BITMAP, q6._0 AS OFFSET)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(BYTES AS BITMAP, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 3 [ label=<
    Index
    BITMAPINDEX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._1 AS BITMAP, q6._0 AS OFFSET)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(BYTES AS BITMAP, LONG AS OFFSET)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, BYTES AS _1)" ]; + 3 [ label=<
    Index
    BITMAPINDEX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS CATEGORY)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +}  -bitmap-agg-index-testsEXPLAIN SELECT bitmap_construct_agg(bitmap_bit_position(id)) as bitmap, category, bitmap_bucket_offset(id) as offset FROM T1 GROUP BY bitmap_bucket_offset(id), category, bitmap_bucket_offset(id) - (40́/8%@AISCAN(BITMAPINDEX2 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: VALUE:[0]]) | MAP (_._2 AS BITMAP, _._0 AS CATEGORY, _._1 AS OFFSET) -digraph G { +bitmap-agg-index-testsEXPLAIN SELECT bitmap_construct_agg(bitmap_bit_position(id)) as bitmap, category, bitmap_bucket_offset(id) as offset FROM T1 GROUP BY bitmap_bucket_offset(id), category, bitmap_bucket_offset(id) +# ѿ(40(8%@AISCAN(BITMAPINDEX2 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: VALUE:[0]]) | MAP (_._2 AS BITMAP, _._0 AS CATEGORY, _._1 AS OFFSET) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._2 AS BITMAP, q6._0 AS CATEGORY, q6._1 AS OFFSET)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(BYTES AS BITMAP, )" ]; - 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS _0, )" ]; - 3 [ label=<
    Index
    BITMAPINDEX2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._2 AS BITMAP, q6._0 AS CATEGORY, q6._1 AS OFFSET)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(BYTES AS BITMAP, STRING AS CATEGORY, LONG AS OFFSET)" ]; + 2 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS _0, LONG AS _1, BYTES AS _2)" ]; + 3 [ label=<
    Index
    BITMAPINDEX2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS CATEGORY)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +}  -bitmap-agg-index-testsEXPLAIN SELECT bitmap_construct_agg(bitmap_bit_position(id)) as bitmap, bitmap_bucket_offset(id) as offset FROM T2 GROUP BY bitmap_bucket_offset(id) -ϦL Ө(08@ISCAN(AGG_INDEX_1 <,>) | MAP (_ AS _0) | AGG (bitmap_construct_agg_l((_._0.ID) bitmap_bit_position 10000) AS _0) GROUP BY ((_._0.ID) bitmap_bucket_offset 10000 AS _0) | MAP (_._1._0 AS BITMAP, _._0._0 AS OFFSET)digraph G { +bitmap-agg-index-testsEXPLAIN SELECT bitmap_construct_agg(bitmap_bit_position(id)) as bitmap, bitmap_bucket_offset(id) as offset FROM T2 GROUP BY bitmap_bucket_offset(id) +P (08@ISCAN(AGG_INDEX_1 <,>) | MAP (_ AS _0) | AGG (bitmap_construct_agg_l((_._0.ID) bitmap_bit_position 10000) AS _0) GROUP BY ((_._0.ID) bitmap_bucket_offset 10000 AS _0) | MAP (_._1._0 AS BITMAP, _._0._0 AS OFFSET)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._1._0 AS BITMAP, q6._0._0 AS OFFSET)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(BYTES AS BITMAP, )" ]; - 2 [ label=<
    Streaming Aggregate
    COLLECT (bitmap_construct_agg_l((q47._0.ID) bitmap_bit_position 10000) AS _0)
    GROUP BY ((q47._0.ID) bitmap_bucket_offset 10000 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index
    AGG_INDEX_1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q47> label="q47" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 1 [ label=<
    Value Computation
    MAP (q6._1._0 AS BITMAP, q6._0._0 AS OFFSET)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(BYTES AS BITMAP, LONG AS OFFSET)" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT (bitmap_construct_agg_l((q50._0.ID) bitmap_bit_position 10000) AS _0)
    GROUP BY ((q50._0.ID) bitmap_bucket_offset 10000 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, BYTES AS _0 AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS CATEGORY AS _0)" ]; + 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS CATEGORY)" ]; + 5 [ label=<
    Index
    AGG_INDEX_1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS CATEGORY)" ]; + 3 -> 2 [ label=< q50> label="q50" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +}  -bitmap-agg-index-testsEXPLAIN SELECT bitmap_construct_agg(bitmap_bit_position(id)) as bitmap, category, bitmap_bucket_offset(id) as offset FROM T2 GROUP BY category, bitmap_bucket_offset(id) -L (08@ISCAN(AGG_INDEX_2 <,>) | MAP (_ AS _0) | AGG (bitmap_construct_agg_l((_._0.ID) bitmap_bit_position 10000) AS _0) GROUP BY (_._0.CATEGORY AS _0, (_._0.ID) bitmap_bucket_offset 10000 AS _1) | MAP (_._1._0 AS BITMAP, _._0._0 AS CATEGORY, _._0._1 AS OFFSET)digraph G { +bitmap-agg-index-testsEXPLAIN SELECT bitmap_construct_agg(bitmap_bit_position(id)) as bitmap, category, bitmap_bucket_offset(id) as offset FROM T2 GROUP BY category, bitmap_bucket_offset(id) +P (08@ISCAN(AGG_INDEX_2 <,>) | MAP (_ AS _0) | AGG (bitmap_construct_agg_l((_._0.ID) bitmap_bit_position 10000) AS _0) GROUP BY (_._0.CATEGORY AS _0, (_._0.ID) bitmap_bucket_offset 10000 AS _1) | MAP (_._1._0 AS BITMAP, _._0._0 AS CATEGORY, _._0._1 AS OFFSET)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._1._0 AS BITMAP, q6._0._0 AS CATEGORY, q6._0._1 AS OFFSET)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(BYTES AS BITMAP, )" ]; - 2 [ label=<
    Streaming Aggregate
    COLLECT (bitmap_construct_agg_l((q47._0.ID) bitmap_bit_position 10000) AS _0)
    GROUP BY (q47._0.CATEGORY AS _0, (q47._0.ID) bitmap_bucket_offset 10000 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS _0, AS _0, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index
    AGG_INDEX_2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q47> label="q47" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 1 [ label=<
    Value Computation
    MAP (q6._1._0 AS BITMAP, q6._0._0 AS CATEGORY, q6._0._1 AS OFFSET)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(BYTES AS BITMAP, STRING AS CATEGORY, LONG AS OFFSET)" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT (bitmap_construct_agg_l((q50._0.ID) bitmap_bit_position 10000) AS _0)
    GROUP BY (q50._0.CATEGORY AS _0, (q50._0.ID) bitmap_bucket_offset 10000 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS _0, LONG AS _1 AS _0, BYTES AS _0 AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS CATEGORY AS _0)" ]; + 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS CATEGORY)" ]; + 5 [ label=<
    Index
    AGG_INDEX_2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS CATEGORY)" ]; + 3 -> 2 [ label=< q50> label="q50" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; diff --git a/yaml-tests/src/test/resources/bitmap-aggregate-index.metrics.yaml b/yaml-tests/src/test/resources/bitmap-aggregate-index.metrics.yaml index 24bd06a418..a60c550eae 100644 --- a/yaml-tests/src/test/resources/bitmap-aggregate-index.metrics.yaml +++ b/yaml-tests/src/test/resources/bitmap-aggregate-index.metrics.yaml @@ -1,37 +1,13 @@ bitmap-agg-index-tests: -- query: EXPLAIN SELECT bitmap_construct_agg(bitmap_bit_position(id)) as bitmap, - bitmap_bucket_offset(id) as offset FROM T1 GROUP BY bitmap_bucket_offset(id) - explain: 'AISCAN(BITMAPINDEX1 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | - MAP (_._1 AS BITMAP, _._0 AS OFFSET)' - task_count: 483 - task_total_time_ms: 47 - transform_count: 147 - transform_time_ms: 30 - transform_yield_count: 52 - insert_time_ms: 1 - insert_new_count: 37 - insert_reused_count: 2 -- query: EXPLAIN SELECT bitmap_construct_agg(bitmap_bit_position(id)) as bitmap, - category, bitmap_bucket_offset(id) as offset FROM T1 GROUP BY category, bitmap_bucket_offset(id) - explain: 'AISCAN(BITMAPINDEX2 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: VALUE:[0]]) - | MAP (_._2 AS BITMAP, _._0 AS CATEGORY, _._1 AS OFFSET)' - task_count: 483 - task_total_time_ms: 31 - transform_count: 147 - transform_time_ms: 22 - transform_yield_count: 52 - insert_time_ms: 0 - insert_new_count: 37 - insert_reused_count: 2 - query: EXPLAIN SELECT bitmap_construct_agg(bitmap_bit_position(id)) as bitmap, bitmap_bucket_offset(id) as offset FROM T1 GROUP BY bitmap_bucket_offset(id), bitmap_bucket_offset(id), bitmap_bucket_offset(id) explain: 'AISCAN(BITMAPINDEX1 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS BITMAP, _._0 AS OFFSET)' task_count: 483 - task_total_time_ms: 47 - transform_count: 147 - transform_time_ms: 30 + task_total_time_ms: 62 + transform_count: 154 + transform_time_ms: 45 transform_yield_count: 52 insert_time_ms: 0 insert_new_count: 37 @@ -42,9 +18,9 @@ bitmap-agg-index-tests: explain: 'AISCAN(BITMAPINDEX2 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: VALUE:[0]]) | MAP (_._2 AS BITMAP, _._0 AS CATEGORY, _._1 AS OFFSET)' task_count: 483 - task_total_time_ms: 48 - transform_count: 147 - transform_time_ms: 32 + task_total_time_ms: 73 + transform_count: 154 + transform_time_ms: 55 transform_yield_count: 52 insert_time_ms: 0 insert_new_count: 37 @@ -55,22 +31,8 @@ bitmap-agg-index-tests: bitmap_bit_position 10000) AS _0) GROUP BY ((_._0.ID) bitmap_bucket_offset 10000 AS _0) | MAP (_._1._0 AS BITMAP, _._0._0 AS OFFSET) task_count: 285 - task_total_time_ms: 15 - transform_count: 76 - transform_time_ms: 5 - transform_yield_count: 30 - insert_time_ms: 0 - insert_new_count: 25 - insert_reused_count: 2 -- query: EXPLAIN SELECT bitmap_construct_agg(bitmap_bit_position(id)) as bitmap, - category, bitmap_bucket_offset(id) as offset FROM T2 GROUP BY category, bitmap_bucket_offset(id) - explain: ISCAN(AGG_INDEX_2 <,>) | MAP (_ AS _0) | AGG (bitmap_construct_agg_l((_._0.ID) - bitmap_bit_position 10000) AS _0) GROUP BY (_._0.CATEGORY AS _0, (_._0.ID) - bitmap_bucket_offset 10000 AS _1) | MAP (_._1._0 AS BITMAP, _._0._0 AS CATEGORY, - _._0._1 AS OFFSET) - task_count: 285 - task_total_time_ms: 18 - transform_count: 76 + task_total_time_ms: 16 + transform_count: 80 transform_time_ms: 7 transform_yield_count: 30 insert_time_ms: 0 @@ -83,8 +45,8 @@ bitmap-agg-index-tests: bitmap_bucket_offset 10000 AS _1) | MAP (_._1._0 AS BITMAP, _._0._0 AS CATEGORY, _._0._1 AS OFFSET) task_count: 285 - task_total_time_ms: 18 - transform_count: 76 + task_total_time_ms: 14 + transform_count: 80 transform_time_ms: 7 transform_yield_count: 30 insert_time_ms: 0 diff --git a/yaml-tests/src/test/resources/bitmap-aggregate-index.yamsql b/yaml-tests/src/test/resources/bitmap-aggregate-index.yamsql index 0aedc30da1..899d69e60a 100644 --- a/yaml-tests/src/test/resources/bitmap-aggregate-index.yamsql +++ b/yaml-tests/src/test/resources/bitmap-aggregate-index.yamsql @@ -47,16 +47,16 @@ setup: test_block: name: bitmap-agg-index-tests tests: - - - - query: SELECT bitmap_construct_agg(bitmap_bit_position(id)) as bitmap, bitmap_bucket_offset(id) as offset FROM T1 GROUP BY bitmap_bucket_offset(id) - - explain: "AISCAN(BITMAPINDEX1 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS BITMAP, _._0 AS OFFSET)" - - unorderedResult: [{BITMAP: xStartsWith_1250'060000c', 'OFFSET':0}, {BITMAP: xStartsWith_1250'02', 'OFFSET':10000}] - - - - query: SELECT bitmap_construct_agg(bitmap_bit_position(id)) as bitmap, category, bitmap_bucket_offset(id) as offset FROM T1 GROUP BY category, bitmap_bucket_offset(id) - - explain: "AISCAN(BITMAPINDEX2 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: VALUE:[0]]) | MAP (_._2 AS BITMAP, _._0 AS CATEGORY, _._1 AS OFFSET)" - - unorderedResult: [{BITMAP: xStartsWith_1250'0200004', 'CATEGORY': 'hello', 'OFFSET':0}, - {BITMAP: xStartsWith_1250'02', 'CATEGORY': 'hello', 'OFFSET':10000}, - {BITMAP: xStartsWith_1250'0400008', 'CATEGORY': 'world', 'OFFSET':0}] + #- + # - query: SELECT bitmap_construct_agg(bitmap_bit_position(id)) as bitmap, bitmap_bucket_offset(id) as offset FROM T1 GROUP BY bitmap_bucket_offset(id) + # - explain: "AISCAN(BITMAPINDEX1 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS BITMAP, _._0 AS OFFSET)" + # - unorderedResult: [{BITMAP: xStartsWith_1250'060000c', 'OFFSET':0}, {BITMAP: xStartsWith_1250'02', 'OFFSET':10000}] + #- + # - query: SELECT bitmap_construct_agg(bitmap_bit_position(id)) as bitmap, category, bitmap_bucket_offset(id) as offset FROM T1 GROUP BY category, bitmap_bucket_offset(id) + # - explain: "AISCAN(BITMAPINDEX2 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: VALUE:[0]]) | MAP (_._2 AS BITMAP, _._0 AS CATEGORY, _._1 AS OFFSET)" + # - unorderedResult: [{BITMAP: xStartsWith_1250'0200004', 'CATEGORY': 'hello', 'OFFSET':0}, + # {BITMAP: xStartsWith_1250'02', 'CATEGORY': 'hello', 'OFFSET':10000}, + # {BITMAP: xStartsWith_1250'0400008', 'CATEGORY': 'world', 'OFFSET':0}] - - query: SELECT bitmap_construct_agg(bitmap_bit_position(id)) as bitmap, bitmap_bucket_offset(id) as offset FROM T1 GROUP BY bitmap_bucket_offset(id), bitmap_bucket_offset(id), bitmap_bucket_offset(id) - explain: "AISCAN(BITMAPINDEX1 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS BITMAP, _._0 AS OFFSET)" diff --git a/yaml-tests/src/test/resources/catalog.metrics.binpb b/yaml-tests/src/test/resources/catalog.metrics.binpb index 860b834c71..f9acb0de1c 100644 --- a/yaml-tests/src/test/resources/catalog.metrics.binpb +++ b/yaml-tests/src/test/resources/catalog.metrics.binpb @@ -1,36 +1,36 @@ - +  - catalog-testsEXPLAIN select sum(cnt) from (select count(*) as cnt, template_name, template_version from schemas group by template_name, template_version having template_name = 'TEST_TEMPLATE_1') as t; - (00׍8<@AISCAN(TEMPLATES_COUNT_INDEX [EQUALS promote(@c29 AS STRING)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: VALUE:[0]]) | MAP ((_._2 AS CNT, _._0 AS TEMPLATE_NAME, _._1 AS TEMPLATE_VERSION) AS _0) | AGG (sum_l(_._0.CNT) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { + catalog-testsEXPLAIN select sum(cnt) from (select count(*) as cnt, template_name, template_version from schemas group by template_name, template_version having template_name = 'TEST_TEMPLATE_1') as t; + (00<8<@AISCAN(TEMPLATES_COUNT_INDEX [EQUALS promote(@c29 AS STRING)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: VALUE:[0]]) | MAP ((_._2 AS CNT, _._0 AS TEMPLATE_NAME, _._1 AS TEMPLATE_VERSION) AS _0) | AGG (sum_l(_._0.CNT) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q12._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q12 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q76._0.CNT) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP ((q6._2 AS CNT, q6._0 AS TEMPLATE_NAME, q6._1 AS TEMPLATE_VERSION) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS CNT, AS _0)" ]; - 5 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c29 AS STRING)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS _0, )" ]; - 6 [ label=<
    Index
    TEMPLATES_COUNT_INDEX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS DATABASE_ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q82._0.CNT) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP ((q6._2 AS CNT, q6._0 AS TEMPLATE_NAME, q6._1 AS TEMPLATE_VERSION) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS CNT, STRING AS TEMPLATE_NAME, INT AS TEMPLATE_VERSION AS _0)" ]; + 5 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c29 AS STRING)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS _0, INT AS _1, LONG AS _2)" ]; + 6 [ label=<
    Index
    TEMPLATES_COUNT_INDEX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS DATABASE_ID, STRING AS SCHEMA_NAME, STRING AS TEMPLATE_NAME, INT AS TEMPLATE_VERSION)" ]; 3 -> 2 [ label=< q12> label="q12" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q76> label="q76" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q82> label="q82" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q12> label="q12" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +}  - catalog-testsEXPLAIN select sum(cnt) from (select count(*) as cnt, template_name, template_version from schemas group by template_name, template_version having template_name = 'TEST_TEMPLATE_1' and template_version = 1) as t; -ډ ћ(00"8<@AISCAN(TEMPLATES_COUNT_INDEX [EQUALS promote(@c29 AS STRING), EQUALS promote(@c33 AS INT)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: VALUE:[0]]) | MAP ((_._2 AS CNT, _._0 AS TEMPLATE_NAME, _._1 AS TEMPLATE_VERSION) AS _0) | AGG (sum_l(_._0.CNT) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { + catalog-testsEXPLAIN select sum(cnt) from (select count(*) as cnt, template_name, template_version from schemas group by template_name, template_version having template_name = 'TEST_TEMPLATE_1' and template_version = 1) as t; + (00ה>8<@AISCAN(TEMPLATES_COUNT_INDEX [EQUALS promote(@c29 AS STRING), EQUALS promote(@c33 AS INT)] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: VALUE:[0]]) | MAP ((_._2 AS CNT, _._0 AS TEMPLATE_NAME, _._1 AS TEMPLATE_VERSION) AS _0) | AGG (sum_l(_._0.CNT) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q12._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q12 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q76._0.CNT) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP ((q6._2 AS CNT, q6._0 AS TEMPLATE_NAME, q6._1 AS TEMPLATE_VERSION) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS CNT, AS _0)" ]; - 5 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c29 AS STRING), EQUALS promote(@c33 AS INT)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS _0, )" ]; - 6 [ label=<
    Index
    TEMPLATES_COUNT_INDEX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS DATABASE_ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q82._0.CNT) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP ((q6._2 AS CNT, q6._0 AS TEMPLATE_NAME, q6._1 AS TEMPLATE_VERSION) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS CNT, STRING AS TEMPLATE_NAME, INT AS TEMPLATE_VERSION AS _0)" ]; + 5 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [EQUALS promote(@c29 AS STRING), EQUALS promote(@c33 AS INT)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS _0, INT AS _1, LONG AS _2)" ]; + 6 [ label=<
    Index
    TEMPLATES_COUNT_INDEX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS DATABASE_ID, STRING AS SCHEMA_NAME, STRING AS TEMPLATE_NAME, INT AS TEMPLATE_VERSION)" ]; 3 -> 2 [ label=< q12> label="q12" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q76> label="q76" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q82> label="q82" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q12> label="q12" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; diff --git a/yaml-tests/src/test/resources/catalog.metrics.yaml b/yaml-tests/src/test/resources/catalog.metrics.yaml index 6bf8af359c..50d30b8916 100644 --- a/yaml-tests/src/test/resources/catalog.metrics.yaml +++ b/yaml-tests/src/test/resources/catalog.metrics.yaml @@ -7,11 +7,11 @@ catalog-tests: TEMPLATE_NAME, _._1 AS TEMPLATE_VERSION) AS _0) | AGG (sum_l(_._0.CNT) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)' task_count: 563 - task_total_time_ms: 32 - transform_count: 172 - transform_time_ms: 15 + task_total_time_ms: 48 + transform_count: 179 + transform_time_ms: 27 transform_yield_count: 48 - insert_time_ms: 2 + insert_time_ms: 0 insert_new_count: 60 insert_reused_count: 5 - query: EXPLAIN select sum(cnt) from (select count(*) as cnt, template_name, template_version @@ -22,10 +22,10 @@ catalog-tests: | MAP ((_._2 AS CNT, _._0 AS TEMPLATE_NAME, _._1 AS TEMPLATE_VERSION) AS _0) | AGG (sum_l(_._0.CNT) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)' task_count: 563 - task_total_time_ms: 14 - transform_count: 172 - transform_time_ms: 8 + task_total_time_ms: 51 + transform_count: 179 + transform_time_ms: 32 transform_yield_count: 48 - insert_time_ms: 0 + insert_time_ms: 1 insert_new_count: 60 insert_reused_count: 5 diff --git a/yaml-tests/src/test/resources/composite-aggregates.metrics.binpb b/yaml-tests/src/test/resources/composite-aggregates.metrics.binpb new file mode 100644 index 0000000000..1f184d8d90 --- /dev/null +++ b/yaml-tests/src/test/resources/composite-aggregates.metrics.binpb @@ -0,0 +1,158 @@ + +V +agg-empty-table-tests=EXPLAIN select sum(col2) / count(col2) from T2 group by col1; +ӧ2 ((908@AISCAN(T2_I6 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) ∩ AISCAN(T2_I4 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) COMPARE BY (_._0) WITH q0, q1 RETURN (q0._0 AS _0, q0._1 AS _1, q1._1 AS _2) | MAP (_._1 / _._2 AS _0)digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
    Value Computation
    MAP (q6._1 / q6._2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; + 2 [ label=<
    Intersection
    COMPARE BY (_._0)
    RESULT (q111._0 AS _0, q111._1 AS _1, q113._1 AS _2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2)" ]; + 3 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 5 [ label=<
    Index
    T2_I6
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    T2_I4
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ label=< q111> label="q111" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 2 [ label=< q113> label="q113" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} +d +agg-empty-table-testsKEXPLAIN select sum(col2), count(col2) from T2 where col1 < 2 group by col1; + ҋ(90@8@AISCAN(T2_I6 [[LESS_THAN promote(@c16 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) ∩ AISCAN(T2_I4 [[LESS_THAN promote(@c16 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) COMPARE BY (_._0) WITH q0, q1 RETURN (q0._0 AS _0, q0._1 AS _1, q1._1 AS _2) | MAP (_._1 AS _0, _._2 AS _1)digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
    Value Computation
    MAP (q6._1 AS _0, q6._2 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 2 [ label=<
    Intersection
    COMPARE BY (_._0)
    RESULT (q111._0 AS _0, q111._1 AS _1, q113._1 AS _2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2)" ]; + 3 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[LESS_THAN promote(@c16 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[LESS_THAN promote(@c16 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 5 [ label=<
    Index
    T2_I4
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    T2_I6
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ label=< q113> label="q113" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 2 [ label=< q111> label="q111" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} +k +agg-empty-table-testsREXPLAIN select sum(col2), count(col2) from T2 group by col1 having sum(col2) = 17; + +(:0j8"@AISCAN(T2_I6 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) ∩ AISCAN(T2_I4 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) COMPARE BY (_._0) WITH q0, q1 RETURN (q0._0 AS _0, q0._1 AS _1, q1._1 AS _2) | FILTER _._1 EQUALS promote(@c22 AS LONG) | MAP (_._1 AS _0, _._2 AS _1)digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
    Value Computation
    MAP (q6._1 AS _0, q6._2 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q6._1 EQUALS promote(@c22 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2)" ]; + 3 [ label=<
    Intersection
    COMPARE BY (_._0)
    RESULT (q113._0 AS _0, q113._1 AS _1, q115._1 AS _2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2)" ]; + 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 5 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 6 [ label=<
    Index
    T2_I6
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 7 [ label=<
    Index
    T2_I4
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q113> label="q113" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 3 [ label=< q115> label="q115" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} +z +agg-empty-table-testsaEXPLAIN select sum(col2), count(col2) from T2 where col1 < 2 group by col1 having sum(col2) = 17; +  (:0)8"@AISCAN(T2_I6 [[LESS_THAN promote(@c16 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) ∩ AISCAN(T2_I4 [[LESS_THAN promote(@c16 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) COMPARE BY (_._0) WITH q0, q1 RETURN (q0._0 AS _0, q0._1 AS _1, q1._1 AS _2) | FILTER _._1 EQUALS promote(@c26 AS LONG) | MAP (_._1 AS _0, _._2 AS _1)digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
    Value Computation
    MAP (q6._1 AS _0, q6._2 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q6._1 EQUALS promote(@c26 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2)" ]; + 3 [ label=<
    Intersection
    COMPARE BY (_._0)
    RESULT (q113._0 AS _0, q113._1 AS _1, q115._1 AS _2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2)" ]; + 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[LESS_THAN promote(@c16 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 5 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[LESS_THAN promote(@c16 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 6 [ label=<
    Index
    T2_I6
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 7 [ label=<
    Index
    T2_I4
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q113> label="q113" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 3 [ label=< q115> label="q115" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} +\ +agg-empty-table-testsCEXPLAIN select sum(col1) / count(col1), col2 from T1 group by col2; +愚 +(7085@AISCAN(T1_I2 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) ∩ AISCAN(T1_I1 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: VALUE:[0]]) | AGG sum_l(_._2) GROUP BY (_._0 AS _0) COMPARE BY (_._0) WITH q0, q1 RETURN (q0._0 AS _0, q0._1 AS _1, q1._1 AS _2) | MAP (_._1 / _._2 AS _0, _._0 AS COL2)digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
    Value Computation
    MAP (q6._1 / q6._2 AS _0, q6._0 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS COL2)" ]; + 2 [ label=<
    Intersection
    COMPARE BY (_._0)
    RESULT (q121._0 AS _0, q121._1 AS _1, q123._1 AS _2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2)" ]; + 3 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 4 [ label=<
    Streaming Aggregate
    COLLECT sum_l(q114._2)
    GROUP BY (q114._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 5 [ label=<
    Index
    T1_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 6 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2)" ]; + 7 [ label=<
    Index
    T1_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 3 -> 2 [ label=< q121> label="q121" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 2 [ label=< q123> label="q123" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 4 [ label=< q114> label="q114" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 6 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}$ + +agg-empty-table-testsvEXPLAIN select col2, sum(col1) / count(col1) from T1 where col2 < 2 group by col2 having sum(col1) = 17 order by col2;" + (90R8<@AISCAN(T1_I2 [[LESS_THAN promote(@c18 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) ∩ AISCAN(T1_I1 [[LESS_THAN promote(@c18 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: VALUE:[0]]) | AGG sum_l(_._2) GROUP BY (_._0 AS _0) COMPARE BY (_._0) WITH q0, q1 RETURN (q0._0 AS _0, q0._1 AS _1, q1._1 AS _2) | FILTER _._1 EQUALS promote(@c28 AS LONG) | MAP (_._0 AS COL2, _._1 / _._2 AS _1)digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL2, q6._1 / q6._2 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL2, LONG AS _1)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q6._1 EQUALS promote(@c28 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2)" ]; + 3 [ label=<
    Intersection
    COMPARE BY (_._0)
    RESULT (q124._0 AS _0, q124._1 AS _1, q126._1 AS _2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2)" ]; + 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[LESS_THAN promote(@c18 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 5 [ label=<
    Streaming Aggregate
    COLLECT sum_l(q116._2)
    GROUP BY (q116._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1)" ]; + 6 [ label=<
    Index
    T1_I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 7 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[LESS_THAN promote(@c18 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2)" ]; + 8 [ label=<
    Index
    T1_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q124> label="q124" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 3 [ label=< q126> label="q126" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 5 [ label=< q116> label="q116" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} + +agg-empty-table-testsnEXPLAIN select col2, sum(col1) / count(col1) from T1 where col2 < 2 group by col2, col3 having sum(col1) = 17; +  ɯ (30&8"@AISCAN(T1_I4 [[LESS_THAN promote(@c18 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: VALUE:[0]]) ∩ AISCAN(T1_I1 [[LESS_THAN promote(@c18 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: VALUE:[0]]) COMPARE BY (_._0, _._1) WITH q0, q1 RETURN (q0._0 AS _0, q0._1 AS _1, q0._2 AS _2, q1._2 AS _3) | FILTER _._2 EQUALS promote(@c30 AS LONG) | MAP (_._0 AS COL2, _._2 / _._3 AS _1)digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
    Value Computation
    MAP (q6._0 AS COL2, q6._2 / q6._3 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL2, LONG AS _1)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q6._2 EQUALS promote(@c30 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2, LONG AS _3)" ]; + 3 [ label=<
    Intersection
    COMPARE BY (_._0, _._1)
    RESULT (q95._0 AS _0, q95._1 AS _1, q95._2 AS _2, q97._2 AS _3)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2, LONG AS _3)" ]; + 4 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[LESS_THAN promote(@c18 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2)" ]; + 5 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[LESS_THAN promote(@c18 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2)" ]; + 6 [ label=<
    Index
    T1_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 7 [ label=<
    Index
    T1_I4
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q97> label="q97" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 3 [ label=< q95> label="q95" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} +_ +agg-empty-table-testsFEXPLAIN select col1, min(col2), max(col2) from T3 group by col1, col3; + +(=0А.85@ISCAN(T3_I1 <,>) | MAP (_ AS _0) | AGG (min_l(_._0.COL2) AS _0, max_l(_._0.COL2) AS _1) GROUP BY (_._0.COL1 AS _0, _._0.COL3 AS _1) | MAP (_._0._0 AS COL1, _._1._0 AS _1, _._1._1 AS _2)digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS COL1, q6._1._0 AS _1, q6._1._1 AS _2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, LONG AS _1, LONG AS _2)" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT (min_l(q100._0.COL2) AS _0, max_l(q100._0.COL2) AS _1)
    GROUP BY (q100._0.COL1 AS _0, q100._0.COL3 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1 AS _0, LONG AS _0, LONG AS _1 AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3 AS _0)" ]; + 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 5 [ label=<
    Index
    T3_I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 3 -> 2 [ label=< q100> label="q100" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} \ No newline at end of file diff --git a/yaml-tests/src/test/resources/composite-aggregates.metrics.yaml b/yaml-tests/src/test/resources/composite-aggregates.metrics.yaml new file mode 100644 index 0000000000..1825267eda --- /dev/null +++ b/yaml-tests/src/test/resources/composite-aggregates.metrics.yaml @@ -0,0 +1,112 @@ +agg-empty-table-tests: +- query: EXPLAIN select sum(col2) / count(col2) from T2 group by col1; + explain: 'AISCAN(T2_I6 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) ∩ AISCAN(T2_I4 + <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) COMPARE BY (_._0) WITH q0, q1 + RETURN (q0._0 AS _0, q0._1 AS _1, q1._1 AS _2) | MAP (_._1 / _._2 AS _0)' + task_count: 426 + task_total_time_ms: 105 + transform_count: 138 + transform_time_ms: 84 + transform_yield_count: 57 + insert_time_ms: 3 + insert_new_count: 30 + insert_reused_count: 1 +- query: EXPLAIN select sum(col2), count(col2) from T2 where col1 < 2 group by col1; + explain: 'AISCAN(T2_I6 [[LESS_THAN promote(@c16 AS LONG)]] BY_GROUP -> [_0: KEY:[0], + _1: VALUE:[0]]) ∩ AISCAN(T2_I4 [[LESS_THAN promote(@c16 AS LONG)]] BY_GROUP + -> [_0: KEY:[0], _1: VALUE:[0]]) COMPARE BY (_._0) WITH q0, q1 RETURN (q0._0 + AS _0, q0._1 AS _1, q1._1 AS _2) | MAP (_._1 AS _0, _._2 AS _1)' + task_count: 426 + task_total_time_ms: 45 + transform_count: 140 + transform_time_ms: 37 + transform_yield_count: 57 + insert_time_ms: 1 + insert_new_count: 30 + insert_reused_count: 1 +- query: EXPLAIN select sum(col2), count(col2) from T2 group by col1 having sum(col2) + = 17; + explain: 'AISCAN(T2_I6 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) ∩ AISCAN(T2_I4 + <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) COMPARE BY (_._0) WITH q0, q1 + RETURN (q0._0 AS _0, q0._1 AS _1, q1._1 AS _2) | FILTER _._1 EQUALS promote(@c22 + AS LONG) | MAP (_._1 AS _0, _._2 AS _1)' + task_count: 457 + task_total_time_ms: 30 + transform_count: 145 + transform_time_ms: 21 + transform_yield_count: 58 + insert_time_ms: 1 + insert_new_count: 34 + insert_reused_count: 1 +- query: EXPLAIN select sum(col2), count(col2) from T2 where col1 < 2 group by col1 + having sum(col2) = 17; + explain: 'AISCAN(T2_I6 [[LESS_THAN promote(@c16 AS LONG)]] BY_GROUP -> [_0: KEY:[0], + _1: VALUE:[0]]) ∩ AISCAN(T2_I4 [[LESS_THAN promote(@c16 AS LONG)]] BY_GROUP + -> [_0: KEY:[0], _1: VALUE:[0]]) COMPARE BY (_._0) WITH q0, q1 RETURN (q0._0 + AS _0, q0._1 AS _1, q1._1 AS _2) | FILTER _._1 EQUALS promote(@c26 AS LONG) + | MAP (_._1 AS _0, _._2 AS _1)' + task_count: 457 + task_total_time_ms: 24 + transform_count: 147 + transform_time_ms: 19 + transform_yield_count: 58 + insert_time_ms: 0 + insert_new_count: 34 + insert_reused_count: 1 +- query: EXPLAIN select sum(col1) / count(col1), col2 from T1 group by col2; + explain: 'AISCAN(T1_I2 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) ∩ AISCAN(T1_I1 + <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: VALUE:[0]]) | AGG sum_l(_._2) + GROUP BY (_._0 AS _0) COMPARE BY (_._0) WITH q0, q1 RETURN (q0._0 AS _0, q0._1 + AS _1, q1._1 AS _2) | MAP (_._1 / _._2 AS _0, _._0 AS COL2)' + task_count: 605 + task_total_time_ms: 31 + transform_count: 167 + transform_time_ms: 22 + transform_yield_count: 55 + insert_time_ms: 2 + insert_new_count: 53 + insert_reused_count: 2 +- query: EXPLAIN select col2, sum(col1) / count(col1) from T1 where col2 < 2 group + by col2 having sum(col1) = 17 order by col2; + explain: 'AISCAN(T1_I2 [[LESS_THAN promote(@c18 AS LONG)]] BY_GROUP -> [_0: KEY:[0], + _1: VALUE:[0]]) ∩ AISCAN(T1_I1 [[LESS_THAN promote(@c18 AS LONG)]] BY_GROUP + -> [_0: KEY:[0], _1: KEY:[1], _2: VALUE:[0]]) | AGG sum_l(_._2) GROUP BY (_._0 + AS _0) COMPARE BY (_._0) WITH q0, q1 RETURN (q0._0 AS _0, q0._1 AS _1, q1._1 + AS _2) | FILTER _._1 EQUALS promote(@c28 AS LONG) | MAP (_._0 AS COL2, _._1 + / _._2 AS _1)' + task_count: 656 + task_total_time_ms: 35 + transform_count: 180 + transform_time_ms: 27 + transform_yield_count: 57 + insert_time_ms: 1 + insert_new_count: 60 + insert_reused_count: 2 +- query: EXPLAIN select col2, sum(col1) / count(col1) from T1 where col2 < 2 group + by col2, col3 having sum(col1) = 17; + explain: 'AISCAN(T1_I4 [[LESS_THAN promote(@c18 AS LONG)]] BY_GROUP -> [_0: KEY:[0], + _1: KEY:[1], _2: VALUE:[0]]) ∩ AISCAN(T1_I1 [[LESS_THAN promote(@c18 AS LONG)]] + BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: VALUE:[0]]) COMPARE BY (_._0, _._1) + WITH q0, q1 RETURN (q0._0 AS _0, q0._1 AS _1, q0._2 AS _2, q1._2 AS _3) | + FILTER _._2 EQUALS promote(@c30 AS LONG) | MAP (_._0 AS COL2, _._2 / _._3 + AS _1)' + task_count: 443 + task_total_time_ms: 29 + transform_count: 138 + transform_time_ms: 23 + transform_yield_count: 51 + insert_time_ms: 0 + insert_new_count: 34 + insert_reused_count: 1 +- query: EXPLAIN select col1, min(col2), max(col2) from T3 group by col1, col3; + explain: ISCAN(T3_I1 <,>) | MAP (_ AS _0) | AGG (min_l(_._0.COL2) AS _0, max_l(_._0.COL2) + AS _1) GROUP BY (_._0.COL1 AS _0, _._0.COL3 AS _1) | MAP (_._0._0 AS COL1, + _._1._0 AS _1, _._1._1 AS _2) + task_count: 571 + task_total_time_ms: 30 + transform_count: 164 + transform_time_ms: 22 + transform_yield_count: 61 + insert_time_ms: 0 + insert_new_count: 53 + insert_reused_count: 0 diff --git a/yaml-tests/src/test/resources/composite-aggregates.yamsql b/yaml-tests/src/test/resources/composite-aggregates.yamsql new file mode 100644 index 0000000000..198bbeeb81 --- /dev/null +++ b/yaml-tests/src/test/resources/composite-aggregates.yamsql @@ -0,0 +1,107 @@ +# +# composite-aggregates.yamsql +# +# This source file is part of the FoundationDB open source project +# +# Copyright 2021-2025 Apple Inc. and the FoundationDB project authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +options: + supported_version: !current_version +--- +schema_template: + create table t1(id bigint, col1 bigint, col2 bigint, col3 bigint, primary key(id)) + create table t2(id bigint, col1 bigint, col2 bigint, primary key(id)) + create table t3(id bigint, col1 bigint, col2 bigint, col3 bigint, primary key(id)) + create index t1_i1 as select count(col1) from t1 group by col2, col3 + create index t1_i2 as select col2, sum(col1) from t1 group by col2 + create index t1_i3 as select col3, col2, sum(col1) from t1 group by col3, col2 + create index t1_i4 as select col2, col3, sum(col1) from t1 group by col2, col3 + create index t2_i1 as select count(*) from t2 + create index t2_i2 as select count(*) from t2 group by col1 + create index t2_i3 as select count(col2) from t2 + create index t2_i4 as select count(col2) from t2 group by col1 + create index t2_i5 as select sum(col1) from t2 + create index t2_i6 as select sum(col2) from t2 group by col1 + create index t2_i7 as select count(*) from t2 group by col1, col2 + create index t3_i1 as select col1, max(col2), col3 from T3 group by col1, col3 order by col1, max(col2), col3 + create index t3_i2 as select col1, min(col2), col3 from T3 group by col1, col3 order by col1, min(col2), col3 + +--- +setup: + steps: + - query: INSERT INTO T1 + VALUES (1, 10, 1, 1), + (2, 10, 1, 1), + (3, 10, 1, 2), + (4, 10, 1, 2), + (5, 10, 1, 2), + (6, 20, 6, 1), + (7, 20, 7, 2), + (8, 20, 7, 2), + (9, 20, 7, 3), + (10, 20, 7, 3), + (11, 20, 8, 0), + (12, 20, 8, 0), + (13, 20, 10, 1) + - query: INSERT INTO T2(ID, COL1, COL2, COL3) + VALUES (1, 1, 1, 100), + (2, 1, 1, 1), + (3, 1, 5, 2), + (4, 1, 10, 200), + (5, 2, 10, 200), + (6, 2, 20, 3), + (7, 2, 30, 400), + (8, 2, 40, 400), + (9, 2, 60, 400) + +--- +test_block: + name: agg-empty-table-tests + preset: single_repetition_ordered + tests: + - + - query: select sum(col2) / count(col2) from T2 group by col1; + - explain: "AISCAN(T2_I6 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) ∩ AISCAN(T2_I4 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) COMPARE BY (_._0) WITH q0, q1 RETURN (q0._0 AS _0, q0._1 AS _1, q1._1 AS _2) | MAP (_._1 / _._2 AS _0)" + - result: [{!l 4}, {!l 32}] + - + - query: select sum(col2), count(col2) from T2 where col1 < 2 group by col1; + - explain: "AISCAN(T2_I6 [[LESS_THAN promote(@c16 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) ∩ AISCAN(T2_I4 [[LESS_THAN promote(@c16 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) COMPARE BY (_._0) WITH q0, q1 RETURN (q0._0 AS _0, q0._1 AS _1, q1._1 AS _2) | MAP (_._1 AS _0, _._2 AS _1)" + - result: [{!l 17, !l 4}] + - + - query: select sum(col2), count(col2) from T2 group by col1 having sum(col2) = 17; + - explain: "AISCAN(T2_I6 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) ∩ AISCAN(T2_I4 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) COMPARE BY (_._0) WITH q0, q1 RETURN (q0._0 AS _0, q0._1 AS _1, q1._1 AS _2) | FILTER _._1 EQUALS promote(@c22 AS LONG) | MAP (_._1 AS _0, _._2 AS _1)" + - result: [{!l 17, !l 4}] + - + - query: select sum(col2), count(col2) from T2 where col1 < 2 group by col1 having sum(col2) = 17; + - explain: "AISCAN(T2_I6 [[LESS_THAN promote(@c16 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) ∩ AISCAN(T2_I4 [[LESS_THAN promote(@c16 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) COMPARE BY (_._0) WITH q0, q1 RETURN (q0._0 AS _0, q0._1 AS _1, q1._1 AS _2) | FILTER _._1 EQUALS promote(@c26 AS LONG) | MAP (_._1 AS _0, _._2 AS _1)" + - result: [{!l 17, !l 4}] + - + - query: select sum(col1) / count(col1), col2 from T1 group by col2; + - explain: "AISCAN(T1_I2 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) ∩ AISCAN(T1_I1 <,> BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: VALUE:[0]]) | AGG sum_l(_._2) GROUP BY (_._0 AS _0) COMPARE BY (_._0) WITH q0, q1 RETURN (q0._0 AS _0, q0._1 AS _1, q1._1 AS _2) | MAP (_._1 / _._2 AS _0, _._0 AS COL2)" + - result: [{!l 10, !l 1}, {!l 20, !l 6}, {!l 20, !l 7}, {!l 20, !l 8}, {!l 20, !l 10}] + - + - query: select col2, sum(col1) / count(col1) from T1 where col2 < 2 group by col2 having sum(col1) = 17 order by col2; + - explain: "AISCAN(T1_I2 [[LESS_THAN promote(@c18 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) ∩ AISCAN(T1_I1 [[LESS_THAN promote(@c18 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: VALUE:[0]]) | AGG sum_l(_._2) GROUP BY (_._0 AS _0) COMPARE BY (_._0) WITH q0, q1 RETURN (q0._0 AS _0, q0._1 AS _1, q1._1 AS _2) | FILTER _._1 EQUALS promote(@c28 AS LONG) | MAP (_._0 AS COL2, _._1 / _._2 AS _1)" + - result: [] + - + - query: select col2, sum(col1) / count(col1) from T1 where col2 < 2 group by col2, col3 having sum(col1) = 17; + - explain: "AISCAN(T1_I4 [[LESS_THAN promote(@c18 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: VALUE:[0]]) ∩ AISCAN(T1_I1 [[LESS_THAN promote(@c18 AS LONG)]] BY_GROUP -> [_0: KEY:[0], _1: KEY:[1], _2: VALUE:[0]]) COMPARE BY (_._0, _._1) WITH q0, q1 RETURN (q0._0 AS _0, q0._1 AS _1, q0._2 AS _2, q1._2 AS _3) | FILTER _._2 EQUALS promote(@c30 AS LONG) | MAP (_._0 AS COL2, _._2 / _._3 AS _1)" + - result: [] + - + - query: select col1, min(col2), max(col2) from T3 group by col1, col3; + - explain: "ISCAN(T3_I1 <,>) | MAP (_ AS _0) | AGG (min_l(_._0.COL2) AS _0, max_l(_._0.COL2) AS _1) GROUP BY (_._0.COL1 AS _0, _._0.COL3 AS _1) | MAP (_._0._0 AS COL1, _._1._0 AS _1, _._1._1 AS _2)" + - result: [] +... diff --git a/yaml-tests/src/test/resources/create-drop.metrics.binpb b/yaml-tests/src/test/resources/create-drop.metrics.binpb index b29f6b6378..767160f2aa 100644 --- a/yaml-tests/src/test/resources/create-drop.metrics.binpb +++ b/yaml-tests/src/test/resources/create-drop.metrics.binpb @@ -1,71 +1,69 @@ - + S - unnamed-4FEXPLAIN select count(*) from "TEMPLATES" where template_name = 'TEMP1' ->c &(08$@SCAN(<,>) | TFILTER TEMPLATES | FILTER _.TEMPLATE_NAME EQUALS promote(@c11 AS STRING) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { + unnamed-4FEXPLAIN select count(*) from "TEMPLATES" where template_name = 'TEMP1' +g X(08$@SCAN(<,>) | TFILTER TEMPLATES | FILTER _.TEMPLATE_NAME EQUALS promote(@c11 AS STRING) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q32 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS TEMPLATE_NAME, AS _0)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q2.TEMPLATE_NAME EQUALS promote(@c11 AS STRING)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS TEMPLATE_NAME, )" ]; - 6 [ label=<
    Type Filter
    WHERE record IS [TEMPLATES]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS TEMPLATE_NAME, )" ]; + 4 [ label=<
    Value Computation
    MAP (q34 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS TEMPLATE_NAME, INT AS TEMPLATE_VERSION, BYTES AS META_DATA AS _0)" ]; + 5 [ label=<
    Predicate Filter
    WHERE q2.TEMPLATE_NAME EQUALS promote(@c11 AS STRING)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS TEMPLATE_NAME, INT AS TEMPLATE_VERSION, BYTES AS META_DATA)" ]; + 6 [ label=<
    Type Filter
    WHERE record IS [TEMPLATES]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS TEMPLATE_NAME, INT AS TEMPLATE_VERSION, BYTES AS META_DATA)" ]; 7 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 8 [ label=<
    Primary Storage
    record types: [DATABASES, SCHEMAS, TEMPLATES]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q32> label="q32" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q44> label="q44" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q34> label="q34" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 6 [ label=< q27> label="q27" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; } T unnamed-10FEXPLAIN select count(*) from "DATABASES" where database_id = '/FRL/DB' -j ֵ -(0p8$@SCAN(<,>) | TFILTER DATABASES | FILTER _.DATABASE_ID EQUALS promote(@c11 AS STRING) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +p (0 8$@SCAN(<,>) | TFILTER DATABASES | FILTER _.DATABASE_ID EQUALS promote(@c11 AS STRING) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q40 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS DATABASE_ID AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q42 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS DATABASE_ID AS _0)" ]; 5 [ label=<
    Predicate Filter
    WHERE q2.DATABASE_ID EQUALS promote(@c11 AS STRING)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS DATABASE_ID)" ]; 6 [ label=<
    Type Filter
    WHERE record IS [DATABASES]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS DATABASE_ID)" ]; 7 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 8 [ label=<
    Primary Storage
    record types: [DATABASES, SCHEMAS, TEMPLATES]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q49> label="q49" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q40> label="q40" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q52> label="q52" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q42> label="q42" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q34> label="q34" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 6 [ label=< q35> label="q35" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +}" R -unnamed-20DEXPLAIN select count(*) from "SCHEMAS" where database_id = '/FRL/DB' - -(*08A@COVERING(TEMPLATES_VALUE_INDEX <,> -> [DATABASE_ID: KEY[2], SCHEMA_NAME: KEY[3], TEMPLATE_NAME: KEY[0], TEMPLATE_VERSION: KEY[1]]) | FILTER _.DATABASE_ID EQUALS promote(@c11 AS STRING) | FETCH | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +unnamed-20DEXPLAIN select count(*) from "SCHEMAS" where database_id = '/FRL/DB'" + (-08C@COVERING(TEMPLATES_VALUE_INDEX <,> -> [DATABASE_ID: KEY[2], SCHEMA_NAME: KEY[3], TEMPLATE_NAME: KEY[0], TEMPLATE_VERSION: KEY[1]]) | FILTER _.DATABASE_ID EQUALS promote(@c11 AS STRING) | FETCH | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q57 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS DATABASE_ID, AS _0)" ]; - 5 [ label=<
    Fetch Records
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(STRING AS DATABASE_ID, )" ]; - 6 [ label=<
    Predicate Filter
    WHERE q59.DATABASE_ID EQUALS promote(@c11 AS STRING)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS DATABASE_ID, )" ]; - 7 [ label=<
    Covering Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS DATABASE_ID, )" ]; - 8 [ label=<
    Index
    TEMPLATES_VALUE_INDEX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS DATABASE_ID, )" ]; + 4 [ label=<
    Value Computation
    MAP (q61 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS DATABASE_ID, STRING AS SCHEMA_NAME, STRING AS TEMPLATE_NAME, INT AS TEMPLATE_VERSION AS _0)" ]; + 5 [ label=<
    Fetch Records
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(STRING AS DATABASE_ID, STRING AS SCHEMA_NAME, STRING AS TEMPLATE_NAME, INT AS TEMPLATE_VERSION)" ]; + 6 [ label=<
    Predicate Filter
    WHERE q63.DATABASE_ID EQUALS promote(@c11 AS STRING)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS DATABASE_ID, STRING AS SCHEMA_NAME, STRING AS TEMPLATE_NAME, INT AS TEMPLATE_VERSION)" ]; + 7 [ label=<
    Covering Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS DATABASE_ID, STRING AS SCHEMA_NAME, STRING AS TEMPLATE_NAME, INT AS TEMPLATE_VERSION)" ]; + 8 [ label=<
    Index
    TEMPLATES_VALUE_INDEX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(STRING AS DATABASE_ID, STRING AS SCHEMA_NAME, STRING AS TEMPLATE_NAME, INT AS TEMPLATE_VERSION)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q85> label="q85" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q57> label="q57" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q61> label="q61" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q59> label="q59" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q91> label="q91" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q61> label="q61" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q65> label="q65" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 6 [ label=< q63> label="q63" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; } \ No newline at end of file diff --git a/yaml-tests/src/test/resources/create-drop.metrics.yaml b/yaml-tests/src/test/resources/create-drop.metrics.yaml index 6475968dbf..b9198515e9 100644 --- a/yaml-tests/src/test/resources/create-drop.metrics.yaml +++ b/yaml-tests/src/test/resources/create-drop.metrics.yaml @@ -4,11 +4,11 @@ unnamed-4: AS STRING) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 354 - task_total_time_ms: 130 - transform_count: 99 - transform_time_ms: 81 + task_total_time_ms: 2 + transform_count: 103 + transform_time_ms: 1 transform_yield_count: 22 - insert_time_ms: 10 + insert_time_ms: 0 insert_new_count: 36 insert_reused_count: 3 unnamed-10: @@ -17,11 +17,11 @@ unnamed-10: AS STRING) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 366 - task_total_time_ms: 32 - transform_count: 106 - transform_time_ms: 22 + task_total_time_ms: 3 + transform_count: 112 + transform_time_ms: 2 transform_yield_count: 28 - insert_time_ms: 1 + insert_time_ms: 0 insert_new_count: 36 insert_reused_count: 3 unnamed-20: @@ -31,11 +31,11 @@ unnamed-20: EQUALS promote(@c11 AS STRING) | FETCH | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)' - task_count: 580 - task_total_time_ms: 45 - transform_count: 151 - transform_time_ms: 22 - transform_yield_count: 42 - insert_time_ms: 2 - insert_new_count: 65 + task_count: 586 + task_total_time_ms: 6 + transform_count: 161 + transform_time_ms: 3 + transform_yield_count: 45 + insert_time_ms: 0 + insert_new_count: 67 insert_reused_count: 4 diff --git a/yaml-tests/src/test/resources/cte.metrics.binpb b/yaml-tests/src/test/resources/cte.metrics.binpb index dda4d62e84..621275d149 100644 --- a/yaml-tests/src/test/resources/cte.metrics.binpb +++ b/yaml-tests/src/test/resources/cte.metrics.binpb @@ -1,53 +1,53 @@ - + U - cte-testsHEXPLAIN with c1 as (select col1, col2 from t1) select col1, col2 from c1 -֙GD %(0Η8@cCOVERING(I1 <,> -> [COL1: KEY[1], COL2: KEY[0], ID: KEY[3]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) + cte-testsHEXPLAIN with c1 as (select col1, col2 from t1) select col1, col2 from c1 +)H (08@cCOVERING(I1 <,> -> [COL1: KEY[1], COL2: KEY[0], ID: KEY[3]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q38.COL1 AS COL1, q38.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Covering Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q42.COL1 AS COL1, q42.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, LONG AS COL2)" ]; + 2 [ label=<
    Covering Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q38> label="q38" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q42> label="q42" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} 7 - cte-tests*EXPLAIN select col1 from t1 where col2 < 3 -k ("0ޝ(8-@rCOVERING(I1 [[LESS_THAN promote(@c8 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], ID: KEY[3]]) | MAP (_.COL1 AS COL1) + cte-tests*EXPLAIN select col1 from t1 where col2 < 3 +ͻo ("0ȿ-8-@rCOVERING(I1 [[LESS_THAN promote(@c8 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], ID: KEY[3]]) | MAP (_.COL1 AS COL1) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q53.COL1 AS COL1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1)" ]; - 2 [ label=<
    Covering Index Scan
    comparisons: [[LESS_THAN promote(@c8 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q59.COL1 AS COL1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1)" ]; + 2 [ label=<
    Covering Index Scan
    comparisons: [[LESS_THAN promote(@c8 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q53> label="q53" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q59> label="q59" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} [ - cte-testsNEXPLAIN select x from (select col1 as x, col2 as y from t1) as sub where y < 3 - ('0ԝ<88@pCOVERING(I1 [[LESS_THAN promote(@c21 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], ID: KEY[3]]) | MAP (_.COL1 AS X) + cte-testsNEXPLAIN select x from (select col1 as x, col2 as y from t1) as sub where y < 3 + ('0F88@pCOVERING(I1 [[LESS_THAN promote(@c21 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], ID: KEY[3]]) | MAP (_.COL1 AS X) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q59.COL1 AS X)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X)" ]; - 2 [ label=<
    Covering Index Scan
    comparisons: [[LESS_THAN promote(@c21 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q65.COL1 AS X)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X)" ]; + 2 [ label=<
    Covering Index Scan
    comparisons: [[LESS_THAN promote(@c21 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q59> label="q59" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q65> label="q65" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} ^ - cte-testsQEXPLAIN with c1(x, y) as (select col1, col2 from t1) select x from c1 where y < 3 - ('0=88@pCOVERING(I1 [[LESS_THAN promote(@c24 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], ID: KEY[3]]) | MAP (_.COL1 AS X) + cte-testsQEXPLAIN with c1(x, y) as (select col1, col2 from t1) select x from c1 where y < 3 +ð ('0>88@pCOVERING(I1 [[LESS_THAN promote(@c24 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], ID: KEY[3]]) | MAP (_.COL1 AS X) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q61.COL1 AS X)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X)" ]; - 2 [ label=<
    Covering Index Scan
    comparisons: [[LESS_THAN promote(@c24 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q67.COL1 AS X)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X)" ]; + 2 [ label=<
    Covering Index Scan
    comparisons: [[LESS_THAN promote(@c24 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q61> label="q61" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q67> label="q67" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; } \ No newline at end of file diff --git a/yaml-tests/src/test/resources/cte.metrics.yaml b/yaml-tests/src/test/resources/cte.metrics.yaml index 487a3108a4..1a79fe79bb 100644 --- a/yaml-tests/src/test/resources/cte.metrics.yaml +++ b/yaml-tests/src/test/resources/cte.metrics.yaml @@ -3,19 +3,19 @@ cte-tests: explain: 'COVERING(I1 <,> -> [COL1: KEY[1], COL2: KEY[0], ID: KEY[3]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2)' task_count: 267 - task_total_time_ms: 150 - transform_count: 68 - transform_time_ms: 79 + task_total_time_ms: 87 + transform_count: 72 + transform_time_ms: 59 transform_yield_count: 27 - insert_time_ms: 8 + insert_time_ms: 6 insert_new_count: 29 insert_reused_count: 5 - query: EXPLAIN select col1 from t1 where col2 < 3 explain: 'COVERING(I1 [[LESS_THAN promote(@c8 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], ID: KEY[3]]) | MAP (_.COL1 AS COL1)' task_count: 439 - task_total_time_ms: 10 - transform_count: 107 + task_total_time_ms: 12 + transform_count: 111 transform_time_ms: 5 transform_yield_count: 34 insert_time_ms: 0 @@ -26,11 +26,11 @@ cte-tests: explain: 'COVERING(I1 [[LESS_THAN promote(@c21 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], ID: KEY[3]]) | MAP (_.COL1 AS X)' task_count: 498 - task_total_time_ms: 14 - transform_count: 134 - transform_time_ms: 6 + task_total_time_ms: 11 + transform_count: 138 + transform_time_ms: 5 transform_yield_count: 39 - insert_time_ms: 0 + insert_time_ms: 1 insert_new_count: 56 insert_reused_count: 7 - query: EXPLAIN with c1(x, y) as (select col1, col2 from t1) select x from c1 where @@ -38,8 +38,8 @@ cte-tests: explain: 'COVERING(I1 [[LESS_THAN promote(@c24 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], ID: KEY[3]]) | MAP (_.COL1 AS X)' task_count: 498 - task_total_time_ms: 12 - transform_count: 134 + task_total_time_ms: 11 + transform_count: 138 transform_time_ms: 5 transform_yield_count: 39 insert_time_ms: 1 diff --git a/yaml-tests/src/test/resources/field-index-tests-proto.metrics.binpb b/yaml-tests/src/test/resources/field-index-tests-proto.metrics.binpb index 8086ddb44a..2a53e76444 100644 --- a/yaml-tests/src/test/resources/field-index-tests-proto.metrics.binpb +++ b/yaml-tests/src/test/resources/field-index-tests-proto.metrics.binpb @@ -1,54 +1,55 @@ - +  -field-index-tests-prototEXPLAIN select count(*) from (select * from (select * from (select * from "MyTable" where ID = 5) as x) as y) as z; -Ėq ~(08&@SCAN([EQUALS promote(@c23 AS LONG)]) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +field-index-tests-prototEXPLAIN select count(*) from (select * from (select * from (select * from "MyTable" where ID = 5) as x) as y) as z; +͍u (08&@SCAN([EQUALS promote(@c23 AS LONG)]) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q12._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q12 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Scan
    comparisons: [EQUALS promote(@c23 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Primary Storage
    record types: [MyTable]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL31, LONG AS COL32, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Scan
    comparisons: [EQUALS promote(@c23 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL31, LONG AS COL32, LONG AS COL2)" ]; + 6 [ label=<
    Primary Storage
    record types: [MyTable]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL31, LONG AS COL32, LONG AS COL2)" ]; 3 -> 2 [ label=< q12> label="q12" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q40> label="q40" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q43> label="q43" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q12> label="q12" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} C -field-index-tests-proto(EXPLAIN select sum(COL1) from "MyTable"; -? l(0 8@^SCAN(<,>) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +field-index-tests-proto(EXPLAIN select sum(COL1) from "MyTable"; +ѵC j(0ۯ 8@^SCAN(<,>) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q28._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Primary Storage
    record types: [MyTable]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q31._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL31, LONG AS COL32, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL31, LONG AS COL32, LONG AS COL2)" ]; + 6 [ label=<
    Primary Storage
    record types: [MyTable]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL31, LONG AS COL32, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q28> label="q28" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q31> label="q31" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} E -field-index-tests-proto*EXPLAIN select count(COL1) from "MyTable"; -? e(0 8@SCAN(<,>) | MAP (_ AS _0) | AGG (count(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +field-index-tests-proto*EXPLAIN select count(COL1) from "MyTable"; +̿C V(0 +8@SCAN(<,>) | MAP (_ AS _0) | AGG (count(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q28._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Primary Storage
    record types: [MyTable]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q31._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL31, LONG AS COL32, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL31, LONG AS COL32, LONG AS COL2)" ]; + 6 [ label=<
    Primary Storage
    record types: [MyTable]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL31, LONG AS COL32, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q28> label="q28" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q31> label="q31" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; diff --git a/yaml-tests/src/test/resources/field-index-tests-proto.metrics.yaml b/yaml-tests/src/test/resources/field-index-tests-proto.metrics.yaml index 93fff2b133..454d061ac1 100644 --- a/yaml-tests/src/test/resources/field-index-tests-proto.metrics.yaml +++ b/yaml-tests/src/test/resources/field-index-tests-proto.metrics.yaml @@ -5,9 +5,9 @@ field-index-tests-proto: AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 375 - task_total_time_ms: 5 - transform_count: 113 - transform_time_ms: 2 + task_total_time_ms: 12 + transform_count: 117 + transform_time_ms: 3 transform_yield_count: 25 insert_time_ms: 0 insert_new_count: 38 @@ -16,8 +16,8 @@ field-index-tests-proto: explain: SCAN(<,>) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0) task_count: 247 - task_total_time_ms: 8 - transform_count: 63 + task_total_time_ms: 7 + transform_count: 67 transform_time_ms: 1 transform_yield_count: 17 insert_time_ms: 0 @@ -27,8 +27,8 @@ field-index-tests-proto: explain: SCAN(<,>) | MAP (_ AS _0) | AGG (count(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 247 - task_total_time_ms: 8 - transform_count: 63 + task_total_time_ms: 7 + transform_count: 67 transform_time_ms: 1 transform_yield_count: 17 insert_time_ms: 0 diff --git a/yaml-tests/src/test/resources/groupby-tests.metrics.binpb b/yaml-tests/src/test/resources/groupby-tests.metrics.binpb index ae9e082d64..bcef0e005f 100644 --- a/yaml-tests/src/test/resources/groupby-tests.metrics.binpb +++ b/yaml-tests/src/test/resources/groupby-tests.metrics.binpb @@ -1,140 +1,140 @@ - + b -group-by-testsPEXPLAIN select AVG(x.col2) from (select col1,col2 from t1) as x group by x.col1; -ĘR (08@ISCAN(I1 <,>) | MAP ((_.COL1 AS COL1, _.COL2 AS COL2) AS _0) | AGG (avg_l(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0)digraph G { +group-by-testsPEXPLAIN select AVG(x.col2) from (select col1,col2 from t1) as x group by x.col1; +ΰV (08@ISCAN(I1 <,>) | MAP ((_.COL1 AS COL1, _.COL2 AS COL2) AS _0) | AGG (avg_l(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q8._1._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(DOUBLE AS _0)" ]; - 2 [ label=<
    Streaming Aggregate
    COLLECT (avg_l(q44._0.COL2) AS _0)
    GROUP BY (q44._0.COL1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, )" ]; - 3 [ label=<
    Value Computation
    MAP ((q2.COL1 AS COL1, q2.COL2 AS COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, AS _0)" ]; - 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q44> label="q44" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT (avg_l(q47._0.COL2) AS _0)
    GROUP BY (q47._0.COL1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, DOUBLE AS _0 AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP ((q2.COL1 AS COL1, q2.COL2 AS COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, LONG AS COL2 AS _0)" ]; + 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 5 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ label=< q47> label="q47" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q8> label="q8" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +}  -group-by-testsmEXPLAIN select SUM(x.col2) / COUNT(x.col2), AVG(x.col2) from (select col1,col2 from t1) as x group by x.col1; -R Ǥ(08@ISCAN(I1 <,>) | MAP ((_.COL1 AS COL1, _.COL2 AS COL2) AS _0) | AGG (sum_l(_._0.COL2) AS _0, count(_._0.COL2) AS _1, avg_l(_._0.COL2) AS _2) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 / _._1._1 AS _0, _._1._2 AS _1)digraph G { +group-by-testsmEXPLAIN select SUM(x.col2) / COUNT(x.col2), AVG(x.col2) from (select col1,col2 from t1) as x group by x.col1; +V (0Ơ.8@ISCAN(I1 <,>) | MAP ((_.COL1 AS COL1, _.COL2 AS COL2) AS _0) | AGG (sum_l(_._0.COL2) AS _0, count(_._0.COL2) AS _1, avg_l(_._0.COL2) AS _2) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 / _._1._1 AS _0, _._1._2 AS _1)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q8._1._0 / q8._1._1 AS _0, q8._1._2 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 2 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q44._0.COL2) AS _0, count(q44._0.COL2) AS _1, avg_l(q44._0.COL2) AS _2)
    GROUP BY (q44._0.COL1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, )" ]; - 3 [ label=<
    Value Computation
    MAP ((q2.COL1 AS COL1, q2.COL2 AS COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, AS _0)" ]; - 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q44> label="q44" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 1 [ label=<
    Value Computation
    MAP (q8._1._0 / q8._1._1 AS _0, q8._1._2 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, DOUBLE AS _1)" ]; + 2 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q47._0.COL2) AS _0, count(q47._0.COL2) AS _1, avg_l(q47._0.COL2) AS _2)
    GROUP BY (q47._0.COL1 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0, LONG AS _0, LONG AS _1, DOUBLE AS _2 AS _1)" ]; + 3 [ label=<
    Value Computation
    MAP ((q2.COL1 AS COL1, q2.COL2 AS COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, LONG AS COL2 AS _0)" ]; + 4 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 5 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ label=< q47> label="q47" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q8> label="q8" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} R -group-by-tests@EXPLAIN select MAX(x.col2) from (select col1,col2 from t1) as x; -X (0#8(@ISCAN(I1 <,>) | MAP ((_.COL1 AS COL1, _.COL2 AS COL2) AS _0) | AGG (max_l(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +group-by-tests@EXPLAIN select MAX(x.col2) from (select col1,col2 from t1) as x; +\ Ȫ(08(@ISCAN(I1 <,>) | MAP ((_.COL1 AS COL1, _.COL2 AS COL2) AS _0) | AGG (max_l(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q8._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q8 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (max_l(q57._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP ((q2.COL1 AS COL1, q2.COL2 AS COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, AS _0)" ]; - 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (max_l(q63._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP ((q2.COL1 AS COL1, q2.COL2 AS COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q8> label="q8" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q57> label="q57" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q63> label="q63" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q8> label="q8" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} R -group-by-tests@EXPLAIN select MIN(x.col2) from (select col1,col2 from t1) as x; -نX ˳(0&8(@ISCAN(I1 <,>) | MAP ((_.COL1 AS COL1, _.COL2 AS COL2) AS _0) | AGG (min_l(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +group-by-tests@EXPLAIN select MIN(x.col2) from (select col1,col2 from t1) as x; + \ (08(@ISCAN(I1 <,>) | MAP ((_.COL1 AS COL1, _.COL2 AS COL2) AS _0) | AGG (min_l(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q8._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q8 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (min_l(q57._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP ((q2.COL1 AS COL1, q2.COL2 AS COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, AS _0)" ]; - 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (min_l(q63._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP ((q2.COL1 AS COL1, q2.COL2 AS COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q8> label="q8" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q57> label="q57" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q63> label="q63" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q8> label="q8" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} T -group-by-testsBEXPLAIN select COUNT(x.col2) from (select col1,col2 from t1) as x; -X ޽(0 8(@ISCAN(I1 <,>) | MAP ((_.COL1 AS COL1, _.COL2 AS COL2) AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +group-by-testsBEXPLAIN select COUNT(x.col2) from (select col1,col2 from t1) as x; +\ (0ђ8(@ISCAN(I1 <,>) | MAP ((_.COL1 AS COL1, _.COL2 AS COL2) AS _0) | AGG (count(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q8._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q8 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q57._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP ((q2.COL1 AS COL1, q2.COL2 AS COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, AS _0)" ]; - 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q63._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP ((q2.COL1 AS COL1, q2.COL2 AS COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q8> label="q8" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q57> label="q57" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q63> label="q63" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q8> label="q8" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} R -group-by-tests@EXPLAIN select AVG(x.col2) from (select col1,col2 from t1) as x; -X (08(@ISCAN(I1 <,>) | MAP ((_.COL1 AS COL1, _.COL2 AS COL2) AS _0) | AGG (avg_l(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { +group-by-tests@EXPLAIN select AVG(x.col2) from (select col1,col2 from t1) as x; +\ ɮ(08(@ISCAN(I1 <,>) | MAP ((_.COL1 AS COL1, _.COL2 AS COL2) AS _0) | AGG (avg_l(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q8._0._0 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(DOUBLE AS _0)" ]; 2 [ label=<
    Value Computation
    $q8 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(DOUBLE AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (avg_l(q57._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(DOUBLE AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP ((q2.COL1 AS COL1, q2.COL2 AS COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, AS _0)" ]; - 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (avg_l(q63._0.COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(DOUBLE AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP ((q2.COL1 AS COL1, q2.COL2 AS COL2) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q8> label="q8" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q57> label="q57" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q63> label="q63" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q8> label="q8" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} 2 -group-by-tests EXPLAIN select COUNT(*) from T1; -N (08$@ISCAN(I1 <,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +group-by-tests EXPLAIN select COUNT(*) from T1; +R (08$@ISCAN(I1 <,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q54> label="q54" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q60> label="q60" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} 5 -group-by-tests#EXPLAIN select COUNT(col1) from T1; -јN (08$@ISCAN(I1 <,>) | MAP (_ AS _0) | AGG (count(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +group-by-tests#EXPLAIN select COUNT(col1) from T1; +ݿR ۉ(08$@ISCAN(I1 <,>) | MAP (_ AS _0) | AGG (count(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q54._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (count(q60._0.COL1) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q54> label="q54" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q60> label="q60" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; diff --git a/yaml-tests/src/test/resources/groupby-tests.metrics.yaml b/yaml-tests/src/test/resources/groupby-tests.metrics.yaml index ad70cd6dfb..a2d7cb1786 100644 --- a/yaml-tests/src/test/resources/groupby-tests.metrics.yaml +++ b/yaml-tests/src/test/resources/groupby-tests.metrics.yaml @@ -4,9 +4,9 @@ group-by-tests: explain: ISCAN(I1 <,>) | MAP ((_.COL1 AS COL1, _.COL2 AS COL2) AS _0) | AGG (avg_l(_._0.COL2) AS _0) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 AS _0) task_count: 299 - task_total_time_ms: 12 - transform_count: 82 - transform_time_ms: 4 + task_total_time_ms: 9 + transform_count: 86 + transform_time_ms: 5 transform_yield_count: 26 insert_time_ms: 0 insert_new_count: 29 @@ -17,9 +17,9 @@ group-by-tests: AS _0, count(_._0.COL2) AS _1, avg_l(_._0.COL2) AS _2) GROUP BY (_._0.COL1 AS _0) | MAP (_._1._0 / _._1._1 AS _0, _._1._2 AS _1) task_count: 299 - task_total_time_ms: 6 - transform_count: 82 - transform_time_ms: 2 + task_total_time_ms: 11 + transform_count: 86 + transform_time_ms: 3 transform_yield_count: 26 insert_time_ms: 0 insert_new_count: 29 @@ -28,9 +28,9 @@ group-by-tests: explain: ISCAN(I1 <,>) | MAP ((_.COL1 AS COL1, _.COL2 AS COL2) AS _0) | AGG (max_l(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0) task_count: 358 - task_total_time_ms: 13 - transform_count: 88 - transform_time_ms: 4 + task_total_time_ms: 8 + transform_count: 92 + transform_time_ms: 2 transform_yield_count: 29 insert_time_ms: 0 insert_new_count: 40 @@ -39,11 +39,11 @@ group-by-tests: explain: ISCAN(I1 <,>) | MAP ((_.COL1 AS COL1, _.COL2 AS COL2) AS _0) | AGG (min_l(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0) task_count: 358 - task_total_time_ms: 14 - transform_count: 88 - transform_time_ms: 5 + task_total_time_ms: 20 + transform_count: 92 + transform_time_ms: 6 transform_yield_count: 29 - insert_time_ms: 0 + insert_time_ms: 3 insert_new_count: 40 insert_reused_count: 5 - query: EXPLAIN select COUNT(x.col2) from (select col1,col2 from t1) as x; @@ -51,19 +51,8 @@ group-by-tests: AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 358 - task_total_time_ms: 11 - transform_count: 88 - transform_time_ms: 4 - transform_yield_count: 29 - insert_time_ms: 0 - insert_new_count: 40 - insert_reused_count: 5 -- query: EXPLAIN select AVG(x.col2) from (select col1,col2 from t1) as x; - explain: ISCAN(I1 <,>) | MAP ((_.COL1 AS COL1, _.COL2 AS COL2) AS _0) | AGG (avg_l(_._0.COL2) - AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0) - task_count: 358 - task_total_time_ms: 5 - transform_count: 88 + task_total_time_ms: 9 + transform_count: 92 transform_time_ms: 2 transform_yield_count: 29 insert_time_ms: 0 @@ -73,9 +62,9 @@ group-by-tests: explain: ISCAN(I1 <,>) | MAP ((_.COL1 AS COL1, _.COL2 AS COL2) AS _0) | AGG (avg_l(_._0.COL2) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS _0) task_count: 358 - task_total_time_ms: 5 - transform_count: 88 - transform_time_ms: 2 + task_total_time_ms: 10 + transform_count: 92 + transform_time_ms: 5 transform_yield_count: 29 insert_time_ms: 0 insert_new_count: 40 @@ -85,29 +74,7 @@ group-by-tests: NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 332 task_total_time_ms: 12 - transform_count: 78 - transform_time_ms: 4 - transform_yield_count: 27 - insert_time_ms: 0 - insert_new_count: 36 - insert_reused_count: 4 -- query: EXPLAIN select COUNT(*) from T1; - explain: ISCAN(I1 <,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY - NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) - task_count: 332 - task_total_time_ms: 12 - transform_count: 78 - transform_time_ms: 4 - transform_yield_count: 27 - insert_time_ms: 0 - insert_new_count: 36 - insert_reused_count: 4 -- query: EXPLAIN select COUNT(col1) from T1; - explain: ISCAN(I1 <,>) | MAP (_ AS _0) | AGG (count(_._0.COL1) AS _0) | ON EMPTY - NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) - task_count: 332 - task_total_time_ms: 11 - transform_count: 78 + transform_count: 82 transform_time_ms: 3 transform_yield_count: 27 insert_time_ms: 0 @@ -117,9 +84,9 @@ group-by-tests: explain: ISCAN(I1 <,>) | MAP (_ AS _0) | AGG (count(_._0.COL1) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 332 - task_total_time_ms: 11 - transform_count: 78 - transform_time_ms: 3 + task_total_time_ms: 7 + transform_count: 82 + transform_time_ms: 4 transform_yield_count: 27 insert_time_ms: 0 insert_new_count: 36 diff --git a/yaml-tests/src/test/resources/indexed-functions.metrics.binpb b/yaml-tests/src/test/resources/indexed-functions.metrics.binpb index ed2d5c65f7..16d951a19c 100644 --- a/yaml-tests/src/test/resources/indexed-functions.metrics.binpb +++ b/yaml-tests/src/test/resources/indexed-functions.metrics.binpb @@ -1,47 +1,57 @@ - + 5 - unnamed-2(EXPLAIN select * from t where b + c > 7; - (C0ׄ8H@ -4ISCAN(BPLUSC [[GREATER_THAN promote(@c10 AS LONG)]])digraph G { + unnamed-2(EXPLAIN select * from t where b + c > 7; + (C0z8H@ +4ISCAN(BPLUSC [[GREATER_THAN promote(@c10 AS LONG)]])digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN promote(@c10 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, )" ]; - 2 [ label=<
    Index
    BPLUSC
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, )" ]; + 1 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN promote(@c10 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B, LONG AS C, LONG AS D, STRING AS E)" ]; + 2 [ label=<
    Index
    BPLUSC
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B, LONG AS C, LONG AS D, STRING AS E)" ]; 2 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} T - unnamed-2GEXPLAIN select a, b + c AS sum from t where e = 'alpha' order by b + c; -w (00=8'@TISCAN(BPLUSCBYE [EQUALS promote(@c14 AS STRING)]) | MAP (_.A AS A, _.B + _.C AS SUM) + unnamed-2GEXPLAIN select a, b + c AS sum from t where e = 'alpha' order by b + c; + { ł(00E8'@TISCAN(BPLUSCBYE [EQUALS promote(@c14 AS STRING)]) | MAP (_.A AS A, _.B + _.C AS SUM) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q2.A AS A, q2.B + q2.C AS SUM)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, )" ]; - 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c14 AS STRING)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, )" ]; - 3 [ label=<
    Index
    BPLUSCBYE
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, )" ]; + 1 [ label=<
    Value Computation
    MAP (q2.A AS A, q2.B + q2.C AS SUM)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS SUM)" ]; + 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c14 AS STRING)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B, LONG AS C, LONG AS D, STRING AS E)" ]; + 3 [ label=<
    Index
    BPLUSCBYE
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B, LONG AS C, LONG AS D, STRING AS E)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} 5 - unnamed-2(EXPLAIN select * from t where d & 1 = 0; -% (C0ۚ8H@ -,ISCAN(DMASK1 [EQUALS promote(@c10 AS LONG)])digraph G { + unnamed-2(EXPLAIN select * from t where d & 1 = 0; + (A0șv8G@ZISCAN(DMASK1 [EQUALS promote(@c10 AS LONG)]) ∩ SCAN(<,>) COMPARE BY (recordType(_), _.A)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c10 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, )" ]; - 2 [ label=<
    Index
    DMASK1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, )" ]; - 2 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 1 [ label=<
    Intersection
    COMPARE BY (recordType(_), _.A)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B, LONG AS C, LONG AS D, STRING AS E)" ]; + 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c10 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B, LONG AS C, LONG AS D, STRING AS E)" ]; + 3 [ label=<
    Index
    DMASK1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B, LONG AS C, LONG AS D, STRING AS E)" ]; + 4 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B, LONG AS C, LONG AS D, STRING AS E)" ]; + 5 [ label=<
    Primary Storage
    record types: [T]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B, LONG AS C, LONG AS D, STRING AS E)" ]; + 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q108> label="q108" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 1 [ label=< q110> label="q110" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} 5 - unnamed-2(EXPLAIN select * from t where d & 2 = 0; - (C0P8H@ -,ISCAN(DMASK2 [EQUALS promote(@c10 AS LONG)])digraph G { + unnamed-2(EXPLAIN select * from t where d & 2 = 0; + (A0ʦz8G@ZISCAN(DMASK2 [EQUALS promote(@c10 AS LONG)]) ∩ SCAN(<,>) COMPARE BY (recordType(_), _.A)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c10 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, )" ]; - 2 [ label=<
    Index
    DMASK2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, )" ]; - 2 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 1 [ label=<
    Intersection
    COMPARE BY (recordType(_), _.A)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B, LONG AS C, LONG AS D, STRING AS E)" ]; + 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c10 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B, LONG AS C, LONG AS D, STRING AS E)" ]; + 3 [ label=<
    Index
    DMASK2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B, LONG AS C, LONG AS D, STRING AS E)" ]; + 4 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B, LONG AS C, LONG AS D, STRING AS E)" ]; + 5 [ label=<
    Primary Storage
    record types: [T]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B, LONG AS C, LONG AS D, STRING AS E)" ]; + 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q108> label="q108" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 1 [ label=< q110> label="q110" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; } \ No newline at end of file diff --git a/yaml-tests/src/test/resources/indexed-functions.metrics.yaml b/yaml-tests/src/test/resources/indexed-functions.metrics.yaml index 9a90150a1c..3c6fb65906 100644 --- a/yaml-tests/src/test/resources/indexed-functions.metrics.yaml +++ b/yaml-tests/src/test/resources/indexed-functions.metrics.yaml @@ -2,9 +2,9 @@ unnamed-2: - query: EXPLAIN select * from t where b + c > 7; explain: ISCAN(BPLUSC [[GREATER_THAN promote(@c10 AS LONG)]]) task_count: 608 - task_total_time_ms: 65 - transform_count: 149 - transform_time_ms: 25 + task_total_time_ms: 47 + transform_count: 153 + transform_time_ms: 20 transform_yield_count: 67 insert_time_ms: 2 insert_new_count: 72 @@ -14,29 +14,31 @@ unnamed-2: + _.C AS SUM) task_count: 386 task_total_time_ms: 29 - transform_count: 119 + transform_count: 123 transform_time_ms: 13 transform_yield_count: 48 insert_time_ms: 1 insert_new_count: 39 insert_reused_count: 3 - query: EXPLAIN select * from t where d & 1 = 0; - explain: ISCAN(DMASK1 [EQUALS promote(@c10 AS LONG)]) - task_count: 608 - task_total_time_ms: 78 - transform_count: 150 - transform_time_ms: 53 - transform_yield_count: 67 - insert_time_ms: 4 - insert_new_count: 72 - insert_reused_count: 10 -- query: EXPLAIN select * from t where d & 2 = 0; - explain: ISCAN(DMASK2 [EQUALS promote(@c10 AS LONG)]) - task_count: 608 - task_total_time_ms: 38 - transform_count: 150 - transform_time_ms: 9 - transform_yield_count: 67 + explain: ISCAN(DMASK1 [EQUALS promote(@c10 AS LONG)]) ∩ SCAN(<,>) COMPARE BY (recordType(_), + _.A) + task_count: 607 + task_total_time_ms: 47 + transform_count: 151 + transform_time_ms: 20 + transform_yield_count: 65 insert_time_ms: 1 - insert_new_count: 72 - insert_reused_count: 10 + insert_new_count: 71 + insert_reused_count: 8 +- query: EXPLAIN select * from t where d & 2 = 0; + explain: ISCAN(DMASK2 [EQUALS promote(@c10 AS LONG)]) ∩ SCAN(<,>) COMPARE BY (recordType(_), + _.A) + task_count: 607 + task_total_time_ms: 47 + transform_count: 151 + transform_time_ms: 20 + transform_yield_count: 65 + insert_time_ms: 2 + insert_new_count: 71 + insert_reused_count: 8 diff --git a/yaml-tests/src/test/resources/indexed-functions.yamsql b/yaml-tests/src/test/resources/indexed-functions.yamsql index 6192e0b53d..574850ed98 100644 --- a/yaml-tests/src/test/resources/indexed-functions.yamsql +++ b/yaml-tests/src/test/resources/indexed-functions.yamsql @@ -88,7 +88,7 @@ test_block: ] - - query: select * from t where d & 1 = 0; - - explain: "ISCAN(DMASK1 [EQUALS promote(@c10 AS LONG)])" + - explain: "ISCAN(DMASK1 [EQUALS promote(@c10 AS LONG)]) ∩ SCAN(<,>) COMPARE BY (recordType(_), _.A)" - unorderedResult: [ {A: 2, B: 2, C: 8, D: 2, E: 'beta'}, {A: 4, B: 4, C: 4, D: 0, E: 'beta'}, @@ -107,7 +107,7 @@ test_block: ] - - query: select * from t where d & 2 = 0; - - explain: "ISCAN(DMASK2 [EQUALS promote(@c10 AS LONG)])" + - explain: "ISCAN(DMASK2 [EQUALS promote(@c10 AS LONG)]) ∩ SCAN(<,>) COMPARE BY (recordType(_), _.A)" - unorderedResult: [ {A: 3, B: 3, C: 6, D: 1, E: 'alpha'}, {A: 4, B: 4, C: 4, D: 0, E: 'beta'}, diff --git a/yaml-tests/src/test/resources/literal-tests.metrics.binpb b/yaml-tests/src/test/resources/literal-tests.metrics.binpb index 08c5157de7..88025d669e 100644 --- a/yaml-tests/src/test/resources/literal-tests.metrics.binpb +++ b/yaml-tests/src/test/resources/literal-tests.metrics.binpb @@ -1,122 +1,119 @@ - + @ - unnamed-33EXPLAIN select * from B where 6L = coalesce(5L, 6L) - -а/. '(0q8@6SCAN(<,>) | FILTER @c6 EQUALS coalesce_long(@c10, @c6) + unnamed-33EXPLAIN select * from B where 6L = coalesce(5L, 6L) +2 (08@6SCAN(<,>) | FILTER coalesce_long(@c10, @c6) EQUALS @c6 digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Predicate Filter
    WHERE @c6 EQUALS coalesce_long(@c10, @c6)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, )" ]; - 2 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, )" ]; - 3 [ label=<
    Primary Storage
    record types: [B]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, )" ]; + 1 [ label=<
    Predicate Filter
    WHERE coalesce_long(@c10, @c6) EQUALS @c6
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; + 2 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; + 3 [ label=<
    Primary Storage
    record types: [B]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} = - unnamed-30EXPLAIN select * from B where 6 = coalesce(5, 6) - -. (0(8@5SCAN(<,>) | FILTER @c6 EQUALS coalesce_int(@c10, @c6) + unnamed-30EXPLAIN select * from B where 6 = coalesce(5, 6) +ޏ2 V(08@5SCAN(<,>) | FILTER coalesce_int(@c10, @c6) EQUALS @c6 digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Predicate Filter
    WHERE @c6 EQUALS coalesce_int(@c10, @c6)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, )" ]; - 2 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, )" ]; - 3 [ label=<
    Primary Storage
    record types: [B]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, )" ]; + 1 [ label=<
    Predicate Filter
    WHERE coalesce_int(@c10, @c6) EQUALS @c6
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; + 2 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; + 3 [ label=<
    Primary Storage
    record types: [B]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} @ - unnamed-43EXPLAIN select * from B where 6L = coalesce(5L, 6L) - -а/. '(0q8@6SCAN(<,>) | FILTER @c6 EQUALS coalesce_long(@c10, @c6) + unnamed-43EXPLAIN select * from B where 6L = coalesce(5L, 6L) +2 (08@6SCAN(<,>) | FILTER coalesce_long(@c10, @c6) EQUALS @c6 digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Predicate Filter
    WHERE @c6 EQUALS coalesce_long(@c10, @c6)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, )" ]; - 2 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, )" ]; - 3 [ label=<
    Primary Storage
    record types: [B]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, )" ]; + 1 [ label=<
    Predicate Filter
    WHERE coalesce_long(@c10, @c6) EQUALS @c6
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; + 2 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; + 3 [ label=<
    Primary Storage
    record types: [B]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} @ - unnamed-43EXPLAIN select * from B where 6L = coalesce(5I, 6I) -Ó. ӳ(0%8@GSCAN(<,>) | FILTER @c6 EQUALS promote(coalesce_int(@c10, @c12) AS LONG) + unnamed-43EXPLAIN select * from B where 6L = coalesce(5I, 6I) +2 מ(0 +8@GSCAN(<,>) | FILTER promote(coalesce_int(@c10, @c12) AS LONG) EQUALS @c6 digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Predicate Filter
    WHERE @c6 EQUALS promote(coalesce_int(@c10, @c12) AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, )" ]; - 2 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, )" ]; - 3 [ label=<
    Primary Storage
    record types: [B]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, )" ]; + 1 [ label=<
    Predicate Filter
    WHERE promote(coalesce_int(@c10, @c12) AS LONG) EQUALS @c6
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; + 2 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; + 3 [ label=<
    Primary Storage
    record types: [B]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} > - unnamed-41EXPLAIN select * from B where 6L = coalesce(5, 6) -. ׹(0 8@GSCAN(<,>) | FILTER @c6 EQUALS promote(coalesce_int(@c10, @c12) AS LONG) + unnamed-41EXPLAIN select * from B where 6L = coalesce(5, 6) +ٟ2 Щ(0 8@GSCAN(<,>) | FILTER promote(coalesce_int(@c10, @c12) AS LONG) EQUALS @c6 digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Predicate Filter
    WHERE @c6 EQUALS promote(coalesce_int(@c10, @c12) AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, )" ]; - 2 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, )" ]; - 3 [ label=<
    Primary Storage
    record types: [B]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, )" ]; + 1 [ label=<
    Predicate Filter
    WHERE promote(coalesce_int(@c10, @c12) AS LONG) EQUALS @c6
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; + 2 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; + 3 [ label=<
    Primary Storage
    record types: [B]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} > - unnamed-41EXPLAIN select * from B where 6 = coalesce(5L, 6) -җ. (0*8@XSCAN(<,>) | FILTER promote(@c6 AS LONG) EQUALS coalesce_long(@c10, promote(@c6 AS LONG)) + unnamed-41EXPLAIN select * from B where 6 = coalesce(5L, 6) +2 (0 8@XSCAN(<,>) | FILTER coalesce_long(@c10, promote(@c6 AS LONG)) EQUALS promote(@c6 AS LONG) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Predicate Filter
    WHERE promote(@c6 AS LONG) EQUALS coalesce_long(@c10, promote(@c6 AS LONG))
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, )" ]; - 2 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, )" ]; - 3 [ label=<
    Primary Storage
    record types: [B]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, )" ]; + 1 [ label=<
    Predicate Filter
    WHERE coalesce_long(@c10, promote(@c6 AS LONG)) EQUALS promote(@c6 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; + 2 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; + 3 [ label=<
    Primary Storage
    record types: [B]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} @ - unnamed-43EXPLAIN select * from B where 6I = coalesce(5L, 6I) -. ӑ(0$8@XSCAN(<,>) | FILTER promote(@c6 AS LONG) EQUALS coalesce_long(@c10, promote(@c6 AS LONG)) + unnamed-43EXPLAIN select * from B where 6I = coalesce(5L, 6I) +2 ۗ(0 8@XSCAN(<,>) | FILTER coalesce_long(@c10, promote(@c6 AS LONG)) EQUALS promote(@c6 AS LONG) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Predicate Filter
    WHERE promote(@c6 AS LONG) EQUALS coalesce_long(@c10, promote(@c6 AS LONG))
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, )" ]; - 2 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, )" ]; - 3 [ label=<
    Primary Storage
    record types: [B]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, )" ]; + 1 [ label=<
    Predicate Filter
    WHERE coalesce_long(@c10, promote(@c6 AS LONG)) EQUALS promote(@c6 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; + 2 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; + 3 [ label=<
    Primary Storage
    record types: [B]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} @ - unnamed-43EXPLAIN select * from B where 6i = coalesce(5l, 6i) -. (0#8@XSCAN(<,>) | FILTER promote(@c6 AS LONG) EQUALS coalesce_long(@c10, promote(@c6 AS LONG)) + unnamed-43EXPLAIN select * from B where 6i = coalesce(5l, 6i) +2 (0 8@XSCAN(<,>) | FILTER coalesce_long(@c10, promote(@c6 AS LONG)) EQUALS promote(@c6 AS LONG) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Predicate Filter
    WHERE promote(@c6 AS LONG) EQUALS coalesce_long(@c10, promote(@c6 AS LONG))
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, )" ]; - 2 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, )" ]; - 3 [ label=<
    Primary Storage
    record types: [B]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, )" ]; + 1 [ label=<
    Predicate Filter
    WHERE coalesce_long(@c10, promote(@c6 AS LONG)) EQUALS promote(@c6 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; + 2 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; + 3 [ label=<
    Primary Storage
    record types: [B]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} = - unnamed-40EXPLAIN select * from B where 6 = coalesce(5, 6) - -. (0(8@5SCAN(<,>) | FILTER @c6 EQUALS coalesce_int(@c10, @c6) + unnamed-40EXPLAIN select * from B where 6 = coalesce(5, 6) +ޏ2 V(08@5SCAN(<,>) | FILTER coalesce_int(@c10, @c6) EQUALS @c6 digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Predicate Filter
    WHERE @c6 EQUALS coalesce_int(@c10, @c6)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, )" ]; - 2 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, )" ]; - 3 [ label=<
    Primary Storage
    record types: [B]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, )" ]; + 1 [ label=<
    Predicate Filter
    WHERE coalesce_int(@c10, @c6) EQUALS @c6
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; + 2 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; + 3 [ label=<
    Primary Storage
    record types: [B]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; } \ No newline at end of file diff --git a/yaml-tests/src/test/resources/literal-tests.metrics.yaml b/yaml-tests/src/test/resources/literal-tests.metrics.yaml index adccfe8594..f753b6241c 100644 --- a/yaml-tests/src/test/resources/literal-tests.metrics.yaml +++ b/yaml-tests/src/test/resources/literal-tests.metrics.yaml @@ -1,94 +1,94 @@ unnamed-3: - query: EXPLAIN select * from B where 6L = coalesce(5L, 6L) - explain: SCAN(<,>) | FILTER @c6 EQUALS coalesce_long(@c10, @c6) + explain: SCAN(<,>) | FILTER coalesce_long(@c10, @c6) EQUALS @c6 task_count: 163 - task_total_time_ms: 99 - transform_count: 46 - transform_time_ms: 83 + task_total_time_ms: 4 + transform_count: 50 + transform_time_ms: 2 transform_yield_count: 14 - insert_time_ms: 1 + insert_time_ms: 0 insert_new_count: 14 insert_reused_count: 2 - query: EXPLAIN select * from B where 6 = coalesce(5, 6) - explain: SCAN(<,>) | FILTER @c6 EQUALS coalesce_int(@c10, @c6) + explain: SCAN(<,>) | FILTER coalesce_int(@c10, @c6) EQUALS @c6 task_count: 163 - task_total_time_ms: 11 - transform_count: 46 - transform_time_ms: 6 + task_total_time_ms: 2 + transform_count: 50 + transform_time_ms: 1 transform_yield_count: 14 insert_time_ms: 0 insert_new_count: 14 insert_reused_count: 2 unnamed-4: - query: EXPLAIN select * from B where 6L = coalesce(5L, 6L) - explain: SCAN(<,>) | FILTER @c6 EQUALS coalesce_long(@c10, @c6) + explain: SCAN(<,>) | FILTER coalesce_long(@c10, @c6) EQUALS @c6 task_count: 163 - task_total_time_ms: 99 - transform_count: 46 - transform_time_ms: 83 + task_total_time_ms: 4 + transform_count: 50 + transform_time_ms: 2 transform_yield_count: 14 - insert_time_ms: 1 + insert_time_ms: 0 insert_new_count: 14 insert_reused_count: 2 - query: EXPLAIN select * from B where 6L = coalesce(5I, 6I) - explain: SCAN(<,>) | FILTER @c6 EQUALS promote(coalesce_int(@c10, @c12) AS LONG) + explain: SCAN(<,>) | FILTER promote(coalesce_int(@c10, @c12) AS LONG) EQUALS @c6 task_count: 163 - task_total_time_ms: 14 - transform_count: 46 - transform_time_ms: 6 + task_total_time_ms: 5 + transform_count: 50 + transform_time_ms: 2 transform_yield_count: 14 insert_time_ms: 0 insert_new_count: 14 insert_reused_count: 2 - query: EXPLAIN select * from B where 6L = coalesce(5, 6) - explain: SCAN(<,>) | FILTER @c6 EQUALS promote(coalesce_int(@c10, @c12) AS LONG) + explain: SCAN(<,>) | FILTER promote(coalesce_int(@c10, @c12) AS LONG) EQUALS @c6 task_count: 163 - task_total_time_ms: 15 - transform_count: 46 - transform_time_ms: 7 + task_total_time_ms: 6 + transform_count: 50 + transform_time_ms: 2 transform_yield_count: 14 insert_time_ms: 0 insert_new_count: 14 insert_reused_count: 2 - query: EXPLAIN select * from B where 6 = coalesce(5L, 6) - explain: SCAN(<,>) | FILTER promote(@c6 AS LONG) EQUALS coalesce_long(@c10, promote(@c6 - AS LONG)) + explain: SCAN(<,>) | FILTER coalesce_long(@c10, promote(@c6 AS LONG)) EQUALS promote(@c6 + AS LONG) task_count: 163 - task_total_time_ms: 17 - transform_count: 46 - transform_time_ms: 7 + task_total_time_ms: 6 + transform_count: 50 + transform_time_ms: 2 transform_yield_count: 14 insert_time_ms: 0 insert_new_count: 14 insert_reused_count: 2 - query: EXPLAIN select * from B where 6I = coalesce(5L, 6I) - explain: SCAN(<,>) | FILTER promote(@c6 AS LONG) EQUALS coalesce_long(@c10, promote(@c6 - AS LONG)) + explain: SCAN(<,>) | FILTER coalesce_long(@c10, promote(@c6 AS LONG)) EQUALS promote(@c6 + AS LONG) task_count: 163 - task_total_time_ms: 16 - transform_count: 46 - transform_time_ms: 7 + task_total_time_ms: 6 + transform_count: 50 + transform_time_ms: 2 transform_yield_count: 14 insert_time_ms: 0 insert_new_count: 14 insert_reused_count: 2 - query: EXPLAIN select * from B where 6i = coalesce(5l, 6i) - explain: SCAN(<,>) | FILTER promote(@c6 AS LONG) EQUALS coalesce_long(@c10, promote(@c6 - AS LONG)) + explain: SCAN(<,>) | FILTER coalesce_long(@c10, promote(@c6 AS LONG)) EQUALS promote(@c6 + AS LONG) task_count: 163 - task_total_time_ms: 17 - transform_count: 46 - transform_time_ms: 8 + task_total_time_ms: 5 + transform_count: 50 + transform_time_ms: 2 transform_yield_count: 14 insert_time_ms: 0 insert_new_count: 14 insert_reused_count: 2 - query: EXPLAIN select * from B where 6 = coalesce(5, 6) - explain: SCAN(<,>) | FILTER @c6 EQUALS coalesce_int(@c10, @c6) + explain: SCAN(<,>) | FILTER coalesce_int(@c10, @c6) EQUALS @c6 task_count: 163 - task_total_time_ms: 11 - transform_count: 46 - transform_time_ms: 6 + task_total_time_ms: 2 + transform_count: 50 + transform_time_ms: 1 transform_yield_count: 14 insert_time_ms: 0 insert_new_count: 14 diff --git a/yaml-tests/src/test/resources/nested-with-nulls-proto.metrics.binpb b/yaml-tests/src/test/resources/nested-with-nulls-proto.metrics.binpb index 4585a473f6..ee65846c65 100644 --- a/yaml-tests/src/test/resources/nested-with-nulls-proto.metrics.binpb +++ b/yaml-tests/src/test/resources/nested-with-nulls-proto.metrics.binpb @@ -1,409 +1,406 @@ - + N -nested-with-nulls-proto-tests-EXPLAIN select id from t1 where a.a.a IS NULL -ٚI :(0 -8@+SCAN(<,>) | FILTER false | MAP (_.ID AS ID) digraph G { +nested-with-nulls-proto-tests-EXPLAIN select id from t1 where a.a.a IS NULL +M x(08@+SCAN(<,>) | FILTER false | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE false
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q24.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE false
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} N -nested-with-nulls-proto-tests-EXPLAIN select id from t1 where a.a.b IS NULL -; ՜(08@5SCAN(<,>) | FILTER _.A.A.B IS_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-proto-tests-EXPLAIN select id from t1 where a.a.b IS NULL +? C(08@5SCAN(<,>) | FILTER _.A.A.B IS_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q20.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE q2.A.A.B IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q2.A.A.B IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q20> label="q20" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} N -nested-with-nulls-proto-tests-EXPLAIN select id from t1 where a.b.a IS NULL -; (08@5SCAN(<,>) | FILTER _.A.B.A IS_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-proto-tests-EXPLAIN select id from t1 where a.b.a IS NULL +? h(0 8@5SCAN(<,>) | FILTER _.A.B.A IS_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q20.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE q2.A.B.A IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q2.A.B.A IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q20> label="q20" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} N -nested-with-nulls-proto-tests-EXPLAIN select id from t1 where a.b.b IS NULL -降; l(0 8@5SCAN(<,>) | FILTER _.A.B.B IS_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-proto-tests-EXPLAIN select id from t1 where a.b.b IS NULL +? /(08@5SCAN(<,>) | FILTER _.A.B.B IS_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q20.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE q2.A.B.B IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q2.A.B.B IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q20> label="q20" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} N -nested-with-nulls-proto-tests-EXPLAIN select id from t1 where b.a.a IS NULL -; (0ں8@5SCAN(<,>) | FILTER _.B.A.A IS_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-proto-tests-EXPLAIN select id from t1 where b.a.a IS NULL +? l(0 8@5SCAN(<,>) | FILTER _.B.A.A IS_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q20.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE q2.B.A.A IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q2.B.A.A IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q20> label="q20" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} N -nested-with-nulls-proto-tests-EXPLAIN select id from t1 where b.a.b IS NULL -㿞; @(0 -8@5SCAN(<,>) | FILTER _.B.A.B IS_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-proto-tests-EXPLAIN select id from t1 where b.a.b IS NULL +֣? (08@5SCAN(<,>) | FILTER _.B.A.B IS_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q20.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE q2.B.A.B IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q2.B.A.B IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q20> label="q20" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} N -nested-with-nulls-proto-tests-EXPLAIN select id from t1 where b.b.a IS NULL -; ^(0 -8@5SCAN(<,>) | FILTER _.B.B.A IS_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-proto-tests-EXPLAIN select id from t1 where b.b.a IS NULL +? (08@5SCAN(<,>) | FILTER _.B.B.A IS_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q20.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE q2.B.B.A IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q2.B.B.A IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q20> label="q20" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} N -nested-with-nulls-proto-tests-EXPLAIN select id from t1 where b.b.b IS NULL -; 0(08@5SCAN(<,>) | FILTER _.B.B.B IS_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-proto-tests-EXPLAIN select id from t1 where b.b.b IS NULL +ȁ? ۠Q(0׷ 8@5SCAN(<,>) | FILTER _.B.B.B IS_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q20.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE q2.B.B.B IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q2.B.B.B IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q20> label="q20" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} R -nested-with-nulls-proto-tests1EXPLAIN select id from t1 where a.a.a IS NOT NULL - -I Л8(0 8@SCAN(<,>) | MAP (_.ID AS ID) digraph G { +nested-with-nulls-proto-tests1EXPLAIN select id from t1 where a.a.a IS NOT NULL +M Q(0 8@SCAN(<,>) | MAP (_.ID AS ID) digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q2.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 2 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} R -nested-with-nulls-proto-tests1EXPLAIN select id from t1 where a.a.b IS NOT NULL -; H(0 8@6SCAN(<,>) | FILTER _.A.A.B NOT_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-proto-tests1EXPLAIN select id from t1 where a.a.b IS NOT NULL +ك? 3(08@6SCAN(<,>) | FILTER _.A.A.B NOT_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q20.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE q2.A.A.B NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q2.A.A.B NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q20> label="q20" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} R -nested-with-nulls-proto-tests1EXPLAIN select id from t1 where a.b.a IS NOT NULL -; \(0 8@6SCAN(<,>) | FILTER _.A.B.A NOT_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-proto-tests1EXPLAIN select id from t1 where a.b.a IS NOT NULL +? J(08@6SCAN(<,>) | FILTER _.A.B.A NOT_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q20.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE q2.A.B.A NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q2.A.B.A NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q20> label="q20" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} R -nested-with-nulls-proto-tests1EXPLAIN select id from t1 where a.b.b IS NOT NULL -; (0(8@6SCAN(<,>) | FILTER _.A.B.B NOT_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-proto-tests1EXPLAIN select id from t1 where a.b.b IS NOT NULL +? R(0 8@6SCAN(<,>) | FILTER _.A.B.B NOT_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q20.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE q2.A.B.B NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q2.A.B.B NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q20> label="q20" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} R -nested-with-nulls-proto-tests1EXPLAIN select id from t1 where b.a.a IS NOT NULL -; (08@6SCAN(<,>) | FILTER _.B.A.A NOT_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-proto-tests1EXPLAIN select id from t1 where b.a.a IS NOT NULL +y? 1(08@6SCAN(<,>) | FILTER _.B.A.A NOT_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q20.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE q2.B.A.A NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q2.B.A.A NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q20> label="q20" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} R -nested-with-nulls-proto-tests1EXPLAIN select id from t1 where b.a.b IS NOT NULL -; C(08@6SCAN(<,>) | FILTER _.B.A.B NOT_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-proto-tests1EXPLAIN select id from t1 where b.a.b IS NOT NULL +? S(08@6SCAN(<,>) | FILTER _.B.A.B NOT_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q20.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE q2.B.A.B NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q2.B.A.B NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q20> label="q20" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} R -nested-with-nulls-proto-tests1EXPLAIN select id from t1 where b.b.a IS NOT NULL -; 9(08@6SCAN(<,>) | FILTER _.B.B.A NOT_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-proto-tests1EXPLAIN select id from t1 where b.b.a IS NOT NULL +? ˆ(08@6SCAN(<,>) | FILTER _.B.B.A NOT_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q20.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE q2.B.B.A NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q2.B.B.A NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q20> label="q20" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} R -nested-with-nulls-proto-tests1EXPLAIN select id from t1 where b.b.b IS NOT NULL -ӎ; ۃ(08@6SCAN(<,>) | FILTER _.B.B.B NOT_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-proto-tests1EXPLAIN select id from t1 where b.b.b IS NOT NULL +? 9(08@6SCAN(<,>) | FILTER _.B.B.B NOT_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q20.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE q2.B.B.B NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q2.B.B.B NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q20> label="q20" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} _ -nested-with-nulls-proto-tests>EXPLAIN select id from t1 where coalesce(a.a.a, 'blah') = 'a1' -؃; ](0Ц 8@PSCAN(<,>) | FILTER coalesce_string(_.A.A.A, @c14) EQUALS @c17 | MAP (_.ID AS ID) digraph G { +nested-with-nulls-proto-tests>EXPLAIN select id from t1 where coalesce(a.a.a, 'blah') = 'a1' +? H(08@PSCAN(<,>) | FILTER coalesce_string(_.A.A.A, @c14) EQUALS @c17 | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q20.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.A.A, @c14) EQUALS @c17
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.A.A, @c14) EQUALS @c17
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q20> label="q20" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} ` -nested-with-nulls-proto-tests?EXPLAIN select id from t1 where coalesce(a.a.a, 'blah') = 'a1p' -؃; ](0Ц 8@PSCAN(<,>) | FILTER coalesce_string(_.A.A.A, @c14) EQUALS @c17 | MAP (_.ID AS ID) digraph G { +nested-with-nulls-proto-tests?EXPLAIN select id from t1 where coalesce(a.a.a, 'blah') = 'a1p' +? H(08@PSCAN(<,>) | FILTER coalesce_string(_.A.A.A, @c14) EQUALS @c17 | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q20.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.A.A, @c14) EQUALS @c17
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.A.A, @c14) EQUALS @c17
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q20> label="q20" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} d -nested-with-nulls-proto-testsCEXPLAIN select id from t1 where coalesce(a.a.a, 'blah') IS NOT NULL -I (0&8@MSCAN(<,>) | FILTER coalesce_string(_.A.A.A, @c14) NOT_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-proto-testsCEXPLAIN select id from t1 where coalesce(a.a.a, 'blah') IS NOT NULL +M |(08@MSCAN(<,>) | FILTER coalesce_string(_.A.A.A, @c14) NOT_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.A.A, @c14) NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q24.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.A.A, @c14) NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} b -nested-with-nulls-proto-testsAEXPLAIN select id from t1 where coalesce(a.a.a, null) IS NOT NULL -ћI ɀ(08@`SCAN(<,>) | FILTER coalesce_string(promote(_.A.A.A AS STRING), NULL) NOT_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-proto-testsAEXPLAIN select id from t1 where coalesce(a.a.a, null) IS NOT NULL +M y(08@`SCAN(<,>) | FILTER coalesce_string(promote(_.A.A.A AS STRING), NULL) NOT_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(promote(q2.A.A.A AS STRING), NULL) NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q24.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(promote(q2.A.A.A AS STRING), NULL) NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} ] -nested-with-nulls-proto-tests) | FILTER coalesce_string(_.A.B.A, promote(@c14 AS STRING)) EQUALS promote(@c14 AS STRING) | MAP (_.ID AS ID)digraph G { +nested-with-nulls-proto-tests) | FILTER coalesce_string(_.A.B.A, promote(@c14 AS STRING)) EQUALS promote(@c14 AS STRING) | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.B.A, promote(@c14 AS STRING)) EQUALS promote(@c14 AS STRING)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q24.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.B.A, promote(@c14 AS STRING)) EQUALS promote(@c14 AS STRING)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} _ -nested-with-nulls-proto-tests>EXPLAIN select id from t1 where coalesce(a.b.a, 'foo') = 'foo' -އI ؞(018@vSCAN(<,>) | FILTER coalesce_string(_.A.B.A, promote(@c14 AS STRING)) EQUALS promote(@c14 AS STRING) | MAP (_.ID AS ID)digraph G { +nested-with-nulls-proto-tests>EXPLAIN select id from t1 where coalesce(a.b.a, 'foo') = 'foo' +ݓM (08@vSCAN(<,>) | FILTER coalesce_string(_.A.B.A, promote(@c14 AS STRING)) EQUALS promote(@c14 AS STRING) | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.B.A, promote(@c14 AS STRING)) EQUALS promote(@c14 AS STRING)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q24.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.B.A, promote(@c14 AS STRING)) EQUALS promote(@c14 AS STRING)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} _ -nested-with-nulls-proto-tests>EXPLAIN select id from t1 where coalesce(a.b.a, 'foo') IS NULL -ĩI e(08@_SCAN(<,>) | FILTER coalesce_string(_.A.B.A, promote(@c14 AS STRING)) IS_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-proto-tests>EXPLAIN select id from t1 where coalesce(a.b.a, 'foo') IS NULL +蜚M I(0 8@_SCAN(<,>) | FILTER coalesce_string(_.A.B.A, promote(@c14 AS STRING)) IS_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.B.A, promote(@c14 AS STRING)) IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q24.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.B.A, promote(@c14 AS STRING)) IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} ^ -nested-with-nulls-proto-tests=EXPLAIN select id from t1 where coalesce(a.b.a, null) IS NULL -I I(0 8@LSCAN(<,>) | FILTER coalesce_string(_.A.B.A, NULL) IS_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-proto-tests=EXPLAIN select id from t1 where coalesce(a.b.a, null) IS NULL +M W(0 8@LSCAN(<,>) | FILTER coalesce_string(_.A.B.A, NULL) IS_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.B.A, NULL) IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q24.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.B.A, NULL) IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} c -nested-with-nulls-proto-testsBEXPLAIN select id from t1 where coalesce(a.b.a, 'foo') IS NOT NULL -ܶI Q(0 8@`SCAN(<,>) | FILTER coalesce_string(_.A.B.A, promote(@c14 AS STRING)) NOT_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-proto-testsBEXPLAIN select id from t1 where coalesce(a.b.a, 'foo') IS NOT NULL +M G(0ԋ +8@`SCAN(<,>) | FILTER coalesce_string(_.A.B.A, promote(@c14 AS STRING)) NOT_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.B.A, promote(@c14 AS STRING)) NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q24.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.B.A, promote(@c14 AS STRING)) NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} W -nested-with-nulls-proto-tests6EXPLAIN select id from t1 where coalesce(b.a.b, 3) = 3 -Ś; C(08@pSCAN(<,>) | FILTER coalesce_long(_.B.A.B, promote(@c14 AS LONG)) EQUALS promote(@c14 AS LONG) | MAP (_.ID AS ID)digraph G { +nested-with-nulls-proto-tests6EXPLAIN select id from t1 where coalesce(b.a.b, 3) = 3 +? y(0 8@pSCAN(<,>) | FILTER coalesce_long(_.B.A.B, promote(@c14 AS LONG)) EQUALS promote(@c14 AS LONG) | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q20.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE coalesce_long(q2.B.A.B, promote(@c14 AS LONG)) EQUALS promote(@c14 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE coalesce_long(q2.B.A.B, promote(@c14 AS LONG)) EQUALS promote(@c14 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q20> label="q20" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} Y -nested-with-nulls-proto-tests8EXPLAIN select id from t1 where coalesce(b.a.b, 42) = 42 -Ś; C(08@pSCAN(<,>) | FILTER coalesce_long(_.B.A.B, promote(@c14 AS LONG)) EQUALS promote(@c14 AS LONG) | MAP (_.ID AS ID)digraph G { +nested-with-nulls-proto-tests8EXPLAIN select id from t1 where coalesce(b.a.b, 42) = 42 +? y(0 8@pSCAN(<,>) | FILTER coalesce_long(_.B.A.B, promote(@c14 AS LONG)) EQUALS promote(@c14 AS LONG) | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q20.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE coalesce_long(q2.B.A.B, promote(@c14 AS LONG)) EQUALS promote(@c14 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE coalesce_long(q2.B.A.B, promote(@c14 AS LONG)) EQUALS promote(@c14 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q20> label="q20" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} \ -nested-with-nulls-proto-tests;EXPLAIN select id from t1 where coalesce(b.a.b, 42) IS NULL -ҫ; G(0 8@[SCAN(<,>) | FILTER coalesce_long(_.B.A.B, promote(@c14 AS LONG)) IS_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-proto-tests;EXPLAIN select id from t1 where coalesce(b.a.b, 42) IS NULL +? y(0 8@[SCAN(<,>) | FILTER coalesce_long(_.B.A.B, promote(@c14 AS LONG)) IS_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q20.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE coalesce_long(q2.B.A.B, promote(@c14 AS LONG)) IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE coalesce_long(q2.B.A.B, promote(@c14 AS LONG)) IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q20> label="q20" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} ` -nested-with-nulls-proto-tests?EXPLAIN select id from t1 where coalesce(b.a.b, 42) IS NOT NULL -; P(0 8@\SCAN(<,>) | FILTER coalesce_long(_.B.A.B, promote(@c14 AS LONG)) NOT_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-proto-tests?EXPLAIN select id from t1 where coalesce(b.a.b, 42) IS NOT NULL +? (08@\SCAN(<,>) | FILTER coalesce_long(_.B.A.B, promote(@c14 AS LONG)) NOT_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q20.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE coalesce_long(q2.B.A.B, promote(@c14 AS LONG)) NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q22.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE coalesce_long(q2.B.A.B, promote(@c14 AS LONG)) NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q20> label="q20" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; } \ No newline at end of file diff --git a/yaml-tests/src/test/resources/nested-with-nulls-proto.metrics.yaml b/yaml-tests/src/test/resources/nested-with-nulls-proto.metrics.yaml index 769e5bf27a..ae69609af4 100644 --- a/yaml-tests/src/test/resources/nested-with-nulls-proto.metrics.yaml +++ b/yaml-tests/src/test/resources/nested-with-nulls-proto.metrics.yaml @@ -2,9 +2,9 @@ nested-with-nulls-proto-tests: - query: EXPLAIN select id from t1 where a.a.a IS NULL explain: SCAN(<,>) | FILTER false | MAP (_.ID AS ID) task_count: 229 - task_total_time_ms: 2 - transform_count: 73 - transform_time_ms: 0 + task_total_time_ms: 8 + transform_count: 77 + transform_time_ms: 1 transform_yield_count: 18 insert_time_ms: 0 insert_new_count: 24 @@ -12,9 +12,9 @@ nested-with-nulls-proto-tests: - query: EXPLAIN select id from t1 where a.a.b IS NULL explain: SCAN(<,>) | FILTER _.A.A.B IS_NULL | MAP (_.ID AS ID) task_count: 206 - task_total_time_ms: 7 - transform_count: 59 - transform_time_ms: 2 + task_total_time_ms: 3 + transform_count: 63 + transform_time_ms: 1 transform_yield_count: 15 insert_time_ms: 0 insert_new_count: 18 @@ -22,9 +22,9 @@ nested-with-nulls-proto-tests: - query: EXPLAIN select id from t1 where a.b.a IS NULL explain: SCAN(<,>) | FILTER _.A.B.A IS_NULL | MAP (_.ID AS ID) task_count: 206 - task_total_time_ms: 7 - transform_count: 59 - transform_time_ms: 3 + task_total_time_ms: 6 + transform_count: 63 + transform_time_ms: 1 transform_yield_count: 15 insert_time_ms: 0 insert_new_count: 18 @@ -32,9 +32,9 @@ nested-with-nulls-proto-tests: - query: EXPLAIN select id from t1 where a.b.b IS NULL explain: SCAN(<,>) | FILTER _.A.B.B IS_NULL | MAP (_.ID AS ID) task_count: 206 - task_total_time_ms: 4 - transform_count: 59 - transform_time_ms: 1 + task_total_time_ms: 2 + transform_count: 63 + transform_time_ms: 0 transform_yield_count: 15 insert_time_ms: 0 insert_new_count: 18 @@ -42,9 +42,9 @@ nested-with-nulls-proto-tests: - query: EXPLAIN select id from t1 where b.a.a IS NULL explain: SCAN(<,>) | FILTER _.B.A.A IS_NULL | MAP (_.ID AS ID) task_count: 206 - task_total_time_ms: 4 - transform_count: 59 - transform_time_ms: 2 + task_total_time_ms: 5 + transform_count: 63 + transform_time_ms: 1 transform_yield_count: 15 insert_time_ms: 0 insert_new_count: 18 @@ -52,9 +52,9 @@ nested-with-nulls-proto-tests: - query: EXPLAIN select id from t1 where b.a.b IS NULL explain: SCAN(<,>) | FILTER _.B.A.B IS_NULL | MAP (_.ID AS ID) task_count: 206 - task_total_time_ms: 2 - transform_count: 59 - transform_time_ms: 1 + task_total_time_ms: 8 + transform_count: 63 + transform_time_ms: 2 transform_yield_count: 15 insert_time_ms: 0 insert_new_count: 18 @@ -62,9 +62,9 @@ nested-with-nulls-proto-tests: - query: EXPLAIN select id from t1 where b.b.a IS NULL explain: SCAN(<,>) | FILTER _.B.B.A IS_NULL | MAP (_.ID AS ID) task_count: 206 - task_total_time_ms: 4 - transform_count: 59 - transform_time_ms: 1 + task_total_time_ms: 8 + transform_count: 63 + transform_time_ms: 2 transform_yield_count: 15 insert_time_ms: 0 insert_new_count: 18 @@ -72,9 +72,9 @@ nested-with-nulls-proto-tests: - query: EXPLAIN select id from t1 where b.b.b IS NULL explain: SCAN(<,>) | FILTER _.B.B.B IS_NULL | MAP (_.ID AS ID) task_count: 206 - task_total_time_ms: 2 - transform_count: 59 - transform_time_ms: 0 + task_total_time_ms: 4 + transform_count: 63 + transform_time_ms: 1 transform_yield_count: 15 insert_time_ms: 0 insert_new_count: 18 @@ -82,9 +82,9 @@ nested-with-nulls-proto-tests: - query: EXPLAIN select id from t1 where a.a.a IS NOT NULL explain: SCAN(<,>) | MAP (_.ID AS ID) task_count: 215 - task_total_time_ms: 2 - transform_count: 73 - transform_time_ms: 0 + task_total_time_ms: 5 + transform_count: 77 + transform_time_ms: 1 transform_yield_count: 18 insert_time_ms: 0 insert_new_count: 22 @@ -92,9 +92,9 @@ nested-with-nulls-proto-tests: - query: EXPLAIN select id from t1 where a.a.b IS NOT NULL explain: SCAN(<,>) | FILTER _.A.A.B NOT_NULL | MAP (_.ID AS ID) task_count: 206 - task_total_time_ms: 3 - transform_count: 59 - transform_time_ms: 1 + task_total_time_ms: 2 + transform_count: 63 + transform_time_ms: 0 transform_yield_count: 15 insert_time_ms: 0 insert_new_count: 18 @@ -102,8 +102,8 @@ nested-with-nulls-proto-tests: - query: EXPLAIN select id from t1 where a.b.a IS NOT NULL explain: SCAN(<,>) | FILTER _.A.B.A NOT_NULL | MAP (_.ID AS ID) task_count: 206 - task_total_time_ms: 4 - transform_count: 59 + task_total_time_ms: 3 + transform_count: 63 transform_time_ms: 1 transform_yield_count: 15 insert_time_ms: 0 @@ -112,9 +112,9 @@ nested-with-nulls-proto-tests: - query: EXPLAIN select id from t1 where a.b.b IS NOT NULL explain: SCAN(<,>) | FILTER _.A.B.B NOT_NULL | MAP (_.ID AS ID) task_count: 206 - task_total_time_ms: 8 - transform_count: 59 - transform_time_ms: 3 + task_total_time_ms: 4 + transform_count: 63 + transform_time_ms: 1 transform_yield_count: 15 insert_time_ms: 0 insert_new_count: 18 @@ -122,9 +122,9 @@ nested-with-nulls-proto-tests: - query: EXPLAIN select id from t1 where b.a.a IS NOT NULL explain: SCAN(<,>) | FILTER _.B.A.A NOT_NULL | MAP (_.ID AS ID) task_count: 206 - task_total_time_ms: 7 - transform_count: 59 - transform_time_ms: 3 + task_total_time_ms: 1 + transform_count: 63 + transform_time_ms: 0 transform_yield_count: 15 insert_time_ms: 0 insert_new_count: 18 @@ -132,8 +132,8 @@ nested-with-nulls-proto-tests: - query: EXPLAIN select id from t1 where b.a.b IS NOT NULL explain: SCAN(<,>) | FILTER _.B.A.B NOT_NULL | MAP (_.ID AS ID) task_count: 206 - task_total_time_ms: 2 - transform_count: 59 + task_total_time_ms: 3 + transform_count: 63 transform_time_ms: 1 transform_yield_count: 15 insert_time_ms: 0 @@ -142,9 +142,9 @@ nested-with-nulls-proto-tests: - query: EXPLAIN select id from t1 where b.b.a IS NOT NULL explain: SCAN(<,>) | FILTER _.B.B.A NOT_NULL | MAP (_.ID AS ID) task_count: 206 - task_total_time_ms: 2 - transform_count: 59 - transform_time_ms: 0 + task_total_time_ms: 8 + transform_count: 63 + transform_time_ms: 2 transform_yield_count: 15 insert_time_ms: 0 insert_new_count: 18 @@ -152,9 +152,9 @@ nested-with-nulls-proto-tests: - query: EXPLAIN select id from t1 where b.b.b IS NOT NULL explain: SCAN(<,>) | FILTER _.B.B.B NOT_NULL | MAP (_.ID AS ID) task_count: 206 - task_total_time_ms: 6 - transform_count: 59 - transform_time_ms: 2 + task_total_time_ms: 2 + transform_count: 63 + transform_time_ms: 0 transform_yield_count: 15 insert_time_ms: 0 insert_new_count: 18 @@ -163,8 +163,8 @@ nested-with-nulls-proto-tests: explain: SCAN(<,>) | FILTER coalesce_string(_.A.A.A, @c14) EQUALS @c17 | MAP (_.ID AS ID) task_count: 206 - task_total_time_ms: 4 - transform_count: 59 + task_total_time_ms: 3 + transform_count: 63 transform_time_ms: 1 transform_yield_count: 15 insert_time_ms: 0 @@ -174,8 +174,8 @@ nested-with-nulls-proto-tests: explain: SCAN(<,>) | FILTER coalesce_string(_.A.A.A, @c14) EQUALS @c17 | MAP (_.ID AS ID) task_count: 206 - task_total_time_ms: 4 - transform_count: 59 + task_total_time_ms: 3 + transform_count: 63 transform_time_ms: 1 transform_yield_count: 15 insert_time_ms: 0 @@ -186,8 +186,8 @@ nested-with-nulls-proto-tests: AS ID) task_count: 229 task_total_time_ms: 8 - transform_count: 73 - transform_time_ms: 3 + transform_count: 77 + transform_time_ms: 2 transform_yield_count: 18 insert_time_ms: 0 insert_new_count: 24 @@ -197,8 +197,8 @@ nested-with-nulls-proto-tests: NOT_NULL | MAP (_.ID AS ID) task_count: 229 task_total_time_ms: 6 - transform_count: 73 - transform_time_ms: 2 + transform_count: 77 + transform_time_ms: 1 transform_yield_count: 18 insert_time_ms: 0 insert_new_count: 24 @@ -208,8 +208,8 @@ nested-with-nulls-proto-tests: EQUALS promote(@c14 AS STRING) | MAP (_.ID AS ID) task_count: 229 task_total_time_ms: 8 - transform_count: 73 - transform_time_ms: 4 + transform_count: 77 + transform_time_ms: 3 transform_yield_count: 18 insert_time_ms: 0 insert_new_count: 24 @@ -219,8 +219,8 @@ nested-with-nulls-proto-tests: EQUALS promote(@c14 AS STRING) | MAP (_.ID AS ID) task_count: 229 task_total_time_ms: 8 - transform_count: 73 - transform_time_ms: 4 + transform_count: 77 + transform_time_ms: 3 transform_yield_count: 18 insert_time_ms: 0 insert_new_count: 24 @@ -229,8 +229,8 @@ nested-with-nulls-proto-tests: explain: SCAN(<,>) | FILTER coalesce_string(_.A.B.A, promote(@c14 AS STRING)) IS_NULL | MAP (_.ID AS ID) task_count: 229 - task_total_time_ms: 5 - transform_count: 73 + task_total_time_ms: 2 + transform_count: 77 transform_time_ms: 1 transform_yield_count: 18 insert_time_ms: 0 @@ -240,8 +240,8 @@ nested-with-nulls-proto-tests: explain: SCAN(<,>) | FILTER coalesce_string(_.A.B.A, NULL) IS_NULL | MAP (_.ID AS ID) task_count: 229 - task_total_time_ms: 2 - transform_count: 73 + task_total_time_ms: 3 + transform_count: 77 transform_time_ms: 1 transform_yield_count: 18 insert_time_ms: 0 @@ -252,7 +252,7 @@ nested-with-nulls-proto-tests: NOT_NULL | MAP (_.ID AS ID) task_count: 229 task_total_time_ms: 2 - transform_count: 73 + transform_count: 77 transform_time_ms: 1 transform_yield_count: 18 insert_time_ms: 0 @@ -262,8 +262,8 @@ nested-with-nulls-proto-tests: explain: SCAN(<,>) | FILTER coalesce_long(_.B.A.B, promote(@c14 AS LONG)) EQUALS promote(@c14 AS LONG) | MAP (_.ID AS ID) task_count: 206 - task_total_time_ms: 2 - transform_count: 59 + task_total_time_ms: 6 + transform_count: 63 transform_time_ms: 1 transform_yield_count: 15 insert_time_ms: 0 @@ -273,8 +273,8 @@ nested-with-nulls-proto-tests: explain: SCAN(<,>) | FILTER coalesce_long(_.B.A.B, promote(@c14 AS LONG)) EQUALS promote(@c14 AS LONG) | MAP (_.ID AS ID) task_count: 206 - task_total_time_ms: 2 - transform_count: 59 + task_total_time_ms: 6 + transform_count: 63 transform_time_ms: 1 transform_yield_count: 15 insert_time_ms: 0 @@ -284,8 +284,8 @@ nested-with-nulls-proto-tests: explain: SCAN(<,>) | FILTER coalesce_long(_.B.A.B, promote(@c14 AS LONG)) IS_NULL | MAP (_.ID AS ID) task_count: 206 - task_total_time_ms: 3 - transform_count: 59 + task_total_time_ms: 6 + transform_count: 63 transform_time_ms: 1 transform_yield_count: 15 insert_time_ms: 0 @@ -295,9 +295,9 @@ nested-with-nulls-proto-tests: explain: SCAN(<,>) | FILTER coalesce_long(_.B.A.B, promote(@c14 AS LONG)) NOT_NULL | MAP (_.ID AS ID) task_count: 206 - task_total_time_ms: 4 - transform_count: 59 - transform_time_ms: 1 + task_total_time_ms: 8 + transform_count: 63 + transform_time_ms: 2 transform_yield_count: 15 insert_time_ms: 0 insert_new_count: 18 diff --git a/yaml-tests/src/test/resources/nested-with-nulls.metrics.binpb b/yaml-tests/src/test/resources/nested-with-nulls.metrics.binpb index 22351f3d2e..c4f0bf70a9 100644 --- a/yaml-tests/src/test/resources/nested-with-nulls.metrics.binpb +++ b/yaml-tests/src/test/resources/nested-with-nulls.metrics.binpb @@ -1,406 +1,401 @@ - + H -nested-with-nulls-tests-EXPLAIN select id from t1 where a.a.a IS NULL -b (048$@9ISCAN(I1 <,>) | FILTER _.A.A.A IS_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-tests-EXPLAIN select id from t1 where a.a.a IS NULL +f (0$8$@9ISCAN(I1 <,>) | FILTER _.A.A.A IS_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q41.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE q2.A.A.A IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q45.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q2.A.A.A IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q45> label="q45" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} H -nested-with-nulls-tests-EXPLAIN select id from t1 where a.a.b IS NULL -b ݊(0%8$@9ISCAN(I1 <,>) | FILTER _.A.A.B IS_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-tests-EXPLAIN select id from t1 where a.a.b IS NULL +f (08$@9ISCAN(I1 <,>) | FILTER _.A.A.B IS_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q41.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE q2.A.A.B IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q45.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q2.A.A.B IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q45> label="q45" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} H -nested-with-nulls-tests-EXPLAIN select id from t1 where a.b.a IS NULL - -ѭm ($0&8-@TCOVERING(I1 [[null],[null]] -> [ID: KEY[2], A: [B: [A: KEY[0]]]]) | MAP (_.ID AS ID) digraph G { +nested-with-nulls-tests-EXPLAIN select id from t1 where a.b.a IS NULL +҂ q ($0.8-@TCOVERING(I1 [[null],[null]] -> [ID: KEY[2], A: [B: [A: KEY[0]]]]) | MAP (_.ID AS ID) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q59.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Covering Index Scan
    range: [(null), (null)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q65.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Covering Index Scan
    range: [(null), (null)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q59> label="q59" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q65> label="q65" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} H -nested-with-nulls-tests-EXPLAIN select id from t1 where a.b.b IS NULL -b ̑(08$@9ISCAN(I1 <,>) | FILTER _.A.B.B IS_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-tests-EXPLAIN select id from t1 where a.b.b IS NULL +f (08$@9ISCAN(I1 <,>) | FILTER _.A.B.B IS_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q41.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE q2.A.B.B IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q45.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q2.A.B.B IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q45> label="q45" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} H -nested-with-nulls-tests-EXPLAIN select id from t1 where b.a.a IS NULL -b (08$@9ISCAN(I1 <,>) | FILTER _.B.A.A IS_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-tests-EXPLAIN select id from t1 where b.a.a IS NULL +f (08$@9ISCAN(I1 <,>) | FILTER _.B.A.A IS_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q41.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE q2.B.A.A IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q45.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q2.B.A.A IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q45> label="q45" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} H -nested-with-nulls-tests-EXPLAIN select id from t1 where b.a.b IS NULL -b }(08$@9ISCAN(I1 <,>) | FILTER _.B.A.B IS_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-tests-EXPLAIN select id from t1 where b.a.b IS NULL +f ÿ(0%8$@9ISCAN(I1 <,>) | FILTER _.B.A.B IS_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q41.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE q2.B.A.B IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q45.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q2.B.A.B IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q45> label="q45" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} H -nested-with-nulls-tests-EXPLAIN select id from t1 where b.b.a IS NULL - b (008$@9ISCAN(I1 <,>) | FILTER _.B.B.A IS_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-tests-EXPLAIN select id from t1 where b.b.a IS NULL +f (0(8$@9ISCAN(I1 <,>) | FILTER _.B.B.A IS_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q41.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE q2.B.B.A IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q45.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q2.B.B.A IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q45> label="q45" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} H -nested-with-nulls-tests-EXPLAIN select id from t1 where b.b.b IS NULL -b ~(08$@9ISCAN(I1 <,>) | FILTER _.B.B.B IS_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-tests-EXPLAIN select id from t1 where b.b.b IS NULL +f (08$@9ISCAN(I1 <,>) | FILTER _.B.B.B IS_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q41.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE q2.B.B.B IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q45.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q2.B.B.B IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q45> label="q45" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} L -nested-with-nulls-tests1EXPLAIN select id from t1 where a.a.a IS NOT NULL -Քb p(08$@:ISCAN(I1 <,>) | FILTER _.A.A.A NOT_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-tests1EXPLAIN select id from t1 where a.a.a IS NOT NULL +f (08$@:ISCAN(I1 <,>) | FILTER _.A.A.A NOT_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q41.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE q2.A.A.A NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q45.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q2.A.A.A NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q45> label="q45" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} L -nested-with-nulls-tests1EXPLAIN select id from t1 where a.a.b IS NOT NULL - -{ (&08/@NCOVERING(I2 ([null],> -> [ID: KEY[2], A: [A: [B: KEY[0]]]]) | MAP (_.ID AS ID) digraph G { +nested-with-nulls-tests1EXPLAIN select id from t1 where a.a.b IS NOT NULL + (&08/@NCOVERING(I2 ([null],> -> [ID: KEY[2], A: [A: [B: KEY[0]]]]) | MAP (_.ID AS ID) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q62.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Covering Index Scan
    range: ((null), ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index
    I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q69.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Covering Index Scan
    range: ((null), ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index
    I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q62> label="q62" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q69> label="q69" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} L -nested-with-nulls-tests1EXPLAIN select id from t1 where a.b.a IS NOT NULL - -m ($0ڈ8-@NCOVERING(I1 ([null],> -> [ID: KEY[2], A: [B: [A: KEY[0]]]]) | MAP (_.ID AS ID) digraph G { +nested-with-nulls-tests1EXPLAIN select id from t1 where a.b.a IS NOT NULL +烁q ݟ($0ǘ,8-@NCOVERING(I1 ([null],> -> [ID: KEY[2], A: [B: [A: KEY[0]]]]) | MAP (_.ID AS ID) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q59.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Covering Index Scan
    range: ((null), ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q65.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Covering Index Scan
    range: ((null), ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q59> label="q59" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q65> label="q65" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} L -nested-with-nulls-tests1EXPLAIN select id from t1 where a.b.b IS NOT NULL -b y(08$@:ISCAN(I1 <,>) | FILTER _.A.B.B NOT_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-tests1EXPLAIN select id from t1 where a.b.b IS NOT NULL +f ꑧ(08$@:ISCAN(I1 <,>) | FILTER _.A.B.B NOT_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q41.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE q2.A.B.B NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q45.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q2.A.B.B NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q45> label="q45" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} L -nested-with-nulls-tests1EXPLAIN select id from t1 where b.a.a IS NOT NULL -訟b م(0&8$@:ISCAN(I1 <,>) | FILTER _.B.A.A NOT_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-tests1EXPLAIN select id from t1 where b.a.a IS NOT NULL +f ~(08$@:ISCAN(I1 <,>) | FILTER _.B.A.A NOT_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q41.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE q2.B.A.A NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q45.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q2.B.A.A NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q45> label="q45" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} L -nested-with-nulls-tests1EXPLAIN select id from t1 where b.a.b IS NOT NULL -ثb ̄(08$@:ISCAN(I1 <,>) | FILTER _.B.A.B NOT_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-tests1EXPLAIN select id from t1 where b.a.b IS NOT NULL +f (0%8$@:ISCAN(I1 <,>) | FILTER _.B.A.B NOT_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q41.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE q2.B.A.B NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q45.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q2.B.A.B NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q45> label="q45" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} L -nested-with-nulls-tests1EXPLAIN select id from t1 where b.b.a IS NOT NULL -b Ћy(08$@:ISCAN(I1 <,>) | FILTER _.B.B.A NOT_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-tests1EXPLAIN select id from t1 where b.b.a IS NOT NULL +f (0٪$8$@:ISCAN(I1 <,>) | FILTER _.B.B.A NOT_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q41.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE q2.B.B.A NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q45.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q2.B.B.A NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q45> label="q45" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} L -nested-with-nulls-tests1EXPLAIN select id from t1 where b.b.b IS NOT NULL - b ܎(088$@:ISCAN(I1 <,>) | FILTER _.B.B.B NOT_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-tests1EXPLAIN select id from t1 where b.b.b IS NOT NULL +f ˭(08$@:ISCAN(I1 <,>) | FILTER _.B.B.B NOT_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q41.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE q2.B.B.B NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q45.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q2.B.B.B NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q45> label="q45" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} Y -nested-with-nulls-tests>EXPLAIN select id from t1 where coalesce(a.a.a, 'blah') = 'a1' -؟ -p ׆(!0*8*@zISCAN(I1 <,>) | FILTER coalesce_string(_.A.A.A, promote(@c14 AS STRING)) EQUALS promote(@c17 AS STRING) | MAP (_.ID AS ID) digraph G { +nested-with-nulls-tests>EXPLAIN select id from t1 where coalesce(a.a.a, 'blah') = 'a1' +ݍt (!0*8*@zISCAN(I1 <,>) | FILTER coalesce_string(_.A.A.A, promote(@c14 AS STRING)) EQUALS promote(@c17 AS STRING) | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q43.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.A.A, promote(@c14 AS STRING)) EQUALS promote(@c17 AS STRING)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q47.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.A.A, promote(@c14 AS STRING)) EQUALS promote(@c17 AS STRING)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q43> label="q43" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q47> label="q47" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} Z -nested-with-nulls-tests?EXPLAIN select id from t1 where coalesce(a.a.a, 'blah') = 'a1p' -؟ -p ׆(!0*8*@zISCAN(I1 <,>) | FILTER coalesce_string(_.A.A.A, promote(@c14 AS STRING)) EQUALS promote(@c17 AS STRING) | MAP (_.ID AS ID) digraph G { +nested-with-nulls-tests?EXPLAIN select id from t1 where coalesce(a.a.a, 'blah') = 'a1p' +ݍt (!0*8*@zISCAN(I1 <,>) | FILTER coalesce_string(_.A.A.A, promote(@c14 AS STRING)) EQUALS promote(@c17 AS STRING) | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q43.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.A.A, promote(@c14 AS STRING)) EQUALS promote(@c17 AS STRING)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q47.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.A.A, promote(@c14 AS STRING)) EQUALS promote(@c17 AS STRING)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q43> label="q43" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q47> label="q47" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} ^ -nested-with-nulls-testsCEXPLAIN select id from t1 where coalesce(a.a.a, 'blah') IS NOT NULL -p Ƿ(!0ٷ8*@dISCAN(I1 <,>) | FILTER coalesce_string(_.A.A.A, promote(@c14 AS STRING)) NOT_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-testsCEXPLAIN select id from t1 where coalesce(a.a.a, 'blah') IS NOT NULL +t (!0*8*@dISCAN(I1 <,>) | FILTER coalesce_string(_.A.A.A, promote(@c14 AS STRING)) NOT_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q43.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.A.A, promote(@c14 AS STRING)) NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q47.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.A.A, promote(@c14 AS STRING)) NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q43> label="q43" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q47> label="q47" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} \ -nested-with-nulls-testsAEXPLAIN select id from t1 where coalesce(a.a.a, null) IS NOT NULL -p (!08*@QISCAN(I1 <,>) | FILTER coalesce_string(_.A.A.A, NULL) NOT_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-testsAEXPLAIN select id from t1 where coalesce(a.a.a, null) IS NOT NULL +t (!0#8*@QISCAN(I1 <,>) | FILTER coalesce_string(_.A.A.A, NULL) NOT_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q43.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.A.A, NULL) NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q47.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.A.A, NULL) NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q43> label="q43" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q47> label="q47" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} W -nested-with-nulls-tests) | FILTER coalesce_string(_.A.B.A, promote(@c14 AS STRING)) EQUALS promote(@c14 AS STRING) | MAP (_.ID AS ID) digraph G { +nested-with-nulls-tests) | FILTER coalesce_string(_.A.B.A, promote(@c14 AS STRING)) EQUALS promote(@c14 AS STRING) | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q43.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.B.A, promote(@c14 AS STRING)) EQUALS promote(@c14 AS STRING)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q47.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.B.A, promote(@c14 AS STRING)) EQUALS promote(@c14 AS STRING)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q43> label="q43" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q47> label="q47" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} Y -nested-with-nulls-tests>EXPLAIN select id from t1 where coalesce(a.b.a, 'foo') = 'foo' - p (!0.8*@zISCAN(I1 <,>) | FILTER coalesce_string(_.A.B.A, promote(@c14 AS STRING)) EQUALS promote(@c14 AS STRING) | MAP (_.ID AS ID) digraph G { +nested-with-nulls-tests>EXPLAIN select id from t1 where coalesce(a.b.a, 'foo') = 'foo' +t (!0*8*@zISCAN(I1 <,>) | FILTER coalesce_string(_.A.B.A, promote(@c14 AS STRING)) EQUALS promote(@c14 AS STRING) | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q43.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.B.A, promote(@c14 AS STRING)) EQUALS promote(@c14 AS STRING)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q47.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.B.A, promote(@c14 AS STRING)) EQUALS promote(@c14 AS STRING)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q43> label="q43" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q47> label="q47" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} Y -nested-with-nulls-tests>EXPLAIN select id from t1 where coalesce(a.b.a, 'foo') IS NULL -p (!0՚8*@cISCAN(I1 <,>) | FILTER coalesce_string(_.A.B.A, promote(@c14 AS STRING)) IS_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-tests>EXPLAIN select id from t1 where coalesce(a.b.a, 'foo') IS NULL +t Б(!08*@cISCAN(I1 <,>) | FILTER coalesce_string(_.A.B.A, promote(@c14 AS STRING)) IS_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q43.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.B.A, promote(@c14 AS STRING)) IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q47.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.B.A, promote(@c14 AS STRING)) IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q43> label="q43" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q47> label="q47" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} X -nested-with-nulls-tests=EXPLAIN select id from t1 where coalesce(a.b.a, null) IS NULL -p ܛ(!018*@PISCAN(I1 <,>) | FILTER coalesce_string(_.A.B.A, NULL) IS_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-tests=EXPLAIN select id from t1 where coalesce(a.b.a, null) IS NULL +t (!0!8*@PISCAN(I1 <,>) | FILTER coalesce_string(_.A.B.A, NULL) IS_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q43.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.B.A, NULL) IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q47.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.B.A, NULL) IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q43> label="q43" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q47> label="q47" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} ] -nested-with-nulls-testsBEXPLAIN select id from t1 where coalesce(a.b.a, 'foo') IS NOT NULL -іp (!08*@dISCAN(I1 <,>) | FILTER coalesce_string(_.A.B.A, promote(@c14 AS STRING)) NOT_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-testsBEXPLAIN select id from t1 where coalesce(a.b.a, 'foo') IS NOT NULL +t (!08*@dISCAN(I1 <,>) | FILTER coalesce_string(_.A.B.A, promote(@c14 AS STRING)) NOT_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q43.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.B.A, promote(@c14 AS STRING)) NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q47.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE coalesce_string(q2.A.B.A, promote(@c14 AS STRING)) NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q43> label="q43" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q47> label="q47" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} Q -nested-with-nulls-tests6EXPLAIN select id from t1 where coalesce(b.a.b, 3) = 3 -䲧b Ё(0ʐ8$@tISCAN(I1 <,>) | FILTER coalesce_long(_.B.A.B, promote(@c14 AS LONG)) EQUALS promote(@c14 AS LONG) | MAP (_.ID AS ID) digraph G { +nested-with-nulls-tests6EXPLAIN select id from t1 where coalesce(b.a.b, 3) = 3 +f (0Ⱦ8$@tISCAN(I1 <,>) | FILTER coalesce_long(_.B.A.B, promote(@c14 AS LONG)) EQUALS promote(@c14 AS LONG) | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q41.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE coalesce_long(q2.B.A.B, promote(@c14 AS LONG)) EQUALS promote(@c14 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q45.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE coalesce_long(q2.B.A.B, promote(@c14 AS LONG)) EQUALS promote(@c14 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q45> label="q45" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} S -nested-with-nulls-tests8EXPLAIN select id from t1 where coalesce(b.a.b, 42) = 42 -䲧b Ё(0ʐ8$@tISCAN(I1 <,>) | FILTER coalesce_long(_.B.A.B, promote(@c14 AS LONG)) EQUALS promote(@c14 AS LONG) | MAP (_.ID AS ID) digraph G { +nested-with-nulls-tests8EXPLAIN select id from t1 where coalesce(b.a.b, 42) = 42 +f (0Ⱦ8$@tISCAN(I1 <,>) | FILTER coalesce_long(_.B.A.B, promote(@c14 AS LONG)) EQUALS promote(@c14 AS LONG) | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q41.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE coalesce_long(q2.B.A.B, promote(@c14 AS LONG)) EQUALS promote(@c14 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q45.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE coalesce_long(q2.B.A.B, promote(@c14 AS LONG)) EQUALS promote(@c14 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q45> label="q45" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} V -nested-with-nulls-tests;EXPLAIN select id from t1 where coalesce(b.a.b, 42) IS NULL -b (08$@_ISCAN(I1 <,>) | FILTER coalesce_long(_.B.A.B, promote(@c14 AS LONG)) IS_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-tests;EXPLAIN select id from t1 where coalesce(b.a.b, 42) IS NULL +f (0 8$@_ISCAN(I1 <,>) | FILTER coalesce_long(_.B.A.B, promote(@c14 AS LONG)) IS_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q41.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE coalesce_long(q2.B.A.B, promote(@c14 AS LONG)) IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q45.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE coalesce_long(q2.B.A.B, promote(@c14 AS LONG)) IS_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q45> label="q45" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} Z -nested-with-nulls-tests?EXPLAIN select id from t1 where coalesce(b.a.b, 42) IS NOT NULL -b v(08$@`ISCAN(I1 <,>) | FILTER coalesce_long(_.B.A.B, promote(@c14 AS LONG)) NOT_NULL | MAP (_.ID AS ID) digraph G { +nested-with-nulls-tests?EXPLAIN select id from t1 where coalesce(b.a.b, 42) IS NOT NULL +f á(0%8$@`ISCAN(I1 <,>) | FILTER coalesce_long(_.B.A.B, promote(@c14 AS LONG)) NOT_NULL | MAP (_.ID AS ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q41.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Predicate Filter
    WHERE coalesce_long(q2.B.A.B, promote(@c14 AS LONG)) NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q45.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; + 2 [ label=<
    Predicate Filter
    WHERE coalesce_long(q2.B.A.B, promote(@c14 AS LONG)) NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 3 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS A, STRING AS A, LONG AS B AS A, STRING AS A, LONG AS B AS B AS B)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q45> label="q45" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; } \ No newline at end of file diff --git a/yaml-tests/src/test/resources/nested-with-nulls.metrics.yaml b/yaml-tests/src/test/resources/nested-with-nulls.metrics.yaml index ba03410009..595dd2a19d 100644 --- a/yaml-tests/src/test/resources/nested-with-nulls.metrics.yaml +++ b/yaml-tests/src/test/resources/nested-with-nulls.metrics.yaml @@ -2,9 +2,9 @@ nested-with-nulls-tests: - query: EXPLAIN select id from t1 where a.a.a IS NULL explain: ISCAN(I1 <,>) | FILTER _.A.A.A IS_NULL | MAP (_.ID AS ID) task_count: 355 - task_total_time_ms: 12 - transform_count: 98 - transform_time_ms: 7 + task_total_time_ms: 17 + transform_count: 102 + transform_time_ms: 5 transform_yield_count: 30 insert_time_ms: 0 insert_new_count: 36 @@ -12,8 +12,8 @@ nested-with-nulls-tests: - query: EXPLAIN select id from t1 where a.a.b IS NULL explain: ISCAN(I1 <,>) | FILTER _.A.A.B IS_NULL | MAP (_.ID AS ID) task_count: 355 - task_total_time_ms: 12 - transform_count: 98 + task_total_time_ms: 11 + transform_count: 102 transform_time_ms: 4 transform_yield_count: 30 insert_time_ms: 0 @@ -23,9 +23,9 @@ nested-with-nulls-tests: explain: 'COVERING(I1 [[null],[null]] -> [ID: KEY[2], A: [B: [A: KEY[0]]]]) | MAP (_.ID AS ID)' task_count: 443 - task_total_time_ms: 30 - transform_count: 109 - transform_time_ms: 5 + task_total_time_ms: 18 + transform_count: 113 + transform_time_ms: 4 transform_yield_count: 36 insert_time_ms: 0 insert_new_count: 45 @@ -33,8 +33,8 @@ nested-with-nulls-tests: - query: EXPLAIN select id from t1 where a.b.b IS NULL explain: ISCAN(I1 <,>) | FILTER _.A.B.B IS_NULL | MAP (_.ID AS ID) task_count: 355 - task_total_time_ms: 5 - transform_count: 98 + task_total_time_ms: 6 + transform_count: 102 transform_time_ms: 2 transform_yield_count: 30 insert_time_ms: 0 @@ -43,8 +43,8 @@ nested-with-nulls-tests: - query: EXPLAIN select id from t1 where b.a.a IS NULL explain: ISCAN(I1 <,>) | FILTER _.B.A.A IS_NULL | MAP (_.ID AS ID) task_count: 355 - task_total_time_ms: 7 - transform_count: 98 + task_total_time_ms: 9 + transform_count: 102 transform_time_ms: 3 transform_yield_count: 30 insert_time_ms: 0 @@ -53,9 +53,9 @@ nested-with-nulls-tests: - query: EXPLAIN select id from t1 where b.a.b IS NULL explain: ISCAN(I1 <,>) | FILTER _.B.A.B IS_NULL | MAP (_.ID AS ID) task_count: 355 - task_total_time_ms: 6 - transform_count: 98 - transform_time_ms: 2 + task_total_time_ms: 16 + transform_count: 102 + transform_time_ms: 5 transform_yield_count: 30 insert_time_ms: 0 insert_new_count: 36 @@ -63,9 +63,9 @@ nested-with-nulls-tests: - query: EXPLAIN select id from t1 where b.b.a IS NULL explain: ISCAN(I1 <,>) | FILTER _.B.B.A IS_NULL | MAP (_.ID AS ID) task_count: 355 - task_total_time_ms: 24 - transform_count: 98 - transform_time_ms: 15 + task_total_time_ms: 17 + transform_count: 102 + transform_time_ms: 5 transform_yield_count: 30 insert_time_ms: 0 insert_new_count: 36 @@ -73,9 +73,9 @@ nested-with-nulls-tests: - query: EXPLAIN select id from t1 where b.b.b IS NULL explain: ISCAN(I1 <,>) | FILTER _.B.B.B IS_NULL | MAP (_.ID AS ID) task_count: 355 - task_total_time_ms: 5 - transform_count: 98 - transform_time_ms: 2 + task_total_time_ms: 12 + transform_count: 102 + transform_time_ms: 4 transform_yield_count: 30 insert_time_ms: 0 insert_new_count: 36 @@ -83,9 +83,9 @@ nested-with-nulls-tests: - query: EXPLAIN select id from t1 where a.a.a IS NOT NULL explain: ISCAN(I1 <,>) | FILTER _.A.A.A NOT_NULL | MAP (_.ID AS ID) task_count: 355 - task_total_time_ms: 4 - transform_count: 98 - transform_time_ms: 1 + task_total_time_ms: 10 + transform_count: 102 + transform_time_ms: 3 transform_yield_count: 30 insert_time_ms: 0 insert_new_count: 36 @@ -94,9 +94,9 @@ nested-with-nulls-tests: explain: 'COVERING(I2 ([null],> -> [ID: KEY[2], A: [A: [B: KEY[0]]]]) | MAP (_.ID AS ID)' task_count: 454 - task_total_time_ms: 7 - transform_count: 123 - transform_time_ms: 2 + task_total_time_ms: 9 + transform_count: 127 + transform_time_ms: 3 transform_yield_count: 38 insert_time_ms: 0 insert_new_count: 47 @@ -105,9 +105,9 @@ nested-with-nulls-tests: explain: 'COVERING(I1 ([null],> -> [ID: KEY[2], A: [B: [A: KEY[0]]]]) | MAP (_.ID AS ID)' task_count: 443 - task_total_time_ms: 7 - transform_count: 109 - transform_time_ms: 2 + task_total_time_ms: 16 + transform_count: 113 + transform_time_ms: 4 transform_yield_count: 36 insert_time_ms: 0 insert_new_count: 45 @@ -115,9 +115,9 @@ nested-with-nulls-tests: - query: EXPLAIN select id from t1 where a.b.b IS NOT NULL explain: ISCAN(I1 <,>) | FILTER _.A.B.B NOT_NULL | MAP (_.ID AS ID) task_count: 355 - task_total_time_ms: 4 - transform_count: 98 - transform_time_ms: 1 + task_total_time_ms: 8 + transform_count: 102 + transform_time_ms: 2 transform_yield_count: 30 insert_time_ms: 0 insert_new_count: 36 @@ -125,9 +125,9 @@ nested-with-nulls-tests: - query: EXPLAIN select id from t1 where b.a.a IS NOT NULL explain: ISCAN(I1 <,>) | FILTER _.B.A.A NOT_NULL | MAP (_.ID AS ID) task_count: 355 - task_total_time_ms: 13 - transform_count: 98 - transform_time_ms: 5 + task_total_time_ms: 5 + transform_count: 102 + transform_time_ms: 2 transform_yield_count: 30 insert_time_ms: 0 insert_new_count: 36 @@ -135,9 +135,9 @@ nested-with-nulls-tests: - query: EXPLAIN select id from t1 where b.a.b IS NOT NULL explain: ISCAN(I1 <,>) | FILTER _.B.A.B NOT_NULL | MAP (_.ID AS ID) task_count: 355 - task_total_time_ms: 4 - transform_count: 98 - transform_time_ms: 2 + task_total_time_ms: 15 + transform_count: 102 + transform_time_ms: 5 transform_yield_count: 30 insert_time_ms: 0 insert_new_count: 36 @@ -145,9 +145,9 @@ nested-with-nulls-tests: - query: EXPLAIN select id from t1 where b.b.a IS NOT NULL explain: ISCAN(I1 <,>) | FILTER _.B.B.A NOT_NULL | MAP (_.ID AS ID) task_count: 355 - task_total_time_ms: 4 - transform_count: 98 - transform_time_ms: 1 + task_total_time_ms: 16 + transform_count: 102 + transform_time_ms: 5 transform_yield_count: 30 insert_time_ms: 0 insert_new_count: 36 @@ -155,9 +155,9 @@ nested-with-nulls-tests: - query: EXPLAIN select id from t1 where b.b.b IS NOT NULL explain: ISCAN(I1 <,>) | FILTER _.B.B.B NOT_NULL | MAP (_.ID AS ID) task_count: 355 - task_total_time_ms: 19 - transform_count: 98 - transform_time_ms: 10 + task_total_time_ms: 10 + transform_count: 102 + transform_time_ms: 4 transform_yield_count: 30 insert_time_ms: 0 insert_new_count: 36 @@ -166,9 +166,9 @@ nested-with-nulls-tests: explain: ISCAN(I1 <,>) | FILTER coalesce_string(_.A.A.A, promote(@c14 AS STRING)) EQUALS promote(@c17 AS STRING) | MAP (_.ID AS ID) task_count: 378 - task_total_time_ms: 21 - transform_count: 112 - transform_time_ms: 5 + task_total_time_ms: 17 + transform_count: 116 + transform_time_ms: 6 transform_yield_count: 33 insert_time_ms: 0 insert_new_count: 42 @@ -177,9 +177,9 @@ nested-with-nulls-tests: explain: ISCAN(I1 <,>) | FILTER coalesce_string(_.A.A.A, promote(@c14 AS STRING)) EQUALS promote(@c17 AS STRING) | MAP (_.ID AS ID) task_count: 378 - task_total_time_ms: 21 - transform_count: 112 - transform_time_ms: 5 + task_total_time_ms: 17 + transform_count: 116 + transform_time_ms: 6 transform_yield_count: 33 insert_time_ms: 0 insert_new_count: 42 @@ -188,9 +188,9 @@ nested-with-nulls-tests: explain: ISCAN(I1 <,>) | FILTER coalesce_string(_.A.A.A, promote(@c14 AS STRING)) NOT_NULL | MAP (_.ID AS ID) task_count: 378 - task_total_time_ms: 6 - transform_count: 112 - transform_time_ms: 2 + task_total_time_ms: 17 + transform_count: 116 + transform_time_ms: 6 transform_yield_count: 33 insert_time_ms: 0 insert_new_count: 42 @@ -199,9 +199,9 @@ nested-with-nulls-tests: explain: ISCAN(I1 <,>) | FILTER coalesce_string(_.A.A.A, NULL) NOT_NULL | MAP (_.ID AS ID) task_count: 378 - task_total_time_ms: 6 - transform_count: 112 - transform_time_ms: 2 + task_total_time_ms: 13 + transform_count: 116 + transform_time_ms: 4 transform_yield_count: 33 insert_time_ms: 0 insert_new_count: 42 @@ -210,8 +210,8 @@ nested-with-nulls-tests: explain: ISCAN(I1 <,>) | FILTER coalesce_string(_.A.B.A, promote(@c14 AS STRING)) EQUALS promote(@c14 AS STRING) | MAP (_.ID AS ID) task_count: 378 - task_total_time_ms: 23 - transform_count: 112 + task_total_time_ms: 16 + transform_count: 116 transform_time_ms: 5 transform_yield_count: 33 insert_time_ms: 0 @@ -221,8 +221,8 @@ nested-with-nulls-tests: explain: ISCAN(I1 <,>) | FILTER coalesce_string(_.A.B.A, promote(@c14 AS STRING)) EQUALS promote(@c14 AS STRING) | MAP (_.ID AS ID) task_count: 378 - task_total_time_ms: 23 - transform_count: 112 + task_total_time_ms: 16 + transform_count: 116 transform_time_ms: 5 transform_yield_count: 33 insert_time_ms: 0 @@ -232,8 +232,8 @@ nested-with-nulls-tests: explain: ISCAN(I1 <,>) | FILTER coalesce_string(_.A.B.A, promote(@c14 AS STRING)) IS_NULL | MAP (_.ID AS ID) task_count: 378 - task_total_time_ms: 7 - transform_count: 112 + task_total_time_ms: 5 + transform_count: 116 transform_time_ms: 2 transform_yield_count: 33 insert_time_ms: 0 @@ -243,9 +243,9 @@ nested-with-nulls-tests: explain: ISCAN(I1 <,>) | FILTER coalesce_string(_.A.B.A, NULL) IS_NULL | MAP (_.ID AS ID) task_count: 378 - task_total_time_ms: 14 - transform_count: 112 - transform_time_ms: 7 + task_total_time_ms: 11 + transform_count: 116 + transform_time_ms: 4 transform_yield_count: 33 insert_time_ms: 0 insert_new_count: 42 @@ -254,9 +254,9 @@ nested-with-nulls-tests: explain: ISCAN(I1 <,>) | FILTER coalesce_string(_.A.B.A, promote(@c14 AS STRING)) NOT_NULL | MAP (_.ID AS ID) task_count: 378 - task_total_time_ms: 7 - transform_count: 112 - transform_time_ms: 4 + task_total_time_ms: 8 + transform_count: 116 + transform_time_ms: 3 transform_yield_count: 33 insert_time_ms: 0 insert_new_count: 42 @@ -265,9 +265,9 @@ nested-with-nulls-tests: explain: ISCAN(I1 <,>) | FILTER coalesce_long(_.B.A.B, promote(@c14 AS LONG)) EQUALS promote(@c14 AS LONG) | MAP (_.ID AS ID) task_count: 355 - task_total_time_ms: 4 - transform_count: 98 - transform_time_ms: 2 + task_total_time_ms: 8 + transform_count: 102 + transform_time_ms: 3 transform_yield_count: 30 insert_time_ms: 0 insert_new_count: 36 @@ -276,9 +276,9 @@ nested-with-nulls-tests: explain: ISCAN(I1 <,>) | FILTER coalesce_long(_.B.A.B, promote(@c14 AS LONG)) EQUALS promote(@c14 AS LONG) | MAP (_.ID AS ID) task_count: 355 - task_total_time_ms: 4 - transform_count: 98 - transform_time_ms: 2 + task_total_time_ms: 8 + transform_count: 102 + transform_time_ms: 3 transform_yield_count: 30 insert_time_ms: 0 insert_new_count: 36 @@ -287,9 +287,9 @@ nested-with-nulls-tests: explain: ISCAN(I1 <,>) | FILTER coalesce_long(_.B.A.B, promote(@c14 AS LONG)) IS_NULL | MAP (_.ID AS ID) task_count: 355 - task_total_time_ms: 5 - transform_count: 98 - transform_time_ms: 2 + task_total_time_ms: 14 + transform_count: 102 + transform_time_ms: 4 transform_yield_count: 30 insert_time_ms: 0 insert_new_count: 36 @@ -298,9 +298,9 @@ nested-with-nulls-tests: explain: ISCAN(I1 <,>) | FILTER coalesce_long(_.B.A.B, promote(@c14 AS LONG)) NOT_NULL | MAP (_.ID AS ID) task_count: 355 - task_total_time_ms: 4 - transform_count: 98 - transform_time_ms: 1 + task_total_time_ms: 16 + transform_count: 102 + transform_time_ms: 5 transform_yield_count: 30 insert_time_ms: 0 insert_new_count: 36 diff --git a/yaml-tests/src/test/resources/null-operator-tests.metrics.binpb b/yaml-tests/src/test/resources/null-operator-tests.metrics.binpb index 41aa63e622..e33d24d481 100644 --- a/yaml-tests/src/test/resources/null-operator-tests.metrics.binpb +++ b/yaml-tests/src/test/resources/null-operator-tests.metrics.binpb @@ -1,23 +1,23 @@ - + v -null-operator-tests_EXPLAIN select count(*) from (select * from (select * from T1) as x where ID is not null) as y; - (*068G@COVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER _.ID NOT_NULL | FETCH | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +null-operator-tests_EXPLAIN select count(*) from (select * from (select * from T1) as x where ID is not null) as y; + (*0.8G@COVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER _.ID NOT_NULL | FETCH | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q10._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q10 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q50 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Fetch Records
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Predicate Filter
    WHERE q52.ID NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 7 [ label=<
    Covering Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 8 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 4 [ label=<
    Value Computation
    MAP (q54 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Fetch Records
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Predicate Filter
    WHERE q56.ID NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 7 [ label=<
    Covering Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 8 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q10> label="q10" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q76> label="q76" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q50> label="q50" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q54> label="q54" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q52> label="q52" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q82> label="q82" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q54> label="q54" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q58> label="q58" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 6 [ label=< q56> label="q56" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q10> label="q10" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; } \ No newline at end of file diff --git a/yaml-tests/src/test/resources/null-operator-tests.metrics.yaml b/yaml-tests/src/test/resources/null-operator-tests.metrics.yaml index defe8079fa..7e7458c0f9 100644 --- a/yaml-tests/src/test/resources/null-operator-tests.metrics.yaml +++ b/yaml-tests/src/test/resources/null-operator-tests.metrics.yaml @@ -5,9 +5,9 @@ null-operator-tests: | FETCH | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)' task_count: 610 - task_total_time_ms: 13 - transform_count: 169 - transform_time_ms: 4 + task_total_time_ms: 12 + transform_count: 173 + transform_time_ms: 3 transform_yield_count: 42 insert_time_ms: 0 insert_new_count: 71 diff --git a/yaml-tests/src/test/resources/orderby.metrics.binpb b/yaml-tests/src/test/resources/orderby.metrics.binpb index 691acb5b93..8edbf3b14c 100644 --- a/yaml-tests/src/test/resources/orderby.metrics.binpb +++ b/yaml-tests/src/test/resources/orderby.metrics.binpb @@ -1,69 +1,70 @@ - + 4 - orderby-tests#EXPLAIN select c from t1 order by b -ÍO İ($08@cCOVERING(I1 <,> -> [A: KEY[2], B: KEY[0], C: VALUE[0]]) | MAP (_.C AS C, _.B AS B) | MAP (_.C AS C) digraph G { + orderby-tests#EXPLAIN select c from t1 order by b +S ($08@cCOVERING(I1 <,> -> [A: KEY[2], B: KEY[0], C: VALUE[0]]) | MAP (_.C AS C, _.B AS B) | MAP (_.C AS C) digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6.C AS C)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS C)" ]; - 2 [ label=<
    Value Computation
    MAP (q45.C AS C, q45.B AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS C, )" ]; - 3 [ label=<
    Covering Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, )" ]; - 3 -> 2 [ label=< q45> label="q45" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Value Computation
    MAP (q47.C AS C, q47.B AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS C, LONG AS B)" ]; + 3 [ label=<
    Covering Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B, LONG AS C)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B, LONG AS C)" ]; + 3 -> 2 [ label=< q47> label="q47" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} 4 - orderby-tests#EXPLAIN select b from t1 order by c -ʡ` (+0ˑ 8)@cCOVERING(I2 <,> -> [A: KEY[2], B: VALUE[0], C: KEY[0]]) | MAP (_.B AS B, _.C AS C) | MAP (_.B AS B) digraph G { + orderby-tests#EXPLAIN select b from t1 order by c +d (+08)@cCOVERING(I2 <,> -> [A: KEY[2], B: VALUE[0], C: KEY[0]]) | MAP (_.B AS B, _.C AS C) | MAP (_.B AS B) digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6.B AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS B)" ]; - 2 [ label=<
    Value Computation
    MAP (q52.B AS B, q52.C AS C)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS B, )" ]; - 3 [ label=<
    Covering Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, )" ]; - 4 [ label=<
    Index
    I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, )" ]; - 3 -> 2 [ label=< q52> label="q52" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Value Computation
    MAP (q56.B AS B, q56.C AS C)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS B, LONG AS C)" ]; + 3 [ label=<
    Covering Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B, LONG AS C)" ]; + 4 [ label=<
    Index
    I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B, LONG AS C)" ]; + 3 -> 2 [ label=< q56> label="q56" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} 9 - orderby-tests(EXPLAIN select c from t1 order by b desc -O Ӱ($08@kCOVERING(I1 <,> REVERSE -> [A: KEY[2], B: KEY[0], C: VALUE[0]]) | MAP (_.C AS C, _.B AS B) | MAP (_.C AS C) digraph G { + orderby-tests(EXPLAIN select c from t1 order by b desc +S ($08@kCOVERING(I1 <,> REVERSE -> [A: KEY[2], B: KEY[0], C: VALUE[0]]) | MAP (_.C AS C, _.B AS B) | MAP (_.C AS C)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6.C AS C)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS C)" ]; - 2 [ label=<
    Value Computation
    MAP (q45.C AS C, q45.B AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS C, )" ]; - 3 [ label=<
    Covering Index Scan
    range: <-∞, ∞>
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, )" ]; - 3 -> 2 [ label=< q45> label="q45" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Value Computation
    MAP (q47.C AS C, q47.B AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS C, LONG AS B)" ]; + 3 [ label=<
    Covering Index Scan
    range: <-∞, ∞>
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B, LONG AS C)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B, LONG AS C)" ]; + 3 -> 2 [ label=< q47> label="q47" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} 9 - orderby-tests(EXPLAIN select b from t1 order by c desc -Б ` ߵ(+008)@kCOVERING(I2 <,> REVERSE -> [A: KEY[2], B: VALUE[0], C: KEY[0]]) | MAP (_.B AS B, _.C AS C) | MAP (_.B AS B) digraph G { + orderby-tests(EXPLAIN select b from t1 order by c desc +d ܾ(+0!8)@kCOVERING(I2 <,> REVERSE -> [A: KEY[2], B: VALUE[0], C: KEY[0]]) | MAP (_.B AS B, _.C AS C) | MAP (_.B AS B)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6.B AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS B)" ]; - 2 [ label=<
    Value Computation
    MAP (q52.B AS B, q52.C AS C)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS B, )" ]; - 3 [ label=<
    Covering Index Scan
    range: <-∞, ∞>
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, )" ]; - 4 [ label=<
    Index
    I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, )" ]; - 3 -> 2 [ label=< q52> label="q52" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Value Computation
    MAP (q56.B AS B, q56.C AS C)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS B, LONG AS C)" ]; + 3 [ label=<
    Covering Index Scan
    range: <-∞, ∞>
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B, LONG AS C)" ]; + 4 [ label=<
    Index
    I2
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B, LONG AS C)" ]; + 3 -> 2 [ label=< q56> label="q56" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} @ - orderby-tests/EXPLAIN select c, b from t5 order by c, b desc; -4 Ґ(08@vCOVERING(I8 <,> -> [A: KEY[3], B: from_ordered_bytes(KEY:[1], DESC_NULLS_LAST), C: KEY[0]]) | MAP (_.C AS C, _.B AS B) digraph G { + orderby-tests/EXPLAIN select c, b from t5 order by c, b desc; +8 (0 8@vCOVERING(I8 <,> -> [A: KEY[3], B: from_ordered_bytes(KEY:[1], DESC_NULLS_LAST), C: KEY[0]]) | MAP (_.C AS C, _.B AS B) +digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q30.C AS C, q30.B AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS C, )" ]; - 2 [ label=<
    Covering Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, )" ]; - 3 [ label=<
    Index
    I8
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, )" ]; + 1 [ label=<
    Value Computation
    MAP (q32.C AS C, q32.B AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS C, LONG AS B)" ]; + 2 [ label=<
    Covering Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B, LONG AS C)" ]; + 3 [ label=<
    Index
    I8
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B, LONG AS C)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q30> label="q30" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q32> label="q32" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; } \ No newline at end of file diff --git a/yaml-tests/src/test/resources/orderby.metrics.yaml b/yaml-tests/src/test/resources/orderby.metrics.yaml index 7710897785..ec8d5e5407 100644 --- a/yaml-tests/src/test/resources/orderby.metrics.yaml +++ b/yaml-tests/src/test/resources/orderby.metrics.yaml @@ -3,9 +3,9 @@ orderby-tests: explain: 'COVERING(I1 <,> -> [A: KEY[2], B: KEY[0], C: VALUE[0]]) | MAP (_.C AS C, _.B AS B) | MAP (_.C AS C)' task_count: 302 - task_total_time_ms: 6 - transform_count: 79 - transform_time_ms: 2 + task_total_time_ms: 7 + transform_count: 83 + transform_time_ms: 3 transform_yield_count: 36 insert_time_ms: 0 insert_new_count: 25 @@ -14,9 +14,9 @@ orderby-tests: explain: 'COVERING(I2 <,> -> [A: KEY[2], B: VALUE[0], C: KEY[0]]) | MAP (_.B AS B, _.C AS C) | MAP (_.B AS B)' task_count: 407 - task_total_time_ms: 8 - transform_count: 96 - transform_time_ms: 3 + task_total_time_ms: 14 + transform_count: 100 + transform_time_ms: 5 transform_yield_count: 43 insert_time_ms: 0 insert_new_count: 41 @@ -25,9 +25,9 @@ orderby-tests: explain: 'COVERING(I1 <,> REVERSE -> [A: KEY[2], B: KEY[0], C: VALUE[0]]) | MAP (_.C AS C, _.B AS B) | MAP (_.C AS C)' task_count: 302 - task_total_time_ms: 13 - transform_count: 79 - transform_time_ms: 4 + task_total_time_ms: 14 + transform_count: 83 + transform_time_ms: 5 transform_yield_count: 36 insert_time_ms: 0 insert_new_count: 25 @@ -36,8 +36,8 @@ orderby-tests: explain: 'COVERING(I2 <,> REVERSE -> [A: KEY[2], B: VALUE[0], C: KEY[0]]) | MAP (_.B AS B, _.C AS C) | MAP (_.B AS B)' task_count: 407 - task_total_time_ms: 19 - transform_count: 96 + task_total_time_ms: 17 + transform_count: 100 transform_time_ms: 7 transform_yield_count: 43 insert_time_ms: 0 @@ -47,9 +47,9 @@ orderby-tests: explain: 'COVERING(I8 <,> -> [A: KEY[3], B: from_ordered_bytes(KEY:[1], DESC_NULLS_LAST), C: KEY[0]]) | MAP (_.C AS C, _.B AS B)' task_count: 210 - task_total_time_ms: 6 - transform_count: 52 - transform_time_ms: 3 + task_total_time_ms: 9 + transform_count: 56 + transform_time_ms: 5 transform_yield_count: 22 insert_time_ms: 0 insert_new_count: 20 diff --git a/yaml-tests/src/test/resources/primary-key-tests.metrics.binpb b/yaml-tests/src/test/resources/primary-key-tests.metrics.binpb index 2b5e6a485e..c0d116ed4a 100644 --- a/yaml-tests/src/test/resources/primary-key-tests.metrics.binpb +++ b/yaml-tests/src/test/resources/primary-key-tests.metrics.binpb @@ -1,18 +1,18 @@ - + 4 -primary-key-testsEXPLAIN SELECT COUNT(*) FROM T1 -֭? ǝT(0ņ 8@SCAN(<,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +primary-key-testsEXPLAIN SELECT COUNT(*) FROM T1 +C o(08@SCAN(<,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, AS ID, AS _0)" ]; - 5 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, AS ID, )" ]; - 6 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, AS ID, )" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B, LONG AS Q, LONG AS Z AS ID, LONG AS G AS _0)" ]; + 5 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B, LONG AS Q, LONG AS Z AS ID, LONG AS G)" ]; + 6 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B, LONG AS Q, LONG AS Z AS ID, LONG AS G)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q28> label="q28" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q31> label="q31" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; diff --git a/yaml-tests/src/test/resources/primary-key-tests.metrics.yaml b/yaml-tests/src/test/resources/primary-key-tests.metrics.yaml index cdb54fe27e..75e1ced65a 100644 --- a/yaml-tests/src/test/resources/primary-key-tests.metrics.yaml +++ b/yaml-tests/src/test/resources/primary-key-tests.metrics.yaml @@ -3,8 +3,8 @@ primary-key-tests: explain: SCAN(<,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 247 - task_total_time_ms: 2 - transform_count: 63 + task_total_time_ms: 3 + transform_count: 67 transform_time_ms: 1 transform_yield_count: 17 insert_time_ms: 0 diff --git a/yaml-tests/src/test/resources/recursive-cte.metrics.binpb b/yaml-tests/src/test/resources/recursive-cte.metrics.binpb index a32d83aab3..f628698785 100644 --- a/yaml-tests/src/test/resources/recursive-cte.metrics.binpb +++ b/yaml-tests/src/test/resources/recursive-cte.metrics.binpb @@ -1,132 +1,147 @@ -2 +?  -recursive-cte-testsEXPLAIN with recursive c1 as ( select id, parent from t1 where parent = -1 union all select b.id, b.parent from c1 as a, t1 as b where a.id = b.parent) select id from c11 - -  (b0p8@ RUNION q0, q1 { INITIAL { ISCAN(PARENTIDX [EQUALS promote(@c15 AS LONG)]) | INSERT INTO TEMP q1 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q2 -> { TEMP SCAN base() | FILTER _.ID EQUALS q2.PARENT AS q3 RETURN (q2.ID AS ID, q2.PARENT AS PARENT) } | INSERT INTO TEMP q1 }} | MAP (_.ID AS ID).digraph G { +recursive-cte-testsEXPLAIN with recursive c1 as ( select id, parent from t1 where parent = -1 union all select b.id, b.parent from c1 as a, t1 as b where a.id = b.parent) select id from c1= + + (_038@ RUNION q0, q1 { INITIAL { ISCAN(PARENTIDX [EQUALS promote(@c15 AS LONG)]) ∩ ISCAN(CHILDIDX <,>) COMPARE BY (_.ID, recordType(_)) | INSERT INTO TEMP q1 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q2 -> { TEMP SCAN base() | FILTER _.ID EQUALS q2.PARENT AS q3 RETURN (q2.ID AS ID, q2.PARENT AS PARENT) } | INSERT INTO TEMP q1 }} | MAP (_.ID AS ID);digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q20.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Recursive Union
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Modification
    TempTableInsert
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Modification
    TempTableInsert
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Temporary Buffer
    C1forInsert
    > color="black" shape="plain" style="filled" fillcolor="goldenrod2" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Nested Loop Join
    FLATMAP (q10.ID AS ID, q10.PARENT AS PARENT)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 7 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c15 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 8 [ label=<
    Temporary Buffer
    C1forInsert
    > color="black" shape="plain" style="filled" fillcolor="goldenrod2" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 9 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 10 [ label=<
    Predicate Filter
    WHERE q8.ID EQUALS q10.PARENT
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 11 [ label=<
    Index
    PARENTIDX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 12 [ label=<
    Index
    CHILDIDX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 13 [ label=<
    Temp Table Scan
    C1forScan
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q180> label="q180" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 2 [ label=< q178> label="q178" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Recursive Union
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 3 [ label=<
    Modification
    TempTableInsert
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 4 [ label=<
    Modification
    TempTableInsert
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 5 [ label=<
    Temporary Buffer
    C1forInsert
    > color="black" shape="plain" style="filled" fillcolor="goldenrod2" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 6 [ label=<
    Nested Loop Join
    FLATMAP (q10.ID AS ID, q10.PARENT AS PARENT)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 7 [ label=<
    Intersection
    COMPARE BY (_.ID, recordType(_))
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 8 [ label=<
    Temporary Buffer
    C1forInsert
    > color="black" shape="plain" style="filled" fillcolor="goldenrod2" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 9 [ label=<
    Predicate Filter
    WHERE q8.ID EQUALS q10.PARENT
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 10 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 11 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c15 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 12 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 13 [ label=<
    Temp Table Scan
    C1forScan
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 14 [ label=<
    Index
    CHILDIDX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 15 [ label=<
    Index
    PARENTIDX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 16 [ label=<
    Index
    CHILDIDX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 3 -> 2 [ label=< q199> label="q199" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 2 [ label=< q197> label="q197" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="none" arrowtail="normal" dir="both" ]; 6 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="none" arrowtail="normal" dir="both" ]; - 9 -> 6 [ label=< q10> label="q10" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 10 -> 6 [ label=< q8> label="q8" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 11 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 12 -> 9 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 13 -> 10 [ label=< q8> label="q8" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 9 -> 6 [ label=< q8> label="q8" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 10 -> 6 [ label=< q10> label="q10" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 11 -> 7 [ label=< q186> label="q186" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 12 -> 7 [ label=< q188> label="q188" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 13 -> 9 [ label=< q8> label="q8" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 14 -> 10 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 15 -> 11 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 16 -> 12 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q20> label="q20" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; { rank=same; rankDir=LR; - 9 -> 10 [ color="red" style="invis" ]; + 6 -> 5 [ color="red" style="invis" ]; } { rank=same; rankDir=LR; - 6 -> 5 [ color="red" style="invis" ]; + 7 -> 8 [ color="red" style="invis" ]; } { rank=same; rankDir=LR; - 7 -> 8 [ color="red" style="invis" ]; + 10 -> 9 [ color="red" style="invis" ]; } -}2 +}?  -recursive-cte-testsEXPLAIN with recursive c1 as ( select id, parent from t1 where id = 250 union all select b.id, b.parent from c1 as a, t1 as b where a.parent = b.id) select id from c11 - -ӫ  (b0`8@ RUNION q0, q1 { INITIAL { ISCAN(CHILDIDX [EQUALS promote(@c15 AS LONG)]) | INSERT INTO TEMP q1 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q2 -> { TEMP SCAN base() | FILTER _.PARENT EQUALS q2.ID AS q3 RETURN (q2.ID AS ID, q2.PARENT AS PARENT) } | INSERT INTO TEMP q1 }} | MAP (_.ID AS ID).digraph G { +recursive-cte-testsEXPLAIN with recursive c1 as ( select id, parent from t1 where id = 250 union all select b.id, b.parent from c1 as a, t1 as b where a.parent = b.id) select id from c1> + +̮ (_0/8@ RUNION q0, q1 { INITIAL { ISCAN(CHILDIDX [EQUALS promote(@c15 AS LONG)]) ∩ ISCAN(PARENTIDX <,>) COMPARE BY (_.PARENT, recordType(_)) | INSERT INTO TEMP q1 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q2 -> { TEMP SCAN base() | FILTER _.PARENT EQUALS q2.ID AS q3 RETURN (q2.ID AS ID, q2.PARENT AS PARENT) } | INSERT INTO TEMP q1 }} | MAP (_.ID AS ID);digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q20.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID)" ]; - 2 [ label=<
    Recursive Union
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Modification
    TempTableInsert
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Modification
    TempTableInsert
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Temporary Buffer
    C1forInsert
    > color="black" shape="plain" style="filled" fillcolor="goldenrod2" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Nested Loop Join
    FLATMAP (q10.ID AS ID, q10.PARENT AS PARENT)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 7 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c15 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 8 [ label=<
    Temporary Buffer
    C1forInsert
    > color="black" shape="plain" style="filled" fillcolor="goldenrod2" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 9 [ label=<
    Predicate Filter
    WHERE q8.PARENT EQUALS q10.ID
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 10 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 11 [ label=<
    Index
    CHILDIDX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 12 [ label=<
    Temp Table Scan
    C1forScan
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 13 [ label=<
    Index
    CHILDIDX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q180> label="q180" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 2 [ label=< q178> label="q178" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="none" arrowtail="normal" dir="both" ]; - 6 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 8 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="none" arrowtail="normal" dir="both" ]; - 9 -> 6 [ label=< q8> label="q8" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 10 -> 6 [ label=< q10> label="q10" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 11 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 12 -> 9 [ label=< q8> label="q8" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 13 -> 10 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Recursive Union
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 3 [ label=<
    Modification
    TempTableInsert
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 4 [ label=<
    Modification
    TempTableInsert
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 5 [ label=<
    Nested Loop Join
    FLATMAP (q10.ID AS ID, q10.PARENT AS PARENT)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 6 [ label=<
    Temporary Buffer
    C1forInsert
    > color="black" shape="plain" style="filled" fillcolor="goldenrod2" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 7 [ label=<
    Temporary Buffer
    C1forInsert
    > color="black" shape="plain" style="filled" fillcolor="goldenrod2" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 8 [ label=<
    Intersection
    COMPARE BY (_.PARENT, recordType(_))
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 9 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 10 [ label=<
    Predicate Filter
    WHERE q8.PARENT EQUALS q10.ID
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 11 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c15 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 12 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 13 [ label=<
    Index
    CHILDIDX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 14 [ label=<
    Temp Table Scan
    C1forScan
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 15 [ label=<
    Index
    CHILDIDX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 16 [ label=<
    Index
    PARENTIDX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 3 -> 2 [ label=< q199> label="q199" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 2 [ label=< q197> label="q197" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="none" arrowtail="normal" dir="both" ]; + 7 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="none" arrowtail="normal" dir="both" ]; + 8 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 9 -> 5 [ label=< q10> label="q10" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 10 -> 5 [ label=< q8> label="q8" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 11 -> 8 [ label=< q186> label="q186" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 12 -> 8 [ label=< q188> label="q188" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 13 -> 9 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 14 -> 10 [ label=< q8> label="q8" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 15 -> 11 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 16 -> 12 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q20> label="q20" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; { rank=same; rankDir=LR; - 10 -> 9 [ color="red" style="invis" ]; + 8 -> 7 [ color="red" style="invis" ]; } { rank=same; rankDir=LR; - 7 -> 8 [ color="red" style="invis" ]; + 5 -> 6 [ color="red" style="invis" ]; } { rank=same; rankDir=LR; - 6 -> 5 [ color="red" style="invis" ]; + 9 -> 10 [ color="red" style="invis" ]; } -}` +}n  -recursive-cte-testsEXPLAIN with recursive allDescendants as ( with recursive ancestorsOf250 as ( select id, parent from t1 where id = 250 union all select b.id, b.parent from ancestorsOf250 as a, t1 as b where a.parent = b.id) select id, parent from ancestorsOf250 union all select b.id, b.parent from allDescendants as a, t1 as b where a.id = b.parent) select id, parent from allDescendants\ - (0~8@RUNION q0, q1 { INITIAL { RUNION q2, q3 { INITIAL { ISCAN(CHILDIDX [EQUALS promote(@c20 AS LONG)]) | INSERT INTO TEMP q3 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q4 -> { TEMP SCAN base() | FILTER _.PARENT EQUALS q4.ID AS q5 RETURN (q4.ID AS ID, q4.PARENT AS PARENT) } | INSERT INTO TEMP q3 }} | MAP (_.ID AS ID, _.PARENT AS PARENT) | INSERT INTO TEMP q1 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q6 -> { TEMP SCAN base() | FILTER _.ID EQUALS q6.PARENT AS q7 RETURN (q6.ID AS ID, q6.PARENT AS PARENT) } | INSERT INTO TEMP q1 }} | MAP (_.ID AS ID, _.PARENT AS PARENT)Xdigraph G { +recursive-cte-testsEXPLAIN with recursive allDescendants as ( with recursive ancestorsOf250 as ( select id, parent from t1 where id = 250 union all select b.id, b.parent from ancestorsOf250 as a, t1 as b where a.parent = b.id) select id, parent from ancestorsOf250 union all select b.id, b.parent from allDescendants as a, t1 as b where a.id = b.parent) select id, parent from allDescendantsk + ȏ(0O8@RUNION q0, q1 { INITIAL { RUNION q2, q3 { INITIAL { ISCAN(CHILDIDX [EQUALS promote(@c20 AS LONG)]) ∩ ISCAN(PARENTIDX <,>) COMPARE BY (_.PARENT, recordType(_)) | INSERT INTO TEMP q3 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q4 -> { TEMP SCAN base() | FILTER _.PARENT EQUALS q4.ID AS q5 RETURN (q4.ID AS ID, q4.PARENT AS PARENT) } | INSERT INTO TEMP q3 }} | MAP (_.ID AS ID, _.PARENT AS PARENT) | INSERT INTO TEMP q1 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q6 -> { TEMP SCAN base() | FILTER _.ID EQUALS q6.PARENT AS q7 RETURN (q6.ID AS ID, q6.PARENT AS PARENT) } | INSERT INTO TEMP q1 }} | MAP (_.ID AS ID, _.PARENT AS PARENT)edigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q38.ID AS ID, q38.PARENT AS PARENT)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 2 [ label=<
    Recursive Union
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Modification
    TempTableInsert
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Modification
    TempTableInsert
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Value Computation
    MAP (q20.ID AS ID, q20.PARENT AS PARENT)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Temporary Buffer
    ALLDESCENDANTSforInsert
    > color="black" shape="plain" style="filled" fillcolor="goldenrod2" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 7 [ label=<
    Nested Loop Join
    FLATMAP (q28.ID AS ID, q28.PARENT AS PARENT)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 8 [ label=<
    Temporary Buffer
    ALLDESCENDANTSforInsert
    > color="black" shape="plain" style="filled" fillcolor="goldenrod2" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 9 [ label=<
    Recursive Union
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, )" ]; - 10 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 11 [ label=<
    Predicate Filter
    WHERE q26.ID EQUALS q28.PARENT
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 12 [ label=<
    Modification
    TempTableInsert
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 13 [ label=<
    Modification
    TempTableInsert
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 14 [ label=<
    Index
    CHILDIDX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 15 [ label=<
    Temp Table Scan
    ALLDESCENDANTSforScan
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 16 [ label=<
    Nested Loop Join
    FLATMAP (q10.ID AS ID, q10.PARENT AS PARENT)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 17 [ label=<
    Temporary Buffer
    ANCESTORSOF250forInsert
    > color="black" shape="plain" style="filled" fillcolor="goldenrod2" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 18 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c20 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 19 [ label=<
    Temporary Buffer
    ANCESTORSOF250forInsert
    > color="black" shape="plain" style="filled" fillcolor="goldenrod2" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 20 [ label=<
    Predicate Filter
    WHERE q8.PARENT EQUALS q10.ID
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 21 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 22 [ label=<
    Index
    CHILDIDX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 23 [ label=<
    Temp Table Scan
    ANCESTORSOF250forScan
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 24 [ label=<
    Index
    CHILDIDX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q279> label="q279" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 2 [ label=< q281> label="q281" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 1 [ label=<
    Value Computation
    MAP (q38.ID AS ID, q38.PARENT AS PARENT)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 2 [ label=<
    Recursive Union
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 3 [ label=<
    Modification
    TempTableInsert
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 4 [ label=<
    Modification
    TempTableInsert
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 5 [ label=<
    Value Computation
    MAP (q20.ID AS ID, q20.PARENT AS PARENT)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 6 [ label=<
    Temporary Buffer
    ALLDESCENDANTSforInsert
    > color="black" shape="plain" style="filled" fillcolor="goldenrod2" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 7 [ label=<
    Nested Loop Join
    FLATMAP (q28.ID AS ID, q28.PARENT AS PARENT)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 8 [ label=<
    Temporary Buffer
    ALLDESCENDANTSforInsert
    > color="black" shape="plain" style="filled" fillcolor="goldenrod2" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 9 [ label=<
    Recursive Union
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 10 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 11 [ label=<
    Predicate Filter
    WHERE q26.ID EQUALS q28.PARENT
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 12 [ label=<
    Modification
    TempTableInsert
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 13 [ label=<
    Modification
    TempTableInsert
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 14 [ label=<
    Index
    CHILDIDX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 15 [ label=<
    Temp Table Scan
    ALLDESCENDANTSforScan
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 16 [ label=<
    Intersection
    COMPARE BY (_.PARENT, recordType(_))
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 17 [ label=<
    Temporary Buffer
    ANCESTORSOF250forInsert
    > color="black" shape="plain" style="filled" fillcolor="goldenrod2" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 18 [ label=<
    Nested Loop Join
    FLATMAP (q10.ID AS ID, q10.PARENT AS PARENT)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 19 [ label=<
    Temporary Buffer
    ANCESTORSOF250forInsert
    > color="black" shape="plain" style="filled" fillcolor="goldenrod2" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 20 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c20 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 21 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 22 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 23 [ label=<
    Predicate Filter
    WHERE q8.PARENT EQUALS q10.ID
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 24 [ label=<
    Index
    CHILDIDX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 25 [ label=<
    Index
    PARENTIDX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 26 [ label=<
    Index
    CHILDIDX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 27 [ label=<
    Temp Table Scan
    ANCESTORSOF250forScan
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS PARENT)" ]; + 3 -> 2 [ label=< q307> label="q307" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 2 [ label=< q309> label="q309" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="none" arrowtail="normal" dir="both" ]; 7 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; @@ -134,19 +149,22 @@ 9 -> 5 [ label=< q20> label="q20" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 10 -> 7 [ label=< q28> label="q28" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 11 -> 7 [ label=< q26> label="q26" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 12 -> 9 [ label=< q275> label="q275" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 13 -> 9 [ label=< q273> label="q273" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 12 -> 9 [ label=< q301> label="q301" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 13 -> 9 [ label=< q303> label="q303" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 14 -> 10 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 15 -> 11 [ label=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 16 -> 12 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 17 -> 12 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="none" arrowtail="normal" dir="both" ]; 18 -> 13 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 19 -> 13 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="none" arrowtail="normal" dir="both" ]; - 20 -> 16 [ label=< q8> label="q8" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 21 -> 16 [ label=< q10> label="q10" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 22 -> 18 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 23 -> 20 [ label=< q8> label="q8" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 24 -> 21 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 20 -> 16 [ label=< q290> label="q290" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 21 -> 16 [ label=< q292> label="q292" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 22 -> 18 [ label=< q10> label="q10" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 23 -> 18 [ label=< q8> label="q8" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 24 -> 20 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 25 -> 21 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 26 -> 22 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 27 -> 23 [ label=< q8> label="q8" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q38> label="q38" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; { rank=same; @@ -156,17 +174,17 @@ { rank=same; rankDir=LR; - 18 -> 19 [ color="red" style="invis" ]; + 7 -> 8 [ color="red" style="invis" ]; } { rank=same; rankDir=LR; - 16 -> 17 [ color="red" style="invis" ]; + 18 -> 19 [ color="red" style="invis" ]; } { rank=same; rankDir=LR; - 7 -> 8 [ color="red" style="invis" ]; + 22 -> 23 [ color="red" style="invis" ]; } { rank=same; @@ -176,6 +194,6 @@ { rank=same; rankDir=LR; - 21 -> 20 [ color="red" style="invis" ]; + 16 -> 17 [ color="red" style="invis" ]; } } \ No newline at end of file diff --git a/yaml-tests/src/test/resources/recursive-cte.metrics.yaml b/yaml-tests/src/test/resources/recursive-cte.metrics.yaml index dd9a486793..e540c19b32 100644 --- a/yaml-tests/src/test/resources/recursive-cte.metrics.yaml +++ b/yaml-tests/src/test/resources/recursive-cte.metrics.yaml @@ -3,31 +3,33 @@ recursive-cte-tests: -1 union all select b.id, b.parent from c1 as a, t1 as b where a.id = b.parent) select id from c1 explain: RUNION q0, q1 { INITIAL { ISCAN(PARENTIDX [EQUALS promote(@c15 AS LONG)]) - | INSERT INTO TEMP q1 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q2 -> { - TEMP SCAN base() | FILTER _.ID EQUALS q2.PARENT AS q3 RETURN (q2.ID AS ID, - q2.PARENT AS PARENT) } | INSERT INTO TEMP q1 }} | MAP (_.ID AS ID) - task_count: 1334 - task_total_time_ms: 24 + ∩ ISCAN(CHILDIDX <,>) COMPARE BY (_.ID, recordType(_)) | INSERT INTO TEMP + q1 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q2 -> { TEMP SCAN base() | + FILTER _.ID EQUALS q2.PARENT AS q3 RETURN (q2.ID AS ID, q2.PARENT AS PARENT) + } | INSERT INTO TEMP q1 }} | MAP (_.ID AS ID) + task_count: 1299 + task_total_time_ms: 14 transform_count: 325 - transform_time_ms: 10 - transform_yield_count: 98 - insert_time_ms: 1 - insert_new_count: 185 + transform_time_ms: 5 + transform_yield_count: 95 + insert_time_ms: 0 + insert_new_count: 177 insert_reused_count: 9 - query: EXPLAIN with recursive c1 as ( select id, parent from t1 where id = 250 union all select b.id, b.parent from c1 as a, t1 as b where a.parent = b.id) select id from c1 explain: RUNION q0, q1 { INITIAL { ISCAN(CHILDIDX [EQUALS promote(@c15 AS LONG)]) - | INSERT INTO TEMP q1 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q2 -> { - TEMP SCAN base() | FILTER _.PARENT EQUALS q2.ID AS q3 RETURN (q2.ID AS ID, - q2.PARENT AS PARENT) } | INSERT INTO TEMP q1 }} | MAP (_.ID AS ID) - task_count: 1334 - task_total_time_ms: 23 + ∩ ISCAN(PARENTIDX <,>) COMPARE BY (_.PARENT, recordType(_)) | INSERT INTO + TEMP q1 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q2 -> { TEMP SCAN base() + | FILTER _.PARENT EQUALS q2.ID AS q3 RETURN (q2.ID AS ID, q2.PARENT AS PARENT) + } | INSERT INTO TEMP q1 }} | MAP (_.ID AS ID) + task_count: 1299 + task_total_time_ms: 13 transform_count: 325 - transform_time_ms: 7 - transform_yield_count: 98 - insert_time_ms: 1 - insert_new_count: 185 + transform_time_ms: 4 + transform_yield_count: 95 + insert_time_ms: 0 + insert_new_count: 177 insert_reused_count: 9 - query: EXPLAIN with recursive allDescendants as ( with recursive ancestorsOf250 as ( select id, parent from t1 where id = 250 union all select b.id, b.parent @@ -35,35 +37,37 @@ recursive-cte-tests: from ancestorsOf250 union all select b.id, b.parent from allDescendants as a, t1 as b where a.id = b.parent) select id, parent from allDescendants explain: RUNION q0, q1 { INITIAL { RUNION q2, q3 { INITIAL { ISCAN(CHILDIDX [EQUALS - promote(@c20 AS LONG)]) | INSERT INTO TEMP q3 } RECURSIVE { ISCAN(CHILDIDX - <,>) | FLATMAP q4 -> { TEMP SCAN base() | FILTER _.PARENT EQUALS q4.ID AS - q5 RETURN (q4.ID AS ID, q4.PARENT AS PARENT) } | INSERT INTO TEMP q3 }} | - MAP (_.ID AS ID, _.PARENT AS PARENT) | INSERT INTO TEMP q1 } RECURSIVE { - ISCAN(CHILDIDX <,>) | FLATMAP q6 -> { TEMP SCAN base() | FILTER _.ID EQUALS - q6.PARENT AS q7 RETURN (q6.ID AS ID, q6.PARENT AS PARENT) } | INSERT INTO - TEMP q1 }} | MAP (_.ID AS ID, _.PARENT AS PARENT) - task_count: 2122 - task_total_time_ms: 29 - transform_count: 533 - transform_time_ms: 9 - transform_yield_count: 150 - insert_time_ms: 2 - insert_new_count: 300 + promote(@c20 AS LONG)]) ∩ ISCAN(PARENTIDX <,>) COMPARE BY (_.PARENT, recordType(_)) + | INSERT INTO TEMP q3 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q4 -> { + TEMP SCAN base() | FILTER _.PARENT EQUALS q4.ID AS q5 RETURN (q4.ID AS ID, + q4.PARENT AS PARENT) } | INSERT INTO TEMP q3 }} | MAP (_.ID AS ID, _.PARENT + AS PARENT) | INSERT INTO TEMP q1 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP + q6 -> { TEMP SCAN base() | FILTER _.ID EQUALS q6.PARENT AS q7 RETURN (q6.ID + AS ID, q6.PARENT AS PARENT) } | INSERT INTO TEMP q1 }} | MAP (_.ID AS ID, + _.PARENT AS PARENT) + task_count: 2087 + task_total_time_ms: 18 + transform_count: 536 + transform_time_ms: 6 + transform_yield_count: 147 + insert_time_ms: 1 + insert_new_count: 292 insert_reused_count: 15 - query: EXPLAIN with recursive c1 as ( select id, parent from t1 where parent = -1 union all select b.id, b.parent from c1 as a, t1 as b where a.id = b.parent) select id from c1 explain: RUNION q0, q1 { INITIAL { ISCAN(PARENTIDX [EQUALS promote(@c15 AS LONG)]) - | INSERT INTO TEMP q1 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q2 -> { - TEMP SCAN base() | FILTER _.ID EQUALS q2.PARENT AS q3 RETURN (q2.ID AS ID, - q2.PARENT AS PARENT) } | INSERT INTO TEMP q1 }} | MAP (_.ID AS ID) - task_count: 1334 - task_total_time_ms: 24 + ∩ ISCAN(CHILDIDX <,>) COMPARE BY (_.ID, recordType(_)) | INSERT INTO TEMP + q1 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q2 -> { TEMP SCAN base() | + FILTER _.ID EQUALS q2.PARENT AS q3 RETURN (q2.ID AS ID, q2.PARENT AS PARENT) + } | INSERT INTO TEMP q1 }} | MAP (_.ID AS ID) + task_count: 1299 + task_total_time_ms: 14 transform_count: 325 - transform_time_ms: 10 - transform_yield_count: 98 - insert_time_ms: 1 - insert_new_count: 185 + transform_time_ms: 5 + transform_yield_count: 95 + insert_time_ms: 0 + insert_new_count: 177 insert_reused_count: 9 - query: EXPLAIN with recursive allDescendants as ( with recursive ancestorsOf250 as ( select id, parent from t1 where id = 250 union all select b.id, b.parent @@ -71,18 +75,19 @@ recursive-cte-tests: from ancestorsOf250 union all select b.id, b.parent from allDescendants as a, t1 as b where a.id = b.parent) select id, parent from allDescendants explain: RUNION q0, q1 { INITIAL { RUNION q2, q3 { INITIAL { ISCAN(CHILDIDX [EQUALS - promote(@c20 AS LONG)]) | INSERT INTO TEMP q3 } RECURSIVE { ISCAN(CHILDIDX - <,>) | FLATMAP q4 -> { TEMP SCAN base() | FILTER _.PARENT EQUALS q4.ID AS - q5 RETURN (q4.ID AS ID, q4.PARENT AS PARENT) } | INSERT INTO TEMP q3 }} | - MAP (_.ID AS ID, _.PARENT AS PARENT) | INSERT INTO TEMP q1 } RECURSIVE { - ISCAN(CHILDIDX <,>) | FLATMAP q6 -> { TEMP SCAN base() | FILTER _.ID EQUALS - q6.PARENT AS q7 RETURN (q6.ID AS ID, q6.PARENT AS PARENT) } | INSERT INTO - TEMP q1 }} | MAP (_.ID AS ID, _.PARENT AS PARENT) - task_count: 2122 - task_total_time_ms: 29 - transform_count: 533 - transform_time_ms: 9 - transform_yield_count: 150 - insert_time_ms: 2 - insert_new_count: 300 + promote(@c20 AS LONG)]) ∩ ISCAN(PARENTIDX <,>) COMPARE BY (_.PARENT, recordType(_)) + | INSERT INTO TEMP q3 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q4 -> { + TEMP SCAN base() | FILTER _.PARENT EQUALS q4.ID AS q5 RETURN (q4.ID AS ID, + q4.PARENT AS PARENT) } | INSERT INTO TEMP q3 }} | MAP (_.ID AS ID, _.PARENT + AS PARENT) | INSERT INTO TEMP q1 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP + q6 -> { TEMP SCAN base() | FILTER _.ID EQUALS q6.PARENT AS q7 RETURN (q6.ID + AS ID, q6.PARENT AS PARENT) } | INSERT INTO TEMP q1 }} | MAP (_.ID AS ID, + _.PARENT AS PARENT) + task_count: 2087 + task_total_time_ms: 18 + transform_count: 536 + transform_time_ms: 6 + transform_yield_count: 147 + insert_time_ms: 1 + insert_new_count: 292 insert_reused_count: 15 diff --git a/yaml-tests/src/test/resources/recursive-cte.yamsql b/yaml-tests/src/test/resources/recursive-cte.yamsql index 0a8ed60bb7..1bf16aed78 100644 --- a/yaml-tests/src/test/resources/recursive-cte.yamsql +++ b/yaml-tests/src/test/resources/recursive-cte.yamsql @@ -29,7 +29,7 @@ test_block: select id, parent from t1 where parent = -1 union all select b.id, b.parent from c1 as a, t1 as b where a.id = b.parent) select id from c1 - - explain: "RUNION q0, q1 { INITIAL { ISCAN(PARENTIDX [EQUALS promote(@c15 AS LONG)]) | INSERT INTO TEMP q1 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q2 -> { TEMP SCAN base() | FILTER _.ID EQUALS q2.PARENT AS q3 RETURN (q2.ID AS ID, q2.PARENT AS PARENT) } | INSERT INTO TEMP q1 }} | MAP (_.ID AS ID)" + - explain: "RUNION q0, q1 { INITIAL { ISCAN(PARENTIDX [EQUALS promote(@c15 AS LONG)]) ∩ ISCAN(CHILDIDX <,>) COMPARE BY (_.ID, recordType(_)) | INSERT INTO TEMP q1 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q2 -> { TEMP SCAN base() | FILTER _.ID EQUALS q2.PARENT AS q3 RETURN (q2.ID AS ID, q2.PARENT AS PARENT) } | INSERT INTO TEMP q1 }} | MAP (_.ID AS ID)" - unorderedResult: [{ID: 1}, {ID: 10}, {ID: 20}, @@ -44,7 +44,7 @@ test_block: select id, parent from t1 where id = 250 union all select b.id, b.parent from c1 as a, t1 as b where a.parent = b.id) select id from c1 - - explain: "RUNION q0, q1 { INITIAL { ISCAN(CHILDIDX [EQUALS promote(@c15 AS LONG)]) | INSERT INTO TEMP q1 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q2 -> { TEMP SCAN base() | FILTER _.PARENT EQUALS q2.ID AS q3 RETURN (q2.ID AS ID, q2.PARENT AS PARENT) } | INSERT INTO TEMP q1 }} | MAP (_.ID AS ID)" + - explain: "RUNION q0, q1 { INITIAL { ISCAN(CHILDIDX [EQUALS promote(@c15 AS LONG)]) ∩ ISCAN(PARENTIDX <,>) COMPARE BY (_.PARENT, recordType(_)) | INSERT INTO TEMP q1 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q2 -> { TEMP SCAN base() | FILTER _.PARENT EQUALS q2.ID AS q3 RETURN (q2.ID AS ID, q2.PARENT AS PARENT) } | INSERT INTO TEMP q1 }} | MAP (_.ID AS ID)" - result: [{ID: 250}, {ID: 50}, {ID: 10}, @@ -57,7 +57,7 @@ test_block: select b.id, b.parent from ancestorsOf250 as a, t1 as b where a.parent = b.id) select id, parent from ancestorsOf250 union all select b.id, b.parent from allDescendants as a, t1 as b where a.id = b.parent) select id, parent from allDescendants - - explain: "RUNION q0, q1 { INITIAL { RUNION q2, q3 { INITIAL { ISCAN(CHILDIDX [EQUALS promote(@c20 AS LONG)]) | INSERT INTO TEMP q3 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q4 -> { TEMP SCAN base() | FILTER _.PARENT EQUALS q4.ID AS q5 RETURN (q4.ID AS ID, q4.PARENT AS PARENT) } | INSERT INTO TEMP q3 }} | MAP (_.ID AS ID, _.PARENT AS PARENT) | INSERT INTO TEMP q1 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q6 -> { TEMP SCAN base() | FILTER _.ID EQUALS q6.PARENT AS q7 RETURN (q6.ID AS ID, q6.PARENT AS PARENT) } | INSERT INTO TEMP q1 }} | MAP (_.ID AS ID, _.PARENT AS PARENT)" + - explain: "RUNION q0, q1 { INITIAL { RUNION q2, q3 { INITIAL { ISCAN(CHILDIDX [EQUALS promote(@c20 AS LONG)]) ∩ ISCAN(PARENTIDX <,>) COMPARE BY (_.PARENT, recordType(_)) | INSERT INTO TEMP q3 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q4 -> { TEMP SCAN base() | FILTER _.PARENT EQUALS q4.ID AS q5 RETURN (q4.ID AS ID, q4.PARENT AS PARENT) } | INSERT INTO TEMP q3 }} | MAP (_.ID AS ID, _.PARENT AS PARENT) | INSERT INTO TEMP q1 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q6 -> { TEMP SCAN base() | FILTER _.ID EQUALS q6.PARENT AS q7 RETURN (q6.ID AS ID, q6.PARENT AS PARENT) } | INSERT INTO TEMP q1 }} | MAP (_.ID AS ID, _.PARENT AS PARENT)" - result: [{250, 50}, {50, 10}, {10, 1}, @@ -80,7 +80,7 @@ test_block: select id, parent from t1 where parent = -1 union all select b.id, b.parent from c1 as a, t1 as b where a.id = b.parent) select id from c1 - - explain: RUNION q0, q1 { INITIAL { ISCAN(PARENTIDX [EQUALS promote(@c15 AS LONG)]) | INSERT INTO TEMP q1 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q2 -> { TEMP SCAN base() | FILTER _.ID EQUALS q2.PARENT AS q3 RETURN (q2.ID AS ID, q2.PARENT AS PARENT) } | INSERT INTO TEMP q1 }} | MAP (_.ID AS ID) + - explain: "RUNION q0, q1 { INITIAL { ISCAN(PARENTIDX [EQUALS promote(@c15 AS LONG)]) ∩ ISCAN(CHILDIDX <,>) COMPARE BY (_.ID, recordType(_)) | INSERT INTO TEMP q1 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q2 -> { TEMP SCAN base() | FILTER _.ID EQUALS q2.PARENT AS q3 RETURN (q2.ID AS ID, q2.PARENT AS PARENT) } | INSERT INTO TEMP q1 }} | MAP (_.ID AS ID)" - maxRows: 1 - result: [{ID: 1}] - result: [{ID: 10}] @@ -100,7 +100,7 @@ test_block: select b.id, b.parent from ancestorsOf250 as a, t1 as b where a.parent = b.id) select id, parent from ancestorsOf250 union all select b.id, b.parent from allDescendants as a, t1 as b where a.id = b.parent) select id, parent from allDescendants - - explain: "RUNION q0, q1 { INITIAL { RUNION q2, q3 { INITIAL { ISCAN(CHILDIDX [EQUALS promote(@c20 AS LONG)]) | INSERT INTO TEMP q3 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q4 -> { TEMP SCAN base() | FILTER _.PARENT EQUALS q4.ID AS q5 RETURN (q4.ID AS ID, q4.PARENT AS PARENT) } | INSERT INTO TEMP q3 }} | MAP (_.ID AS ID, _.PARENT AS PARENT) | INSERT INTO TEMP q1 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q6 -> { TEMP SCAN base() | FILTER _.ID EQUALS q6.PARENT AS q7 RETURN (q6.ID AS ID, q6.PARENT AS PARENT) } | INSERT INTO TEMP q1 }} | MAP (_.ID AS ID, _.PARENT AS PARENT)" + - explain: "RUNION q0, q1 { INITIAL { RUNION q2, q3 { INITIAL { ISCAN(CHILDIDX [EQUALS promote(@c20 AS LONG)]) ∩ ISCAN(PARENTIDX <,>) COMPARE BY (_.PARENT, recordType(_)) | INSERT INTO TEMP q3 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q4 -> { TEMP SCAN base() | FILTER _.PARENT EQUALS q4.ID AS q5 RETURN (q4.ID AS ID, q4.PARENT AS PARENT) } | INSERT INTO TEMP q3 }} | MAP (_.ID AS ID, _.PARENT AS PARENT) | INSERT INTO TEMP q1 } RECURSIVE { ISCAN(CHILDIDX <,>) | FLATMAP q6 -> { TEMP SCAN base() | FILTER _.ID EQUALS q6.PARENT AS q7 RETURN (q6.ID AS ID, q6.PARENT AS PARENT) } | INSERT INTO TEMP q1 }} | MAP (_.ID AS ID, _.PARENT AS PARENT)" - maxRows: 1 - result: [{250, 50}] - result: [{50, 10}] diff --git a/yaml-tests/src/test/resources/select-a-star.metrics.binpb b/yaml-tests/src/test/resources/select-a-star.metrics.binpb index 300e852322..3129b933fe 100644 --- a/yaml-tests/src/test/resources/select-a-star.metrics.binpb +++ b/yaml-tests/src/test/resources/select-a-star.metrics.binpb @@ -1,28 +1,29 @@ -+ +- e -select-star-testsPEXPLAIN select B1 from B where exists (select A.*, B1 from A group by A1,A2,A3);* -  (*0/81@SCAN(<,>) | TFILTER B | FLATMAP q0 -> { ISCAN(A_IDX <,>) | MAP (_ AS _0) | AGG () GROUP BY (_._0.A1 AS _0, _._0.A2 AS _1, _._0.A3 AS _2) | MAP (_._0._0 AS A1, _._0._1 AS A2, _._0._2 AS A3, q0.B1 AS B1) | DEFAULT NULL | FILTER _ NOT_NULL AS q0 RETURN (q0.B1 AS B1) }(digraph G { +select-star-testsPEXPLAIN select B1 from B where exists (select A.*, B1 from A group by A1,A2,A3);, + + (*0"81@SCAN(<,>) | TFILTER B | FLATMAP q0 -> { ISCAN(A_IDX <,>) | MAP (_ AS _0) | AGG () GROUP BY (_._0.A1 AS _0, _._0.A2 AS _1, _._0.A3 AS _2) | MAP (_._0._0 AS A1, _._0._1 AS A2, _._0._2 AS A3, q0.B1 AS B1) | DEFAULT NULL | FILTER _ NOT_NULL AS q0 RETURN (q0.B1 AS B1) }*digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Nested Loop Join
    FLATMAP (q2.B1 AS B1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS B1)" ]; - 2 [ label=<
    Type Filter
    WHERE record IS [B]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS B1, )" ]; + 2 [ label=<
    Type Filter
    WHERE record IS [B]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS B1, LONG AS B2, LONG AS S1, LONG AS S2 AS B3)" ]; 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 4 [ label=<
    Primary Storage
    record types: [A, B]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q14 NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; - 6 [ label=<
    Value Computation
    FIRST $q14 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; - 7 [ label=<
    Value Computation
    MAP (q10._0._0 AS A1, q10._0._1 AS A2, q10._0._2 AS A3, q2.B1 AS B1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; - 8 [ label=<
    Streaming Aggregate
    COLLECT ()
    GROUP BY (q58._0.A1 AS _0, q58._0.A2 AS _1, q58._0.A3 AS _2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, AS _0, )" ]; - 9 [ label=<
    Value Computation
    MAP (q6 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, AS _0)" ]; - 10 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; - 11 [ label=<
    Index
    A_IDX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; - 3 -> 2 [ label=< q62> label="q62" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 [ label=<
    Predicate Filter
    WHERE q14 NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3, LONG AS B1)" ]; + 6 [ label=<
    Value Computation
    FIRST $q14 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3, LONG AS B1)" ]; + 7 [ label=<
    Value Computation
    MAP (q10._0._0 AS A1, q10._0._1 AS A2, q10._0._2 AS A3, q2.B1 AS B1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3, LONG AS B1)" ]; + 8 [ label=<
    Streaming Aggregate
    COLLECT ()
    GROUP BY (q61._0.A1 AS _0, q61._0.A2 AS _1, q61._0.A3 AS _2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2 AS _0, AS _1)" ]; + 9 [ label=<
    Value Computation
    MAP (q6 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3 AS _0)" ]; + 10 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; + 11 [ label=<
    Index
    A_IDX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; + 3 -> 2 [ label=< q66> label="q66" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q14> label="q14" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ label=< q14> label="q14" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ label=< q10> label="q10" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 9 -> 8 [ label=< q58> label="q58" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 9 -> 8 [ label=< q61> label="q61" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 10 -> 9 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 11 -> 10 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 1 [ label=< q14> label="q14" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; @@ -31,31 +32,31 @@ e rankDir=LR; 2 -> 5 [ color="red" style="invis" ]; } -}+ +}. g -select-star-testsREXPLAIN select B.* from B where exists (select A.*, B.* from A group by A1,A2,A3);* -ī ߘ(*0.81@SCAN(<,>) | TFILTER B | FLATMAP q0 -> { ISCAN(A_IDX <,>) | MAP (_ AS _0) | AGG () GROUP BY (_._0.A1 AS _0, _._0.A2 AS _1, _._0.A3 AS _2) | MAP (_._0._0 AS A1, _._0._1 AS A2, _._0._2 AS A3, q0.B1 AS B1, q0.B2 AS B2, q0.B3 AS B3) | DEFAULT NULL | FILTER _ NOT_NULL AS q0 RETURN q0 }(digraph G { +select-star-testsREXPLAIN select B.* from B where exists (select A.*, B.* from A group by A1,A2,A3);- +  峇(*0#81@SCAN(<,>) | TFILTER B | FLATMAP q0 -> { ISCAN(A_IDX <,>) | MAP (_ AS _0) | AGG () GROUP BY (_._0.A1 AS _0, _._0.A2 AS _1, _._0.A3 AS _2) | MAP (_._0._0 AS A1, _._0._1 AS A2, _._0._2 AS A3, q0.B1 AS B1, q0.B2 AS B2, q0.B3 AS B3) | DEFAULT NULL | FILTER _ NOT_NULL AS q0 RETURN q0 }+digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Nested Loop Join
    FLATMAP q2
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS B1, )" ]; - 2 [ label=<
    Type Filter
    WHERE record IS [B]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS B1, )" ]; + 1 [ label=<
    Nested Loop Join
    FLATMAP q2
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS B1, LONG AS B2, LONG AS S1, LONG AS S2 AS B3)" ]; + 2 [ label=<
    Type Filter
    WHERE record IS [B]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS B1, LONG AS B2, LONG AS S1, LONG AS S2 AS B3)" ]; 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 4 [ label=<
    Primary Storage
    record types: [A, B]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q14 NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; - 6 [ label=<
    Value Computation
    FIRST $q14 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; - 7 [ label=<
    Value Computation
    MAP (q10._0._0 AS A1, q10._0._1 AS A2, q10._0._2 AS A3, q2.B1 AS B1, q2.B2 AS B2, q2.B3 AS B3)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; - 8 [ label=<
    Streaming Aggregate
    COLLECT ()
    GROUP BY (q58._0.A1 AS _0, q58._0.A2 AS _1, q58._0.A3 AS _2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, AS _0, )" ]; - 9 [ label=<
    Value Computation
    MAP (q6 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, AS _0)" ]; - 10 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; - 11 [ label=<
    Index
    A_IDX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; - 3 -> 2 [ label=< q62> label="q62" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 [ label=<
    Predicate Filter
    WHERE q14 NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3, LONG AS B1, LONG AS B2, LONG AS S1, LONG AS S2 AS B3)" ]; + 6 [ label=<
    Value Computation
    FIRST $q14 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3, LONG AS B1, LONG AS B2, LONG AS S1, LONG AS S2 AS B3)" ]; + 7 [ label=<
    Value Computation
    MAP (q10._0._0 AS A1, q10._0._1 AS A2, q10._0._2 AS A3, q2.B1 AS B1, q2.B2 AS B2, q2.B3 AS B3)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3, LONG AS B1, LONG AS B2, LONG AS S1, LONG AS S2 AS B3)" ]; + 8 [ label=<
    Streaming Aggregate
    COLLECT ()
    GROUP BY (q61._0.A1 AS _0, q61._0.A2 AS _1, q61._0.A3 AS _2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1, LONG AS _2 AS _0, AS _1)" ]; + 9 [ label=<
    Value Computation
    MAP (q6 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3 AS _0)" ]; + 10 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; + 11 [ label=<
    Index
    A_IDX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; + 3 -> 2 [ label=< q66> label="q66" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q14> label="q14" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ label=< q14> label="q14" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ label=< q10> label="q10" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 9 -> 8 [ label=< q58> label="q58" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 9 -> 8 [ label=< q61> label="q61" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 10 -> 9 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 11 -> 10 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 1 [ label=< q14> label="q14" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; diff --git a/yaml-tests/src/test/resources/select-a-star.metrics.yaml b/yaml-tests/src/test/resources/select-a-star.metrics.yaml index 8cdae788c7..13cebae24e 100644 --- a/yaml-tests/src/test/resources/select-a-star.metrics.yaml +++ b/yaml-tests/src/test/resources/select-a-star.metrics.yaml @@ -5,9 +5,9 @@ select-star-tests: (_._0._0 AS A1, _._0._1 AS A2, _._0._2 AS A3, q0.B1 AS B1) | DEFAULT NULL | FILTER _ NOT_NULL AS q0 RETURN (q0.B1 AS B1) } task_count: 515 - task_total_time_ms: 25 - transform_count: 148 - transform_time_ms: 7 + task_total_time_ms: 22 + transform_count: 155 + transform_time_ms: 9 transform_yield_count: 42 insert_time_ms: 0 insert_new_count: 49 @@ -18,9 +18,9 @@ select-star-tests: (_._0._0 AS A1, _._0._1 AS A2, _._0._2 AS A3, q0.B1 AS B1) | DEFAULT NULL | FILTER _ NOT_NULL AS q0 RETURN (q0.B1 AS B1) } task_count: 515 - task_total_time_ms: 25 - transform_count: 148 - transform_time_ms: 7 + task_total_time_ms: 22 + transform_count: 155 + transform_time_ms: 9 transform_yield_count: 42 insert_time_ms: 0 insert_new_count: 49 @@ -32,9 +32,9 @@ select-star-tests: (_._0._0 AS A1, _._0._1 AS A2, _._0._2 AS A3, q0.B1 AS B1, q0.B2 AS B2, q0.B3 AS B3) | DEFAULT NULL | FILTER _ NOT_NULL AS q0 RETURN q0 } task_count: 515 - task_total_time_ms: 29 - transform_count: 148 - transform_time_ms: 11 + task_total_time_ms: 24 + transform_count: 155 + transform_time_ms: 8 transform_yield_count: 42 insert_time_ms: 0 insert_new_count: 49 diff --git a/yaml-tests/src/test/resources/sql-functions.metrics.binpb b/yaml-tests/src/test/resources/sql-functions.metrics.binpb index a55dc64bbc..495b18b36a 100644 --- a/yaml-tests/src/test/resources/sql-functions.metrics.binpb +++ b/yaml-tests/src/test/resources/sql-functions.metrics.binpb @@ -1,125 +1,117 @@ - + R -basic-sql-function-tests6EXPLAIN select col1, col2 from f1(a => 103, b => 'b'); - @ М(j08@COVERING(T1_IDX1 [EQUALS promote(@c14 AS STRING), [LESS_THAN promote(@c10 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) -digraph G { +basic-sql-function-tests6EXPLAIN select col1, col2 from f1(a => 103, b => 'b'); + ˛- (j0֙8@COVERING(T1_IDX1 [EQUALS promote(@c14 AS STRING), [LESS_THAN promote(@c10 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q180.COL1 AS COL1, q180.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c14 AS STRING), [LESS_THAN promote(@c10 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; + 1 [ label=<
    Value Computation
    MAP (q192.COL1 AS COL1, q192.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2)" ]; + 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c14 AS STRING), [LESS_THAN promote(@c10 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q180> label="q180" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q192> label="q192" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} R -basic-sql-function-tests6EXPLAIN select col1, col2 from f1(b => 'b', a => 103); -  (j08@COVERING(T1_IDX1 [EQUALS promote(@c10 AS STRING), [LESS_THAN promote(@c14 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) -digraph G { +basic-sql-function-tests6EXPLAIN select col1, col2 from f1(b => 'b', a => 103); + ݼ! 䟈 (j08@COVERING(T1_IDX1 [EQUALS promote(@c10 AS STRING), [LESS_THAN promote(@c14 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q180.COL1 AS COL1, q180.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c10 AS STRING), [LESS_THAN promote(@c14 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; + 1 [ label=<
    Value Computation
    MAP (q192.COL1 AS COL1, q192.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2)" ]; + 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c10 AS STRING), [LESS_THAN promote(@c14 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q180> label="q180" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q192> label="q192" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} H -basic-sql-function-tests,EXPLAIN select col1, col2 from f1(103, 'b'); - } (j0/8@COVERING(T1_IDX1 [EQUALS promote(@c10 AS STRING), [LESS_THAN promote(@c8 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) -digraph G { +basic-sql-function-tests,EXPLAIN select col1, col2 from f1(103, 'b'); + . (j08@COVERING(T1_IDX1 [EQUALS promote(@c10 AS STRING), [LESS_THAN promote(@c8 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q180.COL1 AS COL1, q180.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c10 AS STRING), [LESS_THAN promote(@c8 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; + 1 [ label=<
    Value Computation
    MAP (q192.COL1 AS COL1, q192.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2)" ]; + 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c10 AS STRING), [LESS_THAN promote(@c8 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q180> label="q180" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q192> label="q192" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} M -basic-sql-function-tests1EXPLAIN select col1 + 10, col2 from f1(103, 'b'); -o &(`08@ }ISCAN(T1_IDX1 [EQUALS promote(@c12 AS STRING), [LESS_THAN promote(@c10 AS LONG)]]) | MAP (_.COL1 + @c4 AS _0, _.COL2 AS COL2) -digraph G { +basic-sql-function-tests1EXPLAIN select col1 + 10, col2 from f1(103, 'b'); + (`08@ }ISCAN(T1_IDX1 [EQUALS promote(@c12 AS STRING), [LESS_THAN promote(@c10 AS LONG)]]) | MAP (_.COL1 + @c4 AS _0, _.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q4.COL1 + @c4 AS _0, q4.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, )" ]; - 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c12 AS STRING), [LESS_THAN promote(@c10 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; + 1 [ label=<
    Value Computation
    MAP (q4.COL1 + @c4 AS _0, q4.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, STRING AS COL2)" ]; + 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c12 AS STRING), [LESS_THAN promote(@c10 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q4> label="q4" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} ? -basic-sql-function-tests#EXPLAIN select * from f1(103, 'b'); - > (j0֚8@COVERING(T1_IDX1 [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c6 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) -digraph G { +basic-sql-function-tests#EXPLAIN select * from f1(103, 'b'); + , (j08@COVERING(T1_IDX1 [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c6 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q180.COL1 AS COL1, q180.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c6 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; + 1 [ label=<
    Value Computation
    MAP (q192.COL1 AS COL1, q192.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2)" ]; + 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c6 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q180> label="q180" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q192> label="q192" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} O -basic-sql-function-tests3EXPLAIN select * from f1(103, 'b') where col1 = 101 -  .({0ދ8@#COVERING(T1_IDX1 [EQUALS promote(@c8 AS STRING), EQUALS promote(@c13 AS LONG)] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) -digraph G { +basic-sql-function-tests3EXPLAIN select * from f1(103, 'b') where col1 = 101 + C ({0©8@#COVERING(T1_IDX1 [EQUALS promote(@c8 AS STRING), EQUALS promote(@c13 AS LONG)] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q201.COL1 AS COL1, q201.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c8 AS STRING), EQUALS promote(@c13 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; + 1 [ label=<
    Value Computation
    MAP (q213.COL1 AS COL1, q213.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2)" ]; + 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c8 AS STRING), EQUALS promote(@c13 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q201> label="q201" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q213> label="q213" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} B -basic-sql-function-tests&EXPLAIN select * from f1(103 + 1, 'b') -  1(j028@COVERING(T1_IDX1 [EQUALS promote(@c10 AS STRING), [LESS_THAN promote(@c6 + @c8 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) -digraph G { +basic-sql-function-tests&EXPLAIN select * from f1(103 + 1, 'b') + - (j08@COVERING(T1_IDX1 [EQUALS promote(@c10 AS STRING), [LESS_THAN promote(@c6 + @c8 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q180.COL1 AS COL1, q180.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c10 AS STRING), [LESS_THAN promote(@c6 + @c8 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; + 1 [ label=<
    Value Computation
    MAP (q192.COL1 AS COL1, q192.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2)" ]; + 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c10 AS STRING), [LESS_THAN promote(@c6 + @c8 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q180> label="q180" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q192> label="q192" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} h -basic-sql-function-testsLEXPLAIN select * from (select * from f1(103 + 1, 'b')) as x where col1 < 105 - ܋ )(08@)COVERING(T1_IDX1 [EQUALS promote(@c14 AS STRING), [LESS_THAN promote(@c10 + @c12 AS LONG) && LESS_THAN promote(@c22 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) -digraph G { +basic-sql-function-testsLEXPLAIN select * from (select * from f1(103 + 1, 'b')) as x where col1 < 105 + ; П(08@)COVERING(T1_IDX1 [EQUALS promote(@c14 AS STRING), [LESS_THAN promote(@c10 + @c12 AS LONG) && LESS_THAN promote(@c22 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q218.COL1 AS COL1, q218.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c14 AS STRING), [LESS_THAN promote(@c10 + @c12 AS LONG) && LESS_THAN promote(@c22 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; + 1 [ label=<
    Value Computation
    MAP (q230.COL1 AS COL1, q230.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2)" ]; + 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c14 AS STRING), [LESS_THAN promote(@c10 + @c12 AS LONG) && LESS_THAN promote(@c22 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q218> label="q218" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q230> label="q230" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}  -basic-sql-function-tests{EXPLAIN select A.col1 AS W, A.col2 AS X, B.col1 AS Y, B.col2 AS Z from f1(103, 'b') A, f1(103, 'b') B where A.col1 = B.col1 -L (08@ISCAN(T1_IDX1 <,>) | FLATMAP q0 -> { COVERING(T1_IDX1 [EQUALS promote(@c30 AS STRING), EQUALS q0.COL1] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | FILTER q0.COL1 LESS_THAN promote(@c28 AS LONG) AND q0.COL2 EQUALS promote(@c30 AS STRING) | FETCH AS q1 RETURN (q1.COL1 AS W, q1.COL2 AS X, q0.COL1 AS Y, q0.COL2 AS Z) }digraph G { +basic-sql-function-tests{EXPLAIN select A.col1 AS W, A.col2 AS X, B.col1 AS Y, B.col2 AS Z from f1(103, 'b') A, f1(103, 'b') B where A.col1 = B.col1 +K !(08@ISCAN(T1_IDX1 <,>) | FLATMAP q0 -> { COVERING(T1_IDX1 [EQUALS promote(@c30 AS STRING), EQUALS q0.COL1] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | FILTER q0.COL1 LESS_THAN promote(@c28 AS LONG) AND q0.COL2 EQUALS promote(@c30 AS STRING) | FETCH AS q1 RETURN (q1.COL1 AS W, q1.COL2 AS X, q0.COL1 AS Y, q0.COL2 AS Z) }digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Nested Loop Join
    FLATMAP (q4.COL1 AS W, q4.COL2 AS X, q19.COL1 AS Y, q19.COL2 AS Z)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS W, )" ]; - 2 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 4 [ label=<
    Fetch Records
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS COL1, )" ]; - 5 [ label=<
    Predicate Filter
    WHERE q19.COL1 LESS_THAN promote(@c28 AS LONG) AND q19.COL2 EQUALS promote(@c30 AS STRING)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 6 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c30 AS STRING), EQUALS q19.COL1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 7 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; + 1 [ label=<
    Nested Loop Join
    FLATMAP (q4.COL1 AS W, q4.COL2 AS X, q19.COL1 AS Y, q19.COL2 AS Z)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS W, STRING AS X, LONG AS Y, STRING AS Z)" ]; + 2 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 4 [ label=<
    Fetch Records
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 5 [ label=<
    Predicate Filter
    WHERE q19.COL1 LESS_THAN promote(@c28 AS LONG) AND q19.COL2 EQUALS promote(@c30 AS STRING)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 6 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c30 AS STRING), EQUALS q19.COL1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 7 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q19> label="q19" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q262> label="q262" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q260> label="q260" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q278> label="q278" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q276> label="q276" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 1 [ label=< q4> label="q4" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; { @@ -127,24 +119,24 @@ digraph G { rankDir=LR; 2 -> 4 [ color="red" style="invis" ]; } -} +}  -basic-sql-function-testsEXPLAIN select A.col1 AS W, A.col2 AS X, B.col1 AS Y, B.col2 AS Z from f1(a => 103, b => 'b') A, f1(a => 103, b => 'b') B where A.col1 = B.col1 - n(08@ISCAN(T1_IDX1 <,>) | FLATMAP q0 -> { COVERING(T1_IDX1 [EQUALS promote(@c34 AS STRING), EQUALS q0.COL1] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | FILTER q0.COL1 LESS_THAN promote(@c30 AS LONG) AND q0.COL2 EQUALS promote(@c34 AS STRING) | FETCH AS q1 RETURN (q1.COL1 AS W, q1.COL2 AS X, q0.COL1 AS Y, q0.COL2 AS Z) }digraph G { +basic-sql-function-testsEXPLAIN select A.col1 AS W, A.col2 AS X, B.col1 AS Y, B.col2 AS Z from f1(a => 103, b => 'b') A, f1(a => 103, b => 'b') B where A.col1 = B.col1 +ߘF Ɨ (08@ISCAN(T1_IDX1 <,>) | FLATMAP q0 -> { COVERING(T1_IDX1 [EQUALS promote(@c34 AS STRING), EQUALS q0.COL1] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | FILTER q0.COL1 LESS_THAN promote(@c30 AS LONG) AND q0.COL2 EQUALS promote(@c34 AS STRING) | FETCH AS q1 RETURN (q1.COL1 AS W, q1.COL2 AS X, q0.COL1 AS Y, q0.COL2 AS Z) }digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Nested Loop Join
    FLATMAP (q4.COL1 AS W, q4.COL2 AS X, q19.COL1 AS Y, q19.COL2 AS Z)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS W, )" ]; - 2 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 4 [ label=<
    Fetch Records
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS COL1, )" ]; - 5 [ label=<
    Predicate Filter
    WHERE q19.COL1 LESS_THAN promote(@c30 AS LONG) AND q19.COL2 EQUALS promote(@c34 AS STRING)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 6 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c34 AS STRING), EQUALS q19.COL1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 7 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; + 1 [ label=<
    Nested Loop Join
    FLATMAP (q4.COL1 AS W, q4.COL2 AS X, q19.COL1 AS Y, q19.COL2 AS Z)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS W, STRING AS X, LONG AS Y, STRING AS Z)" ]; + 2 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 4 [ label=<
    Fetch Records
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 5 [ label=<
    Predicate Filter
    WHERE q19.COL1 LESS_THAN promote(@c30 AS LONG) AND q19.COL2 EQUALS promote(@c34 AS STRING)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 6 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c34 AS STRING), EQUALS q19.COL1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 7 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q19> label="q19" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q262> label="q262" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q260> label="q260" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q278> label="q278" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q276> label="q276" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 1 [ label=< q4> label="q4" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; { @@ -152,49 +144,47 @@ digraph G { rankDir=LR; 2 -> 4 [ color="red" style="invis" ]; } -} +} j -basic-sql-function-testsNEXPLAIN with x(y, z) as (select * from f1(b => 'b', a => 103)) select * from x +basic-sql-function-testsNEXPLAIN with x(y, z) as (select * from f1(b => 'b', a => 103)) select * from x  -D (n08@COVERING(T1_IDX1 [EQUALS promote(@c17 AS STRING), [LESS_THAN promote(@c21 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS Y, _.COL2 AS Z) -digraph G { +/ (n08@COVERING(T1_IDX1 [EQUALS promote(@c17 AS STRING), [LESS_THAN promote(@c21 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS Y, _.COL2 AS Z) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q186.COL1 AS Y, q186.COL2 AS Z)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS Y, )" ]; - 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c17 AS STRING), [LESS_THAN promote(@c21 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; + 1 [ label=<
    Value Computation
    MAP (q198.COL1 AS Y, q198.COL2 AS Z)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS Y, STRING AS Z)" ]; + 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c17 AS STRING), [LESS_THAN promote(@c21 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q186> label="q186" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q198> label="q198" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} ` -basic-sql-function-testsDEXPLAIN with x(y, z) as (select * from f1(103, 'b')) select * from x +basic-sql-function-testsDEXPLAIN with x(y, z) as (select * from f1(103, 'b')) select * from x  -ʼnE Π (n08@COVERING(T1_IDX1 [EQUALS promote(@c17 AS STRING), [LESS_THAN promote(@c15 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS Y, _.COL2 AS Z) -digraph G { +, (n0Ǵ8@COVERING(T1_IDX1 [EQUALS promote(@c17 AS STRING), [LESS_THAN promote(@c15 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS Y, _.COL2 AS Z) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q186.COL1 AS Y, q186.COL2 AS Z)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS Y, )" ]; - 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c17 AS STRING), [LESS_THAN promote(@c15 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; + 1 [ label=<
    Value Computation
    MAP (q198.COL1 AS Y, q198.COL2 AS Z)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS Y, STRING AS Z)" ]; + 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c17 AS STRING), [LESS_THAN promote(@c15 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q186> label="q186" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q198> label="q198" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} Z -basic-sql-function-tests>EXPLAIN select * from t2 where exists (select * from f2(t2.z)) -T :(s08@ ISCAN(T2_IDX1 <,>) | FLATMAP q0 -> { ISCAN(T1_IDX1 <,>) | FILTER promote(_.COL3 AS LONG) EQUALS q0.Z | DEFAULT NULL | FILTER _ NOT_NULL AS q1 RETURN q0 }digraph G { +basic-sql-function-tests>EXPLAIN select * from t2 where exists (select * from f2(t2.z)) +Ϣ& ֚ (s08@ ISCAN(T2_IDX1 <,>) | FLATMAP q0 -> { ISCAN(T1_IDX1 <,>) | FILTER promote(_.COL3 AS LONG) EQUALS q0.Z | DEFAULT NULL | FILTER _ NOT_NULL AS q1 RETURN q0 }digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Nested Loop Join
    FLATMAP q2
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X, )" ]; - 2 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X, )" ]; - 3 [ label=<
    Index
    T2_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X, )" ]; - 4 [ label=<
    Predicate Filter
    WHERE q21 NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 5 [ label=<
    Value Computation
    FIRST $q21 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 6 [ label=<
    Predicate Filter
    WHERE promote(q8.COL3 AS LONG) EQUALS q2.Z
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 7 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 8 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; + 1 [ label=<
    Nested Loop Join
    FLATMAP q2
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X, LONG AS Y, LONG AS Z)" ]; + 2 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X, LONG AS Y, LONG AS Z)" ]; + 3 [ label=<
    Index
    T2_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X, LONG AS Y, LONG AS Z)" ]; + 4 [ label=<
    Predicate Filter
    WHERE q21 NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 5 [ label=<
    Value Computation
    FIRST $q21 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 6 [ label=<
    Predicate Filter
    WHERE promote(q8.COL3 AS LONG) EQUALS q2.Z
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 7 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 8 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q21> label="q21" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; @@ -207,21 +197,22 @@ Z rankDir=LR; 2 -> 4 [ color="red" style="invis" ]; } -} +} _ -basic-sql-function-testsCEXPLAIN select * from t2 where exists (select * from f2(k => t2.z)) -Թ (s08@ ISCAN(T2_IDX1 <,>) | FLATMAP q0 -> { ISCAN(T1_IDX1 <,>) | FILTER promote(_.COL3 AS LONG) EQUALS q0.Z | DEFAULT NULL | FILTER _ NOT_NULL AS q1 RETURN q0 }digraph G { +basic-sql-function-testsCEXPLAIN select * from t2 where exists (select * from f2(k => t2.z)) + +(s0̷8@ ISCAN(T2_IDX1 <,>) | FLATMAP q0 -> { ISCAN(T1_IDX1 <,>) | FILTER promote(_.COL3 AS LONG) EQUALS q0.Z | DEFAULT NULL | FILTER _ NOT_NULL AS q1 RETURN q0 }digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Nested Loop Join
    FLATMAP q2
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X, )" ]; - 2 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X, )" ]; - 3 [ label=<
    Index
    T2_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X, )" ]; - 4 [ label=<
    Predicate Filter
    WHERE q21 NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 5 [ label=<
    Value Computation
    FIRST $q21 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 6 [ label=<
    Predicate Filter
    WHERE promote(q8.COL3 AS LONG) EQUALS q2.Z
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 7 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 8 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; + 1 [ label=<
    Nested Loop Join
    FLATMAP q2
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X, LONG AS Y, LONG AS Z)" ]; + 2 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X, LONG AS Y, LONG AS Z)" ]; + 3 [ label=<
    Index
    T2_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS X, LONG AS Y, LONG AS Z)" ]; + 4 [ label=<
    Predicate Filter
    WHERE q21 NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 5 [ label=<
    Value Computation
    FIRST $q21 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 6 [ label=<
    Predicate Filter
    WHERE promote(q8.COL3 AS LONG) EQUALS q2.Z
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 7 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 8 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q21> label="q21" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; @@ -234,24 +225,25 @@ _ rankDir=LR; 2 -> 4 [ color="red" style="invis" ]; } -} +} A -basic-sql-function-tests%EXPLAIN select * from f3(103, 'b', 4) - L(0ϲ/8@1ISCAN(T1_IDX1 <,>) | FLATMAP q0 -> { COVERING(T1_IDX1 [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c6 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | FILTER promote(q0.COL3 AS LONG) EQUALS promote(@c10 AS LONG) | FETCH AS q1 RETURN (q1.COL1 AS COL1, q1.COL2 AS COL2, q0.COL3 AS COL3) }digraph G { +basic-sql-function-tests%EXPLAIN select * from f3(103, 'b', 4) +l ((0 +8@1ISCAN(T1_IDX1 <,>) | FLATMAP q0 -> { COVERING(T1_IDX1 [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c6 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | FILTER promote(q0.COL3 AS LONG) EQUALS promote(@c10 AS LONG) | FETCH AS q1 RETURN (q1.COL1 AS COL1, q1.COL2 AS COL2, q0.COL3 AS COL3) }digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Nested Loop Join
    FLATMAP (q6.COL1 AS COL1, q6.COL2 AS COL2, q21.COL3 AS COL3)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 4 [ label=<
    Fetch Records
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS COL1, )" ]; - 5 [ label=<
    Predicate Filter
    WHERE promote(q21.COL3 AS LONG) EQUALS promote(@c10 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 6 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c6 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 7 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; + 1 [ label=<
    Nested Loop Join
    FLATMAP (q6.COL1 AS COL1, q6.COL2 AS COL2, q21.COL3 AS COL3)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 2 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 4 [ label=<
    Fetch Records
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 5 [ label=<
    Predicate Filter
    WHERE promote(q21.COL3 AS LONG) EQUALS promote(@c10 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 6 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c6 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 7 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q21> label="q21" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q396> label="q396" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q394> label="q394" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q412> label="q412" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q410> label="q410" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 1 [ label=< q6> label="q6" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; { @@ -259,24 +251,24 @@ A rankDir=LR; 2 -> 4 [ color="red" style="invis" ]; } -} +} D -basic-sql-function-tests(EXPLAIN select * from f4(103, 'b', 2, 2) -!. 흖(0՛8@ISCAN(T1_IDX1 <,>) | FLATMAP q0 -> { COVERING(T1_IDX1 [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c6 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | FILTER promote(q0.COL3 AS LONG) EQUALS promote(@c10 AS LONG) + promote(@c10 AS LONG) | FETCH AS q1 RETURN (q1.COL1 AS COL1, q1.COL2 AS COL2, q0.COL3 AS COL3) }digraph G { +basic-sql-function-tests(EXPLAIN select * from f4(103, 'b', 2, 2) + .ˣ «щ(0k8@ISCAN(T1_IDX1 <,>) | FLATMAP q0 -> { COVERING(T1_IDX1 [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c6 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | FILTER promote(q0.COL3 AS LONG) EQUALS promote(@c10 AS LONG) + promote(@c10 AS LONG) | FETCH AS q1 RETURN (q1.COL1 AS COL1, q1.COL2 AS COL2, q0.COL3 AS COL3) }digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Nested Loop Join
    FLATMAP (q8.COL1 AS COL1, q8.COL2 AS COL2, q23.COL3 AS COL3)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 4 [ label=<
    Fetch Records
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS COL1, )" ]; - 5 [ label=<
    Predicate Filter
    WHERE promote(q23.COL3 AS LONG) EQUALS promote(@c10 AS LONG) + promote(@c10 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 6 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c6 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 7 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; + 1 [ label=<
    Nested Loop Join
    FLATMAP (q8.COL1 AS COL1, q8.COL2 AS COL2, q23.COL3 AS COL3)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 2 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 4 [ label=<
    Fetch Records
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 5 [ label=<
    Predicate Filter
    WHERE promote(q23.COL3 AS LONG) EQUALS promote(@c10 AS LONG) + promote(@c10 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 6 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c6 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 7 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q23> label="q23" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q978> label="q978" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q976> label="q976" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q994> label="q994" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q992> label="q992" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 1 [ label=< q8> label="q8" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; { @@ -284,24 +276,24 @@ D rankDir=LR; 2 -> 4 [ color="red" style="invis" ]; } -} +} X -basic-sql-function-tests 103, b => 'b', c => 2, d => 2) -!.ñ (08@ISCAN(T1_IDX1 <,>) | FLATMAP q0 -> { COVERING(T1_IDX1 [EQUALS promote(@c12 AS STRING), [LESS_THAN promote(@c8 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | FILTER promote(q0.COL3 AS LONG) EQUALS promote(@c16 AS LONG) + promote(@c16 AS LONG) | FETCH AS q1 RETURN (q1.COL1 AS COL1, q1.COL2 AS COL2, q0.COL3 AS COL3) }digraph G { +basic-sql-function-tests 103, b => 'b', c => 2, d => 2) + .߇ Ƽ(0t8@ISCAN(T1_IDX1 <,>) | FLATMAP q0 -> { COVERING(T1_IDX1 [EQUALS promote(@c12 AS STRING), [LESS_THAN promote(@c8 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | FILTER promote(q0.COL3 AS LONG) EQUALS promote(@c16 AS LONG) + promote(@c16 AS LONG) | FETCH AS q1 RETURN (q1.COL1 AS COL1, q1.COL2 AS COL2, q0.COL3 AS COL3) }digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Nested Loop Join
    FLATMAP (q8.COL1 AS COL1, q8.COL2 AS COL2, q23.COL3 AS COL3)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 4 [ label=<
    Fetch Records
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS COL1, )" ]; - 5 [ label=<
    Predicate Filter
    WHERE promote(q23.COL3 AS LONG) EQUALS promote(@c16 AS LONG) + promote(@c16 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 6 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c12 AS STRING), [LESS_THAN promote(@c8 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 7 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; + 1 [ label=<
    Nested Loop Join
    FLATMAP (q8.COL1 AS COL1, q8.COL2 AS COL2, q23.COL3 AS COL3)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 2 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 4 [ label=<
    Fetch Records
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 5 [ label=<
    Predicate Filter
    WHERE promote(q23.COL3 AS LONG) EQUALS promote(@c16 AS LONG) + promote(@c16 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 6 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c12 AS STRING), [LESS_THAN promote(@c8 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 7 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q23> label="q23" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q978> label="q978" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q976> label="q976" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q994> label="q994" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q992> label="q992" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 1 [ label=< q8> label="q8" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; { @@ -309,121 +301,112 @@ X rankDir=LR; 2 -> 4 [ color="red" style="invis" ]; } -} +} 7 -basic-sql-function-testsEXPLAIN select * from f5(); - ֒A (j08@COVERING(T1_IDX1 [EQUALS promote('b' AS STRING), [LESS_THAN promote(103 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) -digraph G { +basic-sql-function-testsEXPLAIN select * from f5(); + - (j08@COVERING(T1_IDX1 [EQUALS promote('b' AS STRING), [LESS_THAN promote(103 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q180.COL1 AS COL1, q180.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote('b' AS STRING), [LESS_THAN promote(103 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; + 1 [ label=<
    Value Computation
    MAP (q192.COL1 AS COL1, q192.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2)" ]; + 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote('b' AS STRING), [LESS_THAN promote(103 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q180> label="q180" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q192> label="q192" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} : -basic-sql-function-testsEXPLAIN select * from f5(103); - x G(j08@COVERING(T1_IDX1 [EQUALS promote('b' AS STRING), [LESS_THAN promote(@c6 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) -digraph G { +basic-sql-function-testsEXPLAIN select * from f5(103); + - ି(j08@COVERING(T1_IDX1 [EQUALS promote('b' AS STRING), [LESS_THAN promote(@c6 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q180.COL1 AS COL1, q180.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote('b' AS STRING), [LESS_THAN promote(@c6 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; + 1 [ label=<
    Value Computation
    MAP (q192.COL1 AS COL1, q192.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2)" ]; + 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote('b' AS STRING), [LESS_THAN promote(@c6 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q180> label="q180" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q192> label="q192" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} ? -basic-sql-function-tests#EXPLAIN select * from f5(b => 'b'); - o 8(j08@COVERING(T1_IDX1 [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(103 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) -digraph G { +basic-sql-function-tests#EXPLAIN select * from f5(b => 'b'); + , (j08@COVERING(T1_IDX1 [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(103 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q180.COL1 AS COL1, q180.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(103 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; + 1 [ label=<
    Value Computation
    MAP (q192.COL1 AS COL1, q192.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2)" ]; + 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(103 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q180> label="q180" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q192> label="q192" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} I -basic-sql-function-tests-EXPLAIN select * from f5(b => 'b', a => 103); - < Ӎ(j0ˠ8@COVERING(T1_IDX1 [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c12 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) -digraph G { +basic-sql-function-tests-EXPLAIN select * from f5(b => 'b', a => 103); + ޸- (j08@COVERING(T1_IDX1 [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c12 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q180.COL1 AS COL1, q180.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c12 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; + 1 [ label=<
    Value Computation
    MAP (q192.COL1 AS COL1, q192.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2)" ]; + 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c12 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q180> label="q180" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q192> label="q192" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} I -basic-sql-function-tests-EXPLAIN select * from f5(b => 'b', a => 102); - < Ӎ(j0ˠ8@COVERING(T1_IDX1 [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c12 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) -digraph G { +basic-sql-function-tests-EXPLAIN select * from f5(b => 'b', a => 102); + ޸- (j08@COVERING(T1_IDX1 [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c12 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q180.COL1 AS COL1, q180.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c12 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; + 1 [ label=<
    Value Computation
    MAP (q192.COL1 AS COL1, q192.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2)" ]; + 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c12 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q180> label="q180" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q192> label="q192" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} I -basic-sql-function-tests-EXPLAIN select * from f5(b => 'a', a => 102); - < Ӎ(j0ˠ8@COVERING(T1_IDX1 [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c12 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) -digraph G { +basic-sql-function-tests-EXPLAIN select * from f5(b => 'a', a => 102); + ޸- (j08@COVERING(T1_IDX1 [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c12 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q180.COL1 AS COL1, q180.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c12 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; + 1 [ label=<
    Value Computation
    MAP (q192.COL1 AS COL1, q192.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2)" ]; + 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c12 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q180> label="q180" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q192> label="q192" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} I -basic-sql-function-tests-EXPLAIN select * from f5(a => 102, b => 'a'); - _ (j0 8@COVERING(T1_IDX1 [EQUALS promote(@c12 AS STRING), [LESS_THAN promote(@c8 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) -digraph G { +basic-sql-function-tests-EXPLAIN select * from f5(a => 102, b => 'a'); + ׳, (j08@COVERING(T1_IDX1 [EQUALS promote(@c12 AS STRING), [LESS_THAN promote(@c8 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q180.COL1 AS COL1, q180.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c12 AS STRING), [LESS_THAN promote(@c8 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; + 1 [ label=<
    Value Computation
    MAP (q192.COL1 AS COL1, q192.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2)" ]; + 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c12 AS STRING), [LESS_THAN promote(@c8 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q180> label="q180" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q192> label="q192" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} : -basic-sql-function-testsEXPLAIN select * from f5(102); - x G(j08@COVERING(T1_IDX1 [EQUALS promote('b' AS STRING), [LESS_THAN promote(@c6 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) -digraph G { +basic-sql-function-testsEXPLAIN select * from f5(102); + - ି(j08@COVERING(T1_IDX1 [EQUALS promote('b' AS STRING), [LESS_THAN promote(@c6 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q180.COL1 AS COL1, q180.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote('b' AS STRING), [LESS_THAN promote(@c6 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; + 1 [ label=<
    Value Computation
    MAP (q192.COL1 AS COL1, q192.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2)" ]; + 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote('b' AS STRING), [LESS_THAN promote(@c6 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q180> label="q180" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q192> label="q192" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} ? -basic-sql-function-tests#EXPLAIN select * from f5(102, 'a'); - мq ˃(j0Θ 8@COVERING(T1_IDX1 [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c6 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) -digraph G { +basic-sql-function-tests#EXPLAIN select * from f5(102, 'a'); + + Č(j08@COVERING(T1_IDX1 [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c6 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q180.COL1 AS COL1, q180.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c6 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; + 1 [ label=<
    Value Computation
    MAP (q192.COL1 AS COL1, q192.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2)" ]; + 2 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c8 AS STRING), [LESS_THAN promote(@c6 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; + 3 [ label=<
    Index
    T1_IDX1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, STRING AS COL2, INT AS COL3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q180> label="q180" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q192> label="q192" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; } \ No newline at end of file diff --git a/yaml-tests/src/test/resources/sql-functions.metrics.yaml b/yaml-tests/src/test/resources/sql-functions.metrics.yaml index 886d67d490..4cbb4d027f 100644 --- a/yaml-tests/src/test/resources/sql-functions.metrics.yaml +++ b/yaml-tests/src/test/resources/sql-functions.metrics.yaml @@ -4,11 +4,11 @@ basic-sql-function-tests: AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2)' task_count: 1264 - task_total_time_ms: 135 - transform_count: 355 - transform_time_ms: 57 + task_total_time_ms: 94 + transform_count: 359 + transform_time_ms: 32 transform_yield_count: 106 - insert_time_ms: 18 + insert_time_ms: 5 insert_new_count: 173 insert_reused_count: 16 - query: EXPLAIN select col1, col2 from f1(b => 'b', a => 103); @@ -16,11 +16,11 @@ basic-sql-function-tests: AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2)' task_count: 1264 - task_total_time_ms: 31 - transform_count: 355 - transform_time_ms: 10 + task_total_time_ms: 69 + transform_count: 359 + transform_time_ms: 25 transform_yield_count: 106 - insert_time_ms: 2 + insert_time_ms: 4 insert_new_count: 173 insert_reused_count: 16 - query: EXPLAIN select col1, col2 from f1(103, 'b'); @@ -28,22 +28,22 @@ basic-sql-function-tests: AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2)' task_count: 1264 - task_total_time_ms: 263 - transform_count: 355 + task_total_time_ms: 98 + transform_count: 359 transform_time_ms: 37 transform_yield_count: 106 - insert_time_ms: 100 + insert_time_ms: 6 insert_new_count: 173 insert_reused_count: 16 - query: EXPLAIN select col1 + 10, col2 from f1(103, 'b'); explain: ISCAN(T1_IDX1 [EQUALS promote(@c12 AS STRING), [LESS_THAN promote(@c10 AS LONG)]]) | MAP (_.COL1 + @c4 AS _0, _.COL2 AS COL2) task_count: 1112 - task_total_time_ms: 233 - transform_count: 338 - transform_time_ms: 80 + task_total_time_ms: 67 + transform_count: 342 + transform_time_ms: 26 transform_yield_count: 96 - insert_time_ms: 5 + insert_time_ms: 3 insert_new_count: 153 insert_reused_count: 11 - query: EXPLAIN select * from f1(103, 'b'); @@ -51,11 +51,11 @@ basic-sql-function-tests: AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2)' task_count: 1264 - task_total_time_ms: 130 - transform_count: 355 - transform_time_ms: 63 + task_total_time_ms: 92 + transform_count: 359 + transform_time_ms: 35 transform_yield_count: 106 - insert_time_ms: 6 + insert_time_ms: 5 insert_new_count: 173 insert_reused_count: 16 - query: EXPLAIN select * from f1(103, 'b') where col1 = 101 @@ -63,11 +63,11 @@ basic-sql-function-tests: AS LONG)] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2)' task_count: 1471 - task_total_time_ms: 291 - transform_count: 485 - transform_time_ms: 97 + task_total_time_ms: 140 + transform_count: 489 + transform_time_ms: 53 transform_yield_count: 123 - insert_time_ms: 54 + insert_time_ms: 12 insert_new_count: 236 insert_reused_count: 35 - query: EXPLAIN select * from f1(103 + 1, 'b') @@ -75,11 +75,11 @@ basic-sql-function-tests: + @c8 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2)' task_count: 1264 - task_total_time_ms: 266 - transform_count: 355 - transform_time_ms: 103 + task_total_time_ms: 95 + transform_count: 359 + transform_time_ms: 35 transform_yield_count: 106 - insert_time_ms: 105 + insert_time_ms: 5 insert_new_count: 173 insert_reused_count: 16 - query: EXPLAIN select * from (select * from f1(103 + 1, 'b')) as x where col1 @@ -88,11 +88,11 @@ basic-sql-function-tests: + @c12 AS LONG) && LESS_THAN promote(@c22 AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2)' task_count: 1623 - task_total_time_ms: 293 - transform_count: 542 - transform_time_ms: 87 + task_total_time_ms: 123 + transform_count: 546 + transform_time_ms: 47 transform_yield_count: 134 - insert_time_ms: 18 + insert_time_ms: 10 insert_new_count: 271 insert_reused_count: 41 - query: EXPLAIN select A.col1 AS W, A.col2 AS X, B.col1 AS Y, B.col2 AS Z from @@ -103,11 +103,11 @@ basic-sql-function-tests: AS STRING) | FETCH AS q1 RETURN (q1.COL1 AS W, q1.COL2 AS X, q0.COL1 AS Y, q0.COL2 AS Z) }' task_count: 1811 - task_total_time_ms: 160 - transform_count: 549 - transform_time_ms: 46 + task_total_time_ms: 159 + transform_count: 555 + transform_time_ms: 70 transform_yield_count: 159 - insert_time_ms: 8 + insert_time_ms: 7 insert_new_count: 299 insert_reused_count: 16 - query: EXPLAIN select A.col1 AS W, A.col2 AS X, B.col1 AS Y, B.col2 AS Z from @@ -118,11 +118,11 @@ basic-sql-function-tests: AS STRING) | FETCH AS q1 RETURN (q1.COL1 AS W, q1.COL2 AS X, q0.COL1 AS Y, q0.COL2 AS Z) }' task_count: 1811 - task_total_time_ms: 353 - transform_count: 549 - transform_time_ms: 231 + task_total_time_ms: 147 + transform_count: 555 + transform_time_ms: 69 transform_yield_count: 159 - insert_time_ms: 8 + insert_time_ms: 7 insert_new_count: 299 insert_reused_count: 16 - query: EXPLAIN with x(y, z) as (select * from f1(b => 'b', a => 103)) select * @@ -131,11 +131,11 @@ basic-sql-function-tests: AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS Y, _.COL2 AS Z)' task_count: 1306 - task_total_time_ms: 143 - transform_count: 375 - transform_time_ms: 64 + task_total_time_ms: 98 + transform_count: 379 + transform_time_ms: 35 transform_yield_count: 110 - insert_time_ms: 7 + insert_time_ms: 6 insert_new_count: 181 insert_reused_count: 17 - query: EXPLAIN with x(y, z) as (select * from f1(103, 'b')) select * from x @@ -143,20 +143,20 @@ basic-sql-function-tests: AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS Y, _.COL2 AS Z)' task_count: 1306 - task_total_time_ms: 144 - transform_count: 375 - transform_time_ms: 67 + task_total_time_ms: 93 + transform_count: 379 + transform_time_ms: 32 transform_yield_count: 110 - insert_time_ms: 7 + insert_time_ms: 5 insert_new_count: 181 insert_reused_count: 17 - query: EXPLAIN select * from t2 where exists (select * from f2(t2.z)) explain: ISCAN(T2_IDX1 <,>) | FLATMAP q0 -> { ISCAN(T1_IDX1 <,>) | FILTER promote(_.COL3 AS LONG) EQUALS q0.Z | DEFAULT NULL | FILTER _ NOT_NULL AS q1 RETURN q0 } task_count: 1093 - task_total_time_ms: 177 - transform_count: 316 - transform_time_ms: 122 + task_total_time_ms: 80 + transform_count: 323 + transform_time_ms: 27 transform_yield_count: 115 insert_time_ms: 3 insert_new_count: 158 @@ -165,9 +165,9 @@ basic-sql-function-tests: explain: ISCAN(T2_IDX1 <,>) | FLATMAP q0 -> { ISCAN(T1_IDX1 <,>) | FILTER promote(_.COL3 AS LONG) EQUALS q0.Z | DEFAULT NULL | FILTER _ NOT_NULL AS q1 RETURN q0 } task_count: 1093 - task_total_time_ms: 312 - transform_count: 316 - transform_time_ms: 30 + task_total_time_ms: 66 + transform_count: 323 + transform_time_ms: 22 transform_yield_count: 115 insert_time_ms: 3 insert_new_count: 158 @@ -178,11 +178,11 @@ basic-sql-function-tests: COL3: KEY[2]]) | FILTER promote(q0.COL3 AS LONG) EQUALS promote(@c10 AS LONG) | FETCH AS q1 RETURN (q1.COL1 AS COL1, q1.COL2 AS COL2, q0.COL3 AS COL3) }' task_count: 2612 - task_total_time_ms: 853 - transform_count: 991 - transform_time_ms: 159 + task_total_time_ms: 228 + transform_count: 997 + transform_time_ms: 85 transform_yield_count: 232 - insert_time_ms: 99 + insert_time_ms: 21 insert_new_count: 575 insert_reused_count: 49 - query: EXPLAIN select * from f3(103, 'b', 4) @@ -191,11 +191,11 @@ basic-sql-function-tests: COL3: KEY[2]]) | FILTER promote(q0.COL3 AS LONG) EQUALS promote(@c10 AS LONG) | FETCH AS q1 RETURN (q1.COL1 AS COL1, q1.COL2 AS COL2, q0.COL3 AS COL3) }' task_count: 2612 - task_total_time_ms: 853 - transform_count: 991 - transform_time_ms: 159 + task_total_time_ms: 228 + transform_count: 997 + transform_time_ms: 85 transform_yield_count: 232 - insert_time_ms: 99 + insert_time_ms: 21 insert_new_count: 575 insert_reused_count: 49 - query: EXPLAIN select * from f4(103, 'b', 2, 2) @@ -205,11 +205,11 @@ basic-sql-function-tests: + promote(@c10 AS LONG) | FETCH AS q1 RETURN (q1.COL1 AS COL1, q1.COL2 AS COL2, q0.COL3 AS COL3) }' task_count: 5992 - task_total_time_ms: 1546 - transform_count: 2648 - transform_time_ms: 315 + task_total_time_ms: 931 + transform_count: 2654 + transform_time_ms: 288 transform_yield_count: 503 - insert_time_ms: 594 + insert_time_ms: 225 insert_new_count: 1924 insert_reused_count: 202 - query: EXPLAIN select * from f4(a => 103, b => 'b', c => 2, d => 2) @@ -219,11 +219,11 @@ basic-sql-function-tests: + promote(@c16 AS LONG) | FETCH AS q1 RETURN (q1.COL1 AS COL1, q1.COL2 AS COL2, q0.COL3 AS COL3) }' task_count: 5992 - task_total_time_ms: 2164 - transform_count: 2648 - transform_time_ms: 902 + task_total_time_ms: 940 + transform_count: 2654 + transform_time_ms: 286 transform_yield_count: 503 - insert_time_ms: 506 + insert_time_ms: 243 insert_new_count: 1924 insert_reused_count: 202 - query: EXPLAIN select * from f5(); @@ -231,11 +231,11 @@ basic-sql-function-tests: AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2)' task_count: 1264 - task_total_time_ms: 138 - transform_count: 355 - transform_time_ms: 62 + task_total_time_ms: 94 + transform_count: 359 + transform_time_ms: 31 transform_yield_count: 106 - insert_time_ms: 7 + insert_time_ms: 5 insert_new_count: 173 insert_reused_count: 16 - query: EXPLAIN select * from f5(103); @@ -243,9 +243,9 @@ basic-sql-function-tests: AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2)' task_count: 1264 - task_total_time_ms: 251 - transform_count: 355 - transform_time_ms: 150 + task_total_time_ms: 95 + transform_count: 359 + transform_time_ms: 36 transform_yield_count: 106 insert_time_ms: 5 insert_new_count: 173 @@ -255,9 +255,9 @@ basic-sql-function-tests: AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2)' task_count: 1264 - task_total_time_ms: 234 - transform_count: 355 - transform_time_ms: 119 + task_total_time_ms: 93 + transform_count: 359 + transform_time_ms: 31 transform_yield_count: 106 insert_time_ms: 5 insert_new_count: 173 @@ -267,11 +267,11 @@ basic-sql-function-tests: AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2)' task_count: 1264 - task_total_time_ms: 127 - transform_count: 355 - transform_time_ms: 58 + task_total_time_ms: 95 + transform_count: 359 + transform_time_ms: 31 transform_yield_count: 106 - insert_time_ms: 6 + insert_time_ms: 9 insert_new_count: 173 insert_reused_count: 16 - query: EXPLAIN select * from f5(b => 'b', a => 102); @@ -279,11 +279,11 @@ basic-sql-function-tests: AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2)' task_count: 1264 - task_total_time_ms: 127 - transform_count: 355 - transform_time_ms: 58 + task_total_time_ms: 95 + transform_count: 359 + transform_time_ms: 31 transform_yield_count: 106 - insert_time_ms: 6 + insert_time_ms: 9 insert_new_count: 173 insert_reused_count: 16 - query: EXPLAIN select * from f5(b => 'a', a => 102); @@ -291,11 +291,11 @@ basic-sql-function-tests: AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2)' task_count: 1264 - task_total_time_ms: 127 - transform_count: 355 - transform_time_ms: 58 + task_total_time_ms: 95 + transform_count: 359 + transform_time_ms: 31 transform_yield_count: 106 - insert_time_ms: 6 + insert_time_ms: 9 insert_new_count: 173 insert_reused_count: 16 - query: EXPLAIN select * from f5(a => 102, b => 'a'); @@ -303,11 +303,11 @@ basic-sql-function-tests: AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2)' task_count: 1264 - task_total_time_ms: 199 - transform_count: 355 - transform_time_ms: 68 + task_total_time_ms: 93 + transform_count: 359 + transform_time_ms: 35 transform_yield_count: 106 - insert_time_ms: 25 + insert_time_ms: 5 insert_new_count: 173 insert_reused_count: 16 - query: EXPLAIN select * from f5(102); @@ -315,9 +315,9 @@ basic-sql-function-tests: AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2)' task_count: 1264 - task_total_time_ms: 251 - transform_count: 355 - transform_time_ms: 150 + task_total_time_ms: 95 + transform_count: 359 + transform_time_ms: 36 transform_yield_count: 106 insert_time_ms: 5 insert_new_count: 173 @@ -327,10 +327,10 @@ basic-sql-function-tests: AS LONG)]] -> [COL1: KEY[1], COL2: KEY[0], COL3: KEY[2]]) | MAP (_.COL1 AS COL1, _.COL2 AS COL2)' task_count: 1264 - task_total_time_ms: 237 - transform_count: 355 - transform_time_ms: 29 + task_total_time_ms: 90 + transform_count: 359 + transform_time_ms: 30 transform_yield_count: 106 - insert_time_ms: 19 + insert_time_ms: 5 insert_new_count: 173 insert_reused_count: 16 diff --git a/yaml-tests/src/test/resources/standard-tests-metadata.metrics.binpb b/yaml-tests/src/test/resources/standard-tests-metadata.metrics.binpb index 91ffec52c9..b5b60eb263 100644 --- a/yaml-tests/src/test/resources/standard-tests-metadata.metrics.binpb +++ b/yaml-tests/src/test/resources/standard-tests-metadata.metrics.binpb @@ -1,18 +1,18 @@ - +  -standard-tests-metadatamEXPLAIN select count(*) from (select * from (select * from (select * from T1 where ID = 5) as x) as y) as z; -q (08&@SCAN([EQUALS promote(@c23 AS LONG)]) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +standard-tests-metadatamEXPLAIN select count(*) from (select * from (select * from (select * from T1 where ID = 5) as x) as y) as z; +u (08&@SCAN([EQUALS promote(@c23 AS LONG)]) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q12._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q12 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Scan
    comparisons: [EQUALS promote(@c23 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Scan
    comparisons: [EQUALS promote(@c23 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q12> label="q12" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q40> label="q40" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q43> label="q43" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q12> label="q12" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; diff --git a/yaml-tests/src/test/resources/standard-tests-metadata.metrics.yaml b/yaml-tests/src/test/resources/standard-tests-metadata.metrics.yaml index 44a4c9f823..7e62fe516c 100644 --- a/yaml-tests/src/test/resources/standard-tests-metadata.metrics.yaml +++ b/yaml-tests/src/test/resources/standard-tests-metadata.metrics.yaml @@ -5,8 +5,8 @@ standard-tests-metadata: AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 375 - task_total_time_ms: 14 - transform_count: 113 + task_total_time_ms: 13 + transform_count: 117 transform_time_ms: 3 transform_yield_count: 25 insert_time_ms: 0 diff --git a/yaml-tests/src/test/resources/standard-tests-proto.metrics.binpb b/yaml-tests/src/test/resources/standard-tests-proto.metrics.binpb index 111adef213..c987c5b1eb 100644 --- a/yaml-tests/src/test/resources/standard-tests-proto.metrics.binpb +++ b/yaml-tests/src/test/resources/standard-tests-proto.metrics.binpb @@ -1,49 +1,49 @@ - + ] - unnamed-2PEXPLAIN select * from (select * from (select * from T1) as x where ID = 5) as y; -S Ŗ(0%8@$SCAN([EQUALS promote(@c19 AS LONG)])digraph G { + unnamed-2PEXPLAIN select * from (select * from (select * from T1) as x where ID = 5) as y; +W (0"8@$SCAN([EQUALS promote(@c19 AS LONG)])digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Scan
    comparisons: [EQUALS promote(@c19 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 2 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Scan
    comparisons: [EQUALS promote(@c19 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 2 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 2 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} ] - unnamed-2PEXPLAIN select * from (select * from (select * from T1) as x) as y where ID = 5; -f (0<8%@$SCAN([EQUALS promote(@c22 AS LONG)])digraph G { + unnamed-2PEXPLAIN select * from (select * from (select * from T1) as x) as y where ID = 5; +ٵ j (068%@$SCAN([EQUALS promote(@c22 AS LONG)])digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Scan
    comparisons: [EQUALS promote(@c22 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 2 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Scan
    comparisons: [EQUALS promote(@c22 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 2 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 2 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} z - unnamed-2mEXPLAIN select count(*) from (select * from (select * from (select * from T1 where ID = 5) as x) as y) as z; -q (08&@SCAN([EQUALS promote(@c23 AS LONG)]) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { + unnamed-2mEXPLAIN select count(*) from (select * from (select * from (select * from T1 where ID = 5) as x) as y) as z; +u Ð(0ԉ8&@SCAN([EQUALS promote(@c23 AS LONG)]) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q12._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q12 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Scan
    comparisons: [EQUALS promote(@c23 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Scan
    comparisons: [EQUALS promote(@c23 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q12> label="q12" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q40> label="q40" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q43> label="q43" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q12> label="q12" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} t - unnamed-2gEXPLAIN select * from (select * from (select * from (select * from T1 where ID > 10) as x) as y) as z; -N (08@,SCAN([[GREATER_THAN promote(@c20 AS LONG)]])digraph G { + unnamed-2gEXPLAIN select * from (select * from (select * from (select * from T1 where ID > 10) as x) as y) as z; +۔R (08@,SCAN([[GREATER_THAN promote(@c20 AS LONG)]])digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Scan
    comparisons: [[GREATER_THAN promote(@c20 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 2 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Scan
    comparisons: [[GREATER_THAN promote(@c20 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 2 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 2 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; } \ No newline at end of file diff --git a/yaml-tests/src/test/resources/standard-tests-proto.metrics.yaml b/yaml-tests/src/test/resources/standard-tests-proto.metrics.yaml index f348f32f8d..162cbcbf3b 100644 --- a/yaml-tests/src/test/resources/standard-tests-proto.metrics.yaml +++ b/yaml-tests/src/test/resources/standard-tests-proto.metrics.yaml @@ -3,8 +3,8 @@ unnamed-2: 5) as y; explain: SCAN([EQUALS promote(@c19 AS LONG)]) task_count: 245 - task_total_time_ms: 14 - transform_count: 83 + task_total_time_ms: 17 + transform_count: 87 transform_time_ms: 3 transform_yield_count: 22 insert_time_ms: 0 @@ -14,8 +14,8 @@ unnamed-2: ID = 5; explain: SCAN([EQUALS promote(@c22 AS LONG)]) task_count: 287 - task_total_time_ms: 15 - transform_count: 102 + task_total_time_ms: 20 + transform_count: 106 transform_time_ms: 4 transform_yield_count: 26 insert_time_ms: 0 @@ -27,9 +27,9 @@ unnamed-2: AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) task_count: 375 - task_total_time_ms: 14 - transform_count: 113 - transform_time_ms: 3 + task_total_time_ms: 15 + transform_count: 117 + transform_time_ms: 4 transform_yield_count: 25 insert_time_ms: 0 insert_new_count: 38 @@ -38,8 +38,8 @@ unnamed-2: ID > 10) as x) as y) as z; explain: SCAN([[GREATER_THAN promote(@c20 AS LONG)]]) task_count: 238 - task_total_time_ms: 14 - transform_count: 78 + task_total_time_ms: 11 + transform_count: 82 transform_time_ms: 3 transform_yield_count: 21 insert_time_ms: 0 diff --git a/yaml-tests/src/test/resources/standard-tests.metrics.binpb b/yaml-tests/src/test/resources/standard-tests.metrics.binpb index 7a44915060..77e7fd0296 100644 --- a/yaml-tests/src/test/resources/standard-tests.metrics.binpb +++ b/yaml-tests/src/test/resources/standard-tests.metrics.binpb @@ -1,245 +1,270 @@ - +  -standard-testsnEXPLAIN select id, case when col1 = 10 then 100 when col2 in (6,7,8,9) then 200 else 300 end as NEWCOL from T1 -5 (0>8@ISCAN(I1 <,>) | MAP (_.ID AS ID, pick(ConditionSelector(_.COL1 equals @c8, _.COL2 IN promote(@c14 AS ARRAY(LONG)), TRUE), @c10, @c24, @c26) AS NEWCOL) -digraph G { +standard-testsnEXPLAIN select id, case when col1 = 10 then 100 when col2 in (6,7,8,9) then 200 else 300 end as NEWCOL from T1 +9 Ï(0+8@ISCAN(I1 <,>) | MAP (_.ID AS ID, pick(ConditionSelector(_.COL1 equals @c8, _.COL2 IN promote(@c14 AS ARRAY(LONG)), TRUE), @c10, @c24, @c26) AS NEWCOL) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q2.ID AS ID, pick(ConditionSelector(q2.COL1 equals @c8, q2.COL2 IN promote(@c14 AS ARRAY(LONG)), TRUE), @c10, @c24, @c26) AS NEWCOL)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 2 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q2.ID AS ID, pick(ConditionSelector(q2.COL1 equals @c8, q2.COL2 IN promote(@c14 AS ARRAY(LONG)), TRUE), @c10, @c24, @c26) AS NEWCOL)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, INT AS NEWCOL)" ]; + 2 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} w -standard-testseEXPLAIN select id, case when col1 = 10 then 100 when col2 in (6,7,8,9) then 200 end as NEWCOL from T1 -5 (0L8@ISCAN(I1 <,>) | MAP (_.ID AS ID, pick(ConditionSelector(_.COL1 equals @c8, _.COL2 IN promote(@c14 AS ARRAY(LONG))), @c10, @c24) AS NEWCOL) -digraph G { +standard-testseEXPLAIN select id, case when col1 = 10 then 100 when col2 in (6,7,8,9) then 200 end as NEWCOL from T1 +9 (0(8@ISCAN(I1 <,>) | MAP (_.ID AS ID, pick(ConditionSelector(_.COL1 equals @c8, _.COL2 IN promote(@c14 AS ARRAY(LONG))), @c10, @c24) AS NEWCOL) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q2.ID AS ID, pick(ConditionSelector(q2.COL1 equals @c8, q2.COL2 IN promote(@c14 AS ARRAY(LONG))), @c10, @c24) AS NEWCOL)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 2 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q2.ID AS ID, pick(ConditionSelector(q2.COL1 equals @c8, q2.COL2 IN promote(@c14 AS ARRAY(LONG))), @c10, @c24) AS NEWCOL)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, INT AS NEWCOL)" ]; + 2 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} : -standard-tests(EXPLAIN select * from T1 where COL1 = 20 -ѣ K ڭ(0%8@'ISCAN(I1 [EQUALS promote(@c8 AS LONG)])digraph G { +standard-tests(EXPLAIN select * from T1 where COL1 = 20 +M (08@VISCAN(I1 [EQUALS promote(@c8 AS LONG)]) ∩ SCAN(<,>) COMPARE BY (recordType(_), _.ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c8 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 2 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 2 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 1 [ label=<
    Intersection
    COMPARE BY (recordType(_), _.ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c8 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 4 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 5 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q48> label="q48" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 1 [ label=< q50> label="q50" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} I -standard-tests7EXPLAIN select * from T1 where COL1 >= 10 OR COL1 <= 20 +standard-tests7EXPLAIN select * from T1 where COL1 >= 10 OR COL1 <= 20  -. (O0¨8@COVERING(I1 [[GREATER_THAN_OR_EQUALS promote(@c9 AS LONG)]] -> [COL1: KEY[0], ID: KEY[2]]) ⊎ COVERING(I1 [[LESS_THAN_OR_EQUALS promote(@c14 AS LONG)]] -> [COL1: KEY[0], ID: KEY[2]]) | DISTINCT BY PK | FETCHdigraph G { +' (O08@COVERING(I1 [[GREATER_THAN_OR_EQUALS promote(@c9 AS LONG)]] -> [COL1: KEY[0], ID: KEY[2]]) ⊎ COVERING(I1 [[LESS_THAN_OR_EQUALS promote(@c14 AS LONG)]] -> [COL1: KEY[0], ID: KEY[2]]) | DISTINCT BY PK | FETCHdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Fetch Records
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, )" ]; - 2 [ label=<
    Unordered Primary Key Distinct
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Covering Index Scan
    comparisons: [[GREATER_THAN_OR_EQUALS promote(@c9 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Covering Index Scan
    comparisons: [[LESS_THAN_OR_EQUALS promote(@c14 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 7 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q127> label="q127" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q107> label="q107" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 3 [ label=< q109> label="q109" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 1 [ label=<
    Fetch Records
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 2 [ label=<
    Unordered Primary Key Distinct
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 4 [ label=<
    Covering Index Scan
    comparisons: [[GREATER_THAN_OR_EQUALS promote(@c9 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 5 [ label=<
    Covering Index Scan
    comparisons: [[LESS_THAN_OR_EQUALS promote(@c14 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 7 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ label=< q137> label="q137" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q117> label="q117" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 3 [ label=< q119> label="q119" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q129> label="q129" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q139> label="q139" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} W -standard-testsEEXPLAIN select * from T1 where COL1 >= 10 OR COL1 <= 20 ORDER BY COL1 -  (>0յ8}@ISCAN(I1 [[GREATER_THAN_OR_EQUALS promote(@c9 AS LONG)]]) ∪ ISCAN(I1 [[LESS_THAN_OR_EQUALS promote(@c14 AS LONG)]]) COMPARE BY (_.COL1, recordType(_), _.ID)digraph G { +standard-testsEEXPLAIN select * from T1 where COL1 >= 10 OR COL1 <= 20 ORDER BY COL1 + (>08}@ISCAN(I1 [[GREATER_THAN_OR_EQUALS promote(@c9 AS LONG)]]) ∪ ISCAN(I1 [[LESS_THAN_OR_EQUALS promote(@c14 AS LONG)]]) COMPARE BY (_.COL1, recordType(_), _.ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Union Distinct
    COMPARE BY (_.COL1, recordType(_), _.ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 2 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN_OR_EQUALS promote(@c9 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index Scan
    comparisons: [[LESS_THAN_OR_EQUALS promote(@c14 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Union Distinct
    COMPARE BY (_.COL1, recordType(_), _.ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 2 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN_OR_EQUALS promote(@c9 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 4 [ label=<
    Index Scan
    comparisons: [[LESS_THAN_OR_EQUALS promote(@c14 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 5 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q122> label="q122" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q128> label="q128" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 1 [ label=< q124> label="q124" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 4 -> 1 [ label=< q130> label="q130" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} J -standard-tests8EXPLAIN select * from T1 where COL1 >= 10 AND COL1 <= 20 -ǒ L (0̈́28@fISCAN(I1 [[GREATER_THAN_OR_EQUALS promote(@c9 AS LONG) && LESS_THAN_OR_EQUALS promote(@c14 AS LONG)]])digraph G { +standard-tests8EXPLAIN select * from T1 where COL1 >= 10 AND COL1 <= 20 + +P Ϋ(0E8@fISCAN(I1 [[GREATER_THAN_OR_EQUALS promote(@c9 AS LONG) && LESS_THAN_OR_EQUALS promote(@c14 AS LONG)]])digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN_OR_EQUALS promote(@c9 AS LONG) && LESS_THAN_OR_EQUALS promote(@c14 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 2 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN_OR_EQUALS promote(@c9 AS LONG) && LESS_THAN_OR_EQUALS promote(@c14 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 2 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 2 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} X -standard-testsFEXPLAIN select * from T1 where COL1 >= 10 AND COL1 <= 20 ORDER BY COL1 -ߝA (08@fISCAN(I1 [[GREATER_THAN_OR_EQUALS promote(@c9 AS LONG) && LESS_THAN_OR_EQUALS promote(@c14 AS LONG)]])digraph G { +standard-testsFEXPLAIN select * from T1 where COL1 >= 10 AND COL1 <= 20 ORDER BY COL1 +ʛ +E (0Ӵ8@fISCAN(I1 [[GREATER_THAN_OR_EQUALS promote(@c9 AS LONG) && LESS_THAN_OR_EQUALS promote(@c14 AS LONG)]])digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN_OR_EQUALS promote(@c9 AS LONG) && LESS_THAN_OR_EQUALS promote(@c14 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 2 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN_OR_EQUALS promote(@c9 AS LONG) && LESS_THAN_OR_EQUALS promote(@c14 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 2 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 2 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} G -standard-tests5EXPLAIN select * from T1 where COL1 = 20 OR COL1 = 20 - Y Ȧ(!08%@'ISCAN(I1 [EQUALS promote(@c8 AS LONG)])digraph G { +standard-tests5EXPLAIN select * from T1 where COL1 = 20 OR COL1 = 20 +[ (0q8$@VISCAN(I1 [EQUALS promote(@c8 AS LONG)]) ∩ SCAN(<,>) COMPARE BY (recordType(_), _.ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c8 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 2 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 2 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 1 [ label=<
    Intersection
    COMPARE BY (recordType(_), _.ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c8 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 4 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 5 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q50> label="q50" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 1 [ label=< q52> label="q52" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} U -standard-testsCEXPLAIN select * from T1 where COL1 = 20 OR COL1 = 20 ORDER BY COL1 - O (0}8@'ISCAN(I1 [EQUALS promote(@c8 AS LONG)])digraph G { +standard-testsCEXPLAIN select * from T1 where COL1 = 20 OR COL1 = 20 ORDER BY COL1 +ڻ S (0j8@'ISCAN(I1 [EQUALS promote(@c8 AS LONG)])digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c8 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 2 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c8 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 2 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 2 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} H -standard-tests6EXPLAIN select * from T1 where COL1 = 20 AND COL1 = 20 - K (0&8@'ISCAN(I1 [EQUALS promote(@c8 AS LONG)])digraph G { +standard-tests6EXPLAIN select * from T1 where COL1 = 20 AND COL1 = 20 +ԔM ͼ(0(8@VISCAN(I1 [EQUALS promote(@c8 AS LONG)]) ∩ SCAN(<,>) COMPARE BY (recordType(_), _.ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c8 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 2 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 2 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 1 [ label=<
    Intersection
    COMPARE BY (recordType(_), _.ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c8 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 4 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 5 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q48> label="q48" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 1 [ label=< q50> label="q50" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}+ f -standard-testsTEXPLAIN select * from T1 where (COL1 = 20 OR COL1 = 10) AND (COL1 = 20 OR COL1 = 10) -ɐW (08@-COVERING(I1 [EQUALS promote(@c9 AS LONG)] -> [COL1: KEY[0], ID: KEY[2]]) ⊎ COVERING(I1 [EQUALS promote(@c13 AS LONG)] -> [COL1: KEY[0], ID: KEY[2]]) | DISTINCT BY PK | FETCHdigraph G { +standard-testsTEXPLAIN select * from T1 where (COL1 = 20 OR COL1 = 10) AND (COL1 = 20 OR COL1 = 10)* +@ (08@2ISCAN(I1 [EQUALS promote(@c9 AS LONG)]) ∩ SCAN(<,>) COMPARE BY (recordType(_), _.ID) ∪ ISCAN(I1 [EQUALS promote(@c13 AS LONG)]) ∩ SCAN(<,>) COMPARE BY (recordType(_), _.ID) COMPARE BY (recordType(_), _.ID, _.COL1)(digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Fetch Records
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, )" ]; - 2 [ label=<
    Unordered Primary Key Distinct
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c13 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Covering Index Scan
    comparisons: [EQUALS promote(@c9 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 7 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q277> label="q277" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q259> label="q259" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 3 [ label=< q257> label="q257" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 1 [ label=<
    Union Distinct
    COMPARE BY (recordType(_), _.ID, _.COL1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 2 [ label=<
    Intersection
    COMPARE BY (recordType(_), _.ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 4 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c9 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 5 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 7 [ label=<
    Intersection
    COMPARE BY (recordType(_), _.ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 8 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c13 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 9 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 10 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 11 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ label=< q251> label="q251" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 2 [ label=< q249> label="q249" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q279> label="q279" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q283> label="q283" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 8 -> 7 [ label=< q226> label="q226" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 9 -> 7 [ label=< q228> label="q228" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 10 -> 8 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 11 -> 9 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 1 [ label=< q285> label="q285" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} t -standard-testsbEXPLAIN select * from T1 where (COL1 = 20 OR COL1 = 10) AND (COL1 = 20 OR COL1 = 10) ORDER BY COL1 -ܰ1 (j0؉8@+}ISCAN(I1 [EQUALS promote(@c9 AS LONG)]) ∪ ISCAN(I1 [EQUALS promote(@c13 AS LONG)]) COMPARE BY (_.COL1, recordType(_), _.ID)digraph G { +standard-testsbEXPLAIN select * from T1 where (COL1 = 20 OR COL1 = 10) AND (COL1 = 20 OR COL1 = 10) ORDER BY COL1 +ٸF (j08@+}ISCAN(I1 [EQUALS promote(@c9 AS LONG)]) ∪ ISCAN(I1 [EQUALS promote(@c13 AS LONG)]) COMPARE BY (_.COL1, recordType(_), _.ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Union Distinct
    COMPARE BY (_.COL1, recordType(_), _.ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c9 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c13 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 5 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Union Distinct
    COMPARE BY (_.COL1, recordType(_), _.ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c9 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 4 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c13 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 5 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q269> label="q269" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q284> label="q284" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 1 [ label=< q271> label="q271" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 4 -> 1 [ label=< q286> label="q286" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} k -standard-testsYEXPLAIN select * from T1 where (COL1 >= 10 AND COL1 <= 20) OR (COL1 >= 10 AND COL1 <= 20) -ђ -Z (!058%@gISCAN(I1 [[GREATER_THAN_OR_EQUALS promote(@c10 AS LONG) && LESS_THAN_OR_EQUALS promote(@c15 AS LONG)]])digraph G { +standard-testsYEXPLAIN select * from T1 where (COL1 >= 10 AND COL1 <= 20) OR (COL1 >= 10 AND COL1 <= 20) + ^ (!0T8%@gISCAN(I1 [[GREATER_THAN_OR_EQUALS promote(@c10 AS LONG) && LESS_THAN_OR_EQUALS promote(@c15 AS LONG)]])digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN_OR_EQUALS promote(@c10 AS LONG) && LESS_THAN_OR_EQUALS promote(@c15 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 2 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN_OR_EQUALS promote(@c10 AS LONG) && LESS_THAN_OR_EQUALS promote(@c15 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 2 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 2 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} y -standard-testsgEXPLAIN select * from T1 where (COL1 >= 10 AND COL1 <= 20) OR (COL1 >= 10 AND COL1 <= 20) ORDER BY COL1 -O (0 8@gISCAN(I1 [[GREATER_THAN_OR_EQUALS promote(@c10 AS LONG) && LESS_THAN_OR_EQUALS promote(@c15 AS LONG)]])digraph G { +standard-testsgEXPLAIN select * from T1 where (COL1 >= 10 AND COL1 <= 20) OR (COL1 >= 10 AND COL1 <= 20) ORDER BY COL1 +ȇS (0-8@gISCAN(I1 [[GREATER_THAN_OR_EQUALS promote(@c10 AS LONG) && LESS_THAN_OR_EQUALS promote(@c15 AS LONG)]])digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN_OR_EQUALS promote(@c10 AS LONG) && LESS_THAN_OR_EQUALS promote(@c15 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 2 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN_OR_EQUALS promote(@c10 AS LONG) && LESS_THAN_OR_EQUALS promote(@c15 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 2 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 2 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} b -standard-testsPEXPLAIN select * from (select * from (select * from T1) as x where ID = 5) as y; - s ٕ($0g82@ aCOVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER _.ID EQUALS promote(@c19 AS LONG) | FETCH digraph G { +standard-testsPEXPLAIN select * from (select * from (select * from T1) as x where ID = 5) as y; +w ($082@ aCOVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER _.ID EQUALS promote(@c19 AS LONG) | FETCHdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Fetch Records
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, )" ]; - 2 [ label=<
    Predicate Filter
    WHERE q42.ID EQUALS promote(@c19 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Covering Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q42> label="q42" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 1 [ label=<
    Fetch Records
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q46.ID EQUALS promote(@c19 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Covering Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ label=< q46> label="q46" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q44> label="q44" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q48> label="q48" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} b -standard-testsPEXPLAIN select * from (select * from (select * from T1) as x) as y where ID = 5; - ((0Ǝ8;@ aCOVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER _.ID EQUALS promote(@c22 AS LONG) | FETCH digraph G { +standard-testsPEXPLAIN select * from (select * from (select * from T1) as x) as y where ID = 5; + ((0À8;@ aCOVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER _.ID EQUALS promote(@c22 AS LONG) | FETCHdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Fetch Records
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, )" ]; - 2 [ label=<
    Predicate Filter
    WHERE q45.ID EQUALS promote(@c22 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Covering Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q45> label="q45" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 1 [ label=<
    Fetch Records
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q49.ID EQUALS promote(@c22 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Covering Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ label=< q49> label="q49" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q47> label="q47" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 2 -> 1 [ label=< q51> label="q51" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}  -standard-testsmEXPLAIN select count(*) from (select * from (select * from (select * from T1 where ID = 5) as x) as y) as z; - ()0c8D@COVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER _.ID EQUALS promote(@c23 AS LONG) | FETCH | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { +standard-testsmEXPLAIN select count(*) from (select * from (select * from (select * from T1 where ID = 5) as x) as y) as z; + ()0́8D@COVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER _.ID EQUALS promote(@c23 AS LONG) | FETCH | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (coalesce_long(q12._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 2 [ label=<
    Value Computation
    $q12 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 3 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q50 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Fetch Records
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Predicate Filter
    WHERE q52.ID EQUALS promote(@c23 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 7 [ label=<
    Covering Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 8 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 4 [ label=<
    Value Computation
    MAP (q54 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Fetch Records
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Predicate Filter
    WHERE q56.ID EQUALS promote(@c23 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 7 [ label=<
    Covering Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 8 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q12> label="q12" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q76> label="q76" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q50> label="q50" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q54> label="q54" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q52> label="q52" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q82> label="q82" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q54> label="q54" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q58> label="q58" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 6 [ label=< q56> label="q56" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q12> label="q12" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} y -standard-testsgEXPLAIN select * from (select * from (select * from (select * from T1 where ID > 10) as x) as y) as z; -n (#0ٴF8/@gCOVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER _.ID GREATER_THAN promote(@c20 AS LONG) | FETCH digraph G { +standard-testsgEXPLAIN select * from (select * from (select * from (select * from T1 where ID > 10) as x) as y) as z; +זr (#08/@gCOVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER _.ID GREATER_THAN promote(@c20 AS LONG) | FETCHdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Fetch Records
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, )" ]; - 2 [ label=<
    Predicate Filter
    WHERE q42.ID GREATER_THAN promote(@c20 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Covering Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 -> 2 [ label=< q42> label="q42" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 1 [ label=<
    Fetch Records
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q46.ID GREATER_THAN promote(@c20 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Covering Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 4 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ label=< q46> label="q46" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q44> label="q44" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q48> label="q48" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; } \ No newline at end of file diff --git a/yaml-tests/src/test/resources/standard-tests.metrics.yaml b/yaml-tests/src/test/resources/standard-tests.metrics.yaml index 108fad6fc0..5b199d46f8 100644 --- a/yaml-tests/src/test/resources/standard-tests.metrics.yaml +++ b/yaml-tests/src/test/resources/standard-tests.metrics.yaml @@ -4,11 +4,11 @@ standard-tests: explain: ISCAN(I1 <,>) | MAP (_.ID AS ID, pick(ConditionSelector(_.COL1 equals @c8, _.COL2 IN promote(@c14 AS ARRAY(LONG)), TRUE), @c10, @c24, @c26) AS NEWCOL) task_count: 213 - task_total_time_ms: 18 - transform_count: 53 - transform_time_ms: 7 + task_total_time_ms: 13 + transform_count: 57 + transform_time_ms: 6 transform_yield_count: 23 - insert_time_ms: 1 + insert_time_ms: 0 insert_new_count: 22 insert_reused_count: 4 - query: EXPLAIN select id, case when col1 = 10 then 100 when col2 in (6,7,8,9) @@ -16,33 +16,34 @@ standard-tests: explain: ISCAN(I1 <,>) | MAP (_.ID AS ID, pick(ConditionSelector(_.COL1 equals @c8, _.COL2 IN promote(@c14 AS ARRAY(LONG))), @c10, @c24) AS NEWCOL) task_count: 213 - task_total_time_ms: 18 - transform_count: 53 - transform_time_ms: 7 + task_total_time_ms: 11 + transform_count: 57 + transform_time_ms: 6 transform_yield_count: 23 - insert_time_ms: 1 + insert_time_ms: 0 insert_new_count: 22 insert_reused_count: 4 - query: EXPLAIN select * from T1 where COL1 = 20 - explain: ISCAN(I1 [EQUALS promote(@c8 AS LONG)]) - task_count: 311 - task_total_time_ms: 19 - transform_count: 75 - transform_time_ms: 7 - transform_yield_count: 30 + explain: ISCAN(I1 [EQUALS promote(@c8 AS LONG)]) ∩ SCAN(<,>) COMPARE BY (recordType(_), + _.ID) + task_count: 310 + task_total_time_ms: 14 + transform_count: 77 + transform_time_ms: 6 + transform_yield_count: 28 insert_time_ms: 0 - insert_new_count: 31 - insert_reused_count: 4 + insert_new_count: 30 + insert_reused_count: 2 - query: EXPLAIN select * from T1 where COL1 >= 10 OR COL1 <= 20 explain: 'COVERING(I1 [[GREATER_THAN_OR_EQUALS promote(@c9 AS LONG)]] -> [COL1: KEY[0], ID: KEY[2]]) ⊎ COVERING(I1 [[LESS_THAN_OR_EQUALS promote(@c14 AS LONG)]] -> [COL1: KEY[0], ID: KEY[2]]) | DISTINCT BY PK | FETCH' task_count: 1285 - task_total_time_ms: 98 - transform_count: 255 - transform_time_ms: 24 + task_total_time_ms: 83 + transform_count: 264 + transform_time_ms: 38 transform_yield_count: 79 - insert_time_ms: 4 + insert_time_ms: 6 insert_new_count: 159 insert_reused_count: 23 - query: EXPLAIN select * from T1 where COL1 >= 10 OR COL1 <= 20 ORDER BY COL1 @@ -50,88 +51,90 @@ standard-tests: [[LESS_THAN_OR_EQUALS promote(@c14 AS LONG)]]) COMPARE BY (_.COL1, recordType(_), _.ID) task_count: 1080 - task_total_time_ms: 69 - transform_count: 218 - transform_time_ms: 28 + task_total_time_ms: 51 + transform_count: 228 + transform_time_ms: 17 transform_yield_count: 62 - insert_time_ms: 4 + insert_time_ms: 3 insert_new_count: 125 insert_reused_count: 14 - query: EXPLAIN select * from T1 where COL1 >= 10 AND COL1 <= 20 explain: ISCAN(I1 [[GREATER_THAN_OR_EQUALS promote(@c9 AS LONG) && LESS_THAN_OR_EQUALS promote(@c14 AS LONG)]]) task_count: 311 - task_total_time_ms: 19 - transform_count: 76 - transform_time_ms: 8 + task_total_time_ms: 21 + transform_count: 80 + transform_time_ms: 9 transform_yield_count: 30 - insert_time_ms: 0 + insert_time_ms: 1 insert_new_count: 31 insert_reused_count: 4 - query: EXPLAIN select * from T1 where COL1 >= 10 AND COL1 <= 20 ORDER BY COL1 explain: ISCAN(I1 [[GREATER_THAN_OR_EQUALS promote(@c9 AS LONG) && LESS_THAN_OR_EQUALS promote(@c14 AS LONG)]]) task_count: 263 - task_total_time_ms: 17 - transform_count: 65 - transform_time_ms: 6 + task_total_time_ms: 21 + transform_count: 69 + transform_time_ms: 11 transform_yield_count: 26 insert_time_ms: 0 insert_new_count: 24 insert_reused_count: 2 - query: EXPLAIN select * from T1 where COL1 = 20 OR COL1 = 20 - explain: ISCAN(I1 [EQUALS promote(@c8 AS LONG)]) - task_count: 334 - task_total_time_ms: 28 - transform_count: 89 - transform_time_ms: 11 - transform_yield_count: 33 - insert_time_ms: 2 - insert_new_count: 37 - insert_reused_count: 5 + explain: ISCAN(I1 [EQUALS promote(@c8 AS LONG)]) ∩ SCAN(<,>) COMPARE BY (recordType(_), + _.ID) + task_count: 333 + task_total_time_ms: 30 + transform_count: 91 + transform_time_ms: 15 + transform_yield_count: 31 + insert_time_ms: 1 + insert_new_count: 36 + insert_reused_count: 3 - query: EXPLAIN select * from T1 where COL1 = 20 OR COL1 = 20 ORDER BY COL1 explain: ISCAN(I1 [EQUALS promote(@c8 AS LONG)]) task_count: 286 task_total_time_ms: 25 - transform_count: 79 - transform_time_ms: 10 + transform_count: 83 + transform_time_ms: 11 transform_yield_count: 29 - insert_time_ms: 2 + insert_time_ms: 1 insert_new_count: 30 insert_reused_count: 3 - query: EXPLAIN select * from T1 where COL1 = 20 AND COL1 = 20 - explain: ISCAN(I1 [EQUALS promote(@c8 AS LONG)]) - task_count: 311 - task_total_time_ms: 19 - transform_count: 75 + explain: ISCAN(I1 [EQUALS promote(@c8 AS LONG)]) ∩ SCAN(<,>) COMPARE BY (recordType(_), + _.ID) + task_count: 310 + task_total_time_ms: 17 + transform_count: 77 transform_time_ms: 7 - transform_yield_count: 30 + transform_yield_count: 28 insert_time_ms: 0 - insert_new_count: 31 - insert_reused_count: 4 + insert_new_count: 30 + insert_reused_count: 2 - query: EXPLAIN select * from T1 where (COL1 = 20 OR COL1 = 10) AND (COL1 = 20 OR COL1 = 10) - explain: 'COVERING(I1 [EQUALS promote(@c9 AS LONG)] -> [COL1: KEY[0], ID: KEY[2]]) - ⊎ COVERING(I1 [EQUALS promote(@c13 AS LONG)] -> [COL1: KEY[0], ID: KEY[2]]) - | DISTINCT BY PK | FETCH' - task_count: 2483 - task_total_time_ms: 183 - transform_count: 467 - transform_time_ms: 49 - transform_yield_count: 144 - insert_time_ms: 16 - insert_new_count: 317 - insert_reused_count: 45 + explain: ISCAN(I1 [EQUALS promote(@c9 AS LONG)]) ∩ SCAN(<,>) COMPARE BY (recordType(_), + _.ID) ∪ ISCAN(I1 [EQUALS promote(@c13 AS LONG)]) ∩ SCAN(<,>) COMPARE BY (recordType(_), + _.ID) COMPARE BY (recordType(_), _.ID, _.COL1) + task_count: 2459 + task_total_time_ms: 136 + transform_count: 476 + transform_time_ms: 42 + transform_yield_count: 151 + insert_time_ms: 13 + insert_new_count: 324 + insert_reused_count: 50 - query: EXPLAIN select * from T1 where (COL1 = 20 OR COL1 = 10) AND (COL1 = 20 OR COL1 = 10) ORDER BY COL1 explain: ISCAN(I1 [EQUALS promote(@c9 AS LONG)]) ∪ ISCAN(I1 [EQUALS promote(@c13 AS LONG)]) COMPARE BY (_.COL1, recordType(_), _.ID) task_count: 2225 - task_total_time_ms: 103 - transform_count: 410 - transform_time_ms: 39 + task_total_time_ms: 147 + transform_count: 431 + transform_time_ms: 47 transform_yield_count: 106 - insert_time_ms: 8 + insert_time_ms: 12 insert_new_count: 249 insert_reused_count: 43 - query: EXPLAIN select * from T1 where (COL1 >= 10 AND COL1 <= 20) OR (COL1 >= @@ -139,11 +142,11 @@ standard-tests: explain: ISCAN(I1 [[GREATER_THAN_OR_EQUALS promote(@c10 AS LONG) && LESS_THAN_OR_EQUALS promote(@c15 AS LONG)]]) task_count: 334 - task_total_time_ms: 21 - transform_count: 90 - transform_time_ms: 9 + task_total_time_ms: 24 + transform_count: 94 + transform_time_ms: 12 transform_yield_count: 33 - insert_time_ms: 0 + insert_time_ms: 1 insert_new_count: 37 insert_reused_count: 5 - query: EXPLAIN select * from T1 where (COL1 >= 10 AND COL1 <= 20) OR (COL1 >= @@ -151,9 +154,9 @@ standard-tests: explain: ISCAN(I1 [[GREATER_THAN_OR_EQUALS promote(@c10 AS LONG) && LESS_THAN_OR_EQUALS promote(@c15 AS LONG)]]) task_count: 286 - task_total_time_ms: 13 - transform_count: 79 - transform_time_ms: 7 + task_total_time_ms: 31 + transform_count: 83 + transform_time_ms: 20 transform_yield_count: 29 insert_time_ms: 0 insert_new_count: 30 @@ -163,11 +166,11 @@ standard-tests: explain: 'COVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER _.ID EQUALS promote(@c19 AS LONG) | FETCH' task_count: 399 - task_total_time_ms: 28 - transform_count: 115 - transform_time_ms: 10 + task_total_time_ms: 30 + transform_count: 119 + transform_time_ms: 12 transform_yield_count: 36 - insert_time_ms: 1 + insert_time_ms: 2 insert_new_count: 50 insert_reused_count: 9 - query: EXPLAIN select * from (select * from (select * from T1) as x) as y where @@ -175,11 +178,11 @@ standard-tests: explain: 'COVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER _.ID EQUALS promote(@c22 AS LONG) | FETCH' task_count: 441 - task_total_time_ms: 34 - transform_count: 134 - transform_time_ms: 10 + task_total_time_ms: 40 + transform_count: 138 + transform_time_ms: 12 transform_yield_count: 40 - insert_time_ms: 2 + insert_time_ms: 3 insert_new_count: 59 insert_reused_count: 12 - query: EXPLAIN select count(*) from (select * from (select * from (select * from @@ -188,11 +191,11 @@ standard-tests: promote(@c23 AS LONG) | FETCH | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)' task_count: 603 - task_total_time_ms: 36 - transform_count: 164 - transform_time_ms: 11 + task_total_time_ms: 50 + transform_count: 168 + transform_time_ms: 25 transform_yield_count: 41 - insert_time_ms: 1 + insert_time_ms: 2 insert_new_count: 68 insert_reused_count: 6 - query: EXPLAIN select * from (select * from (select * from (select * from T1 where @@ -200,10 +203,10 @@ standard-tests: explain: 'COVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER _.ID GREATER_THAN promote(@c20 AS LONG) | FETCH' task_count: 392 - task_total_time_ms: 18 - transform_count: 110 - transform_time_ms: 7 + task_total_time_ms: 30 + transform_count: 114 + transform_time_ms: 12 transform_yield_count: 35 - insert_time_ms: 1 + insert_time_ms: 3 insert_new_count: 47 insert_reused_count: 8 diff --git a/yaml-tests/src/test/resources/standard-tests.yamsql b/yaml-tests/src/test/resources/standard-tests.yamsql index 7ae943583f..ed51dcd4a1 100644 --- a/yaml-tests/src/test/resources/standard-tests.yamsql +++ b/yaml-tests/src/test/resources/standard-tests.yamsql @@ -81,7 +81,7 @@ test_block: {ID: 13, NEWCOL: !null x} ] - - query: select * from T1 where COL1 = 20 - - explain: "ISCAN(I1 [EQUALS promote(@c8 AS LONG)])" + - explain: "ISCAN(I1 [EQUALS promote(@c8 AS LONG)]) ∩ SCAN(<,>) COMPARE BY (recordType(_), _.ID)" - result: [ {ID: 6, COL1: 20, COL2: 6}, {ID: 7, COL1: 20, COL2: 7}, @@ -167,7 +167,7 @@ test_block: ] - - query: select * from T1 where COL1 = 20 OR COL1 = 20 - - explain: "ISCAN(I1 [EQUALS promote(@c8 AS LONG)])" + - explain: "ISCAN(I1 [EQUALS promote(@c8 AS LONG)]) ∩ SCAN(<,>) COMPARE BY (recordType(_), _.ID)" - result: [ {ID: 6, COL1: 20, COL2: 6}, {ID: 7, COL1: 20, COL2: 7}, @@ -193,7 +193,7 @@ test_block: ] - - query: select * from T1 where COL1 = 20 AND COL1 = 20 - - explain: "ISCAN(I1 [EQUALS promote(@c8 AS LONG)])" + - explain: "ISCAN(I1 [EQUALS promote(@c8 AS LONG)]) ∩ SCAN(<,>) COMPARE BY (recordType(_), _.ID)" - result: [ {ID: 6, COL1: 20, COL2: 6}, {ID: 7, COL1: 20, COL2: 7}, @@ -206,7 +206,7 @@ test_block: ] - - query: select * from T1 where (COL1 = 20 OR COL1 = 10) AND (COL1 = 20 OR COL1 = 10) - - explain: "COVERING(I1 [EQUALS promote(@c9 AS LONG)] -> [COL1: KEY[0], ID: KEY[2]]) ⊎ COVERING(I1 [EQUALS promote(@c13 AS LONG)] -> [COL1: KEY[0], ID: KEY[2]]) | DISTINCT BY PK | FETCH" + - explain: "ISCAN(I1 [EQUALS promote(@c9 AS LONG)]) ∩ SCAN(<,>) COMPARE BY (recordType(_), _.ID) ∪ ISCAN(I1 [EQUALS promote(@c13 AS LONG)]) ∩ SCAN(<,>) COMPARE BY (recordType(_), _.ID) COMPARE BY (recordType(_), _.ID, _.COL1)" - initialVersionLessThan: 4.3.6.0 # Prior to 4.3.6.0, there was an error that would result in this query failing due to an illegal argument exception # The error is currently not propagated as a SQLException, so we can't even assert on the error code diff --git a/yaml-tests/src/test/resources/subquery-tests.metrics.binpb b/yaml-tests/src/test/resources/subquery-tests.metrics.binpb index ad8018a1b7..f858827641 100644 --- a/yaml-tests/src/test/resources/subquery-tests.metrics.binpb +++ b/yaml-tests/src/test/resources/subquery-tests.metrics.binpb @@ -1,29 +1,29 @@ -) +* [ -subquery-testsIEXPLAIN select ida from a where exists (select ida from a where ida = 1);) -, ()0⚸8H@SCAN(<,>) | TFILTER A | FILTER _.IDA EQUALS promote(@c15 AS INT) | MAP (_.IDA AS IDA) | DEFAULT NULL | FLATMAP q0 -> { SCAN(<,>) | TFILTER A | FILTER q0 NOT_NULL AS q1 RETURN (q1.IDA AS IDA) }'digraph G { +subquery-testsIEXPLAIN select ida from a where exists (select ida from a where ida = 1);) + ֳ()0o8H@SCAN(<,>) | TFILTER A | FILTER _.IDA EQUALS promote(@c15 AS INT) | MAP (_.IDA AS IDA) | DEFAULT NULL | FLATMAP q0 -> { SCAN(<,>) | TFILTER A | FILTER q0 NOT_NULL AS q1 RETURN (q1.IDA AS IDA) }'digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Nested Loop Join
    FLATMAP (q2.IDA AS IDA)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDA)" ]; 2 [ label=<
    Value Computation
    FIRST $q8 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDA)" ]; - 3 [ label=<
    Value Computation
    MAP (q34.IDA AS IDA)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDA)" ]; - 4 [ label=<
    Predicate Filter
    WHERE q4.IDA EQUALS promote(@c15 AS INT)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDA, )" ]; - 5 [ label=<
    Type Filter
    WHERE record IS [A]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDA, )" ]; + 3 [ label=<
    Value Computation
    MAP (q36.IDA AS IDA)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDA)" ]; + 4 [ label=<
    Predicate Filter
    WHERE q4.IDA EQUALS promote(@c15 AS INT)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDA, INT AS X)" ]; + 5 [ label=<
    Type Filter
    WHERE record IS [A]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDA, INT AS X)" ]; 6 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 7 [ label=<
    Primary Storage
    record types: [X, A, B, R]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 8 [ label=<
    Predicate Filter
    WHERE q8 NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDA, )" ]; - 9 [ label=<
    Type Filter
    WHERE record IS [A]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDA, )" ]; + 8 [ label=<
    Predicate Filter
    WHERE q8 NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDA, INT AS X)" ]; + 9 [ label=<
    Type Filter
    WHERE record IS [A]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDA, INT AS X)" ]; 10 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 11 [ label=<
    Primary Storage
    record types: [X, A, B, R]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q8> label="q8" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q34> label="q34" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q36> label="q36" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q4> label="q4" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q28> label="q28" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q29> label="q29" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q8> label="q8" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 9 -> 8 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 10 -> 9 [ label=< q44> label="q44" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 10 -> 9 [ label=< q48> label="q48" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 11 -> 10 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 1 [ label=< q2> label="q2" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; { @@ -31,32 +31,32 @@ rankDir=LR; 2 -> 8 [ color="red" style="invis" ]; } -}) +}* Y -subquery-testsGEXPLAIN select idx from x where exists (select x from a where ida = 1);) -K )(.08K@SCAN(<,>) | TFILTER A | FILTER _.IDA EQUALS promote(@c15 AS INT) | MAP (_.X AS X) | DEFAULT NULL | FLATMAP q0 -> { SCAN(<,>) | TFILTER X | FILTER q0 NOT_NULL AS q1 RETURN (q1.IDX AS IDX) }'digraph G { +subquery-testsGEXPLAIN select idx from x where exists (select x from a where ida = 1);) + (.0ão8K@SCAN(<,>) | TFILTER A | FILTER _.IDA EQUALS promote(@c15 AS INT) | MAP (_.X AS X) | DEFAULT NULL | FLATMAP q0 -> { SCAN(<,>) | TFILTER X | FILTER q0 NOT_NULL AS q1 RETURN (q1.IDX AS IDX) }'digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Nested Loop Join
    FLATMAP (q2.IDX AS IDX)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDX)" ]; 2 [ label=<
    Value Computation
    FIRST $q10 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS X)" ]; - 3 [ label=<
    Value Computation
    MAP (q43.X AS X)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS X)" ]; - 4 [ label=<
    Predicate Filter
    WHERE q6.IDA EQUALS promote(@c15 AS INT)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDA, )" ]; - 5 [ label=<
    Type Filter
    WHERE record IS [A]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDA, )" ]; + 3 [ label=<
    Value Computation
    MAP (q45.X AS X)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS X)" ]; + 4 [ label=<
    Predicate Filter
    WHERE q6.IDA EQUALS promote(@c15 AS INT)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDA, INT AS X)" ]; + 5 [ label=<
    Type Filter
    WHERE record IS [A]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDA, INT AS X)" ]; 6 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 7 [ label=<
    Primary Storage
    record types: [X, A, B, R]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 8 [ label=<
    Predicate Filter
    WHERE q10 NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDX, )" ]; - 9 [ label=<
    Type Filter
    WHERE record IS [X]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDX, )" ]; + 8 [ label=<
    Predicate Filter
    WHERE q10 NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDX, INT AS Y)" ]; + 9 [ label=<
    Type Filter
    WHERE record IS [X]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDX, INT AS Y)" ]; 10 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 11 [ label=<
    Primary Storage
    record types: [X, A, B, R]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q10> label="q10" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q43> label="q43" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q45> label="q45" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q37> label="q37" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q38> label="q38" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q10> label="q10" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 9 -> 8 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 10 -> 9 [ label=< q53> label="q53" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 10 -> 9 [ label=< q57> label="q57" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 11 -> 10 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 1 [ label=< q2> label="q2" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; { @@ -64,31 +64,31 @@ Y rankDir=LR; 2 -> 8 [ color="red" style="invis" ]; } -}* +}+ m -subquery-tests[EXPLAIN select x from a where exists (select a.x, max(idb) from b where q > a.x group by q)) - (.008;@SCAN(<,>) | TFILTER A | FLATMAP q0 -> { ISCAN(IB [[GREATER_THAN q0.X]]) | MAP (_ AS _0) | AGG (max_i(_._0.IDB) AS _0) GROUP BY (_._0.Q AS _0) | MAP (q0.X AS X, _._1._0 AS _1) | DEFAULT NULL | FILTER _ NOT_NULL AS q0 RETURN (q0.X AS X) }'digraph G { +subquery-tests[EXPLAIN select x from a where exists (select a.x, max(idb) from b where q > a.x group by q)* + (.078;@SCAN(<,>) | TFILTER A | FLATMAP q0 -> { ISCAN(IB [[GREATER_THAN q0.X]]) | MAP (_ AS _0) | AGG (max_i(_._0.IDB) AS _0) GROUP BY (_._0.Q AS _0) | MAP (q0.X AS X, _._1._0 AS _1) | DEFAULT NULL | FILTER _ NOT_NULL AS q0 RETURN (q0.X AS X) }(digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Nested Loop Join
    FLATMAP (q2.X AS X)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS X)" ]; - 2 [ label=<
    Type Filter
    WHERE record IS [A]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDA, )" ]; + 2 [ label=<
    Type Filter
    WHERE record IS [A]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDA, INT AS X)" ]; 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 4 [ label=<
    Primary Storage
    record types: [X, A, B, R]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q14 NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS X, )" ]; - 6 [ label=<
    Value Computation
    FIRST $q14 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS X, )" ]; - 7 [ label=<
    Value Computation
    MAP (q2.X AS X, q10._1._0 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS X, )" ]; - 8 [ label=<
    Streaming Aggregate
    COLLECT (max_i(q66._0.IDB) AS _0)
    GROUP BY (q66._0.Q AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS _0 AS _0, )" ]; - 9 [ label=<
    Value Computation
    MAP (q6 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDB, AS _0)" ]; - 10 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN q2.X]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDB, )" ]; - 11 [ label=<
    Index
    IB
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDB, )" ]; - 3 -> 2 [ label=< q70> label="q70" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 [ label=<
    Predicate Filter
    WHERE q14 NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS X, INT AS _1)" ]; + 6 [ label=<
    Value Computation
    FIRST $q14 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS X, INT AS _1)" ]; + 7 [ label=<
    Value Computation
    MAP (q2.X AS X, q10._1._0 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS X, INT AS _1)" ]; + 8 [ label=<
    Streaming Aggregate
    COLLECT (max_i(q69._0.IDB) AS _0)
    GROUP BY (q69._0.Q AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS _0 AS _0, INT AS _0 AS _1)" ]; + 9 [ label=<
    Value Computation
    MAP (q6 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDB, INT AS Q, INT AS R AS _0)" ]; + 10 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN q2.X]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDB, INT AS Q, INT AS R)" ]; + 11 [ label=<
    Index
    IB
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDB, INT AS Q, INT AS R)" ]; + 3 -> 2 [ label=< q74> label="q74" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q14> label="q14" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ label=< q14> label="q14" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ label=< q10> label="q10" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 9 -> 8 [ label=< q66> label="q66" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 9 -> 8 [ label=< q69> label="q69" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 10 -> 9 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 11 -> 10 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 1 [ label=< q14> label="q14" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; @@ -97,31 +97,31 @@ m rankDir=LR; 2 -> 5 [ color="red" style="invis" ]; } -}* +}+ i -subquery-testsWEXPLAIN select x from a where exists (select x, max(idb) from b where q > x group by q)) -ާ" (.0~8;@SCAN(<,>) | TFILTER A | FLATMAP q0 -> { ISCAN(IB [[GREATER_THAN q0.X]]) | MAP (_ AS _0) | AGG (max_i(_._0.IDB) AS _0) GROUP BY (_._0.Q AS _0) | MAP (q0.X AS X, _._1._0 AS _1) | DEFAULT NULL | FILTER _ NOT_NULL AS q0 RETURN (q0.X AS X) }'digraph G { +subquery-testsWEXPLAIN select x from a where exists (select x, max(idb) from b where q > x group by q)* + (.0=8;@SCAN(<,>) | TFILTER A | FLATMAP q0 -> { ISCAN(IB [[GREATER_THAN q0.X]]) | MAP (_ AS _0) | AGG (max_i(_._0.IDB) AS _0) GROUP BY (_._0.Q AS _0) | MAP (q0.X AS X, _._1._0 AS _1) | DEFAULT NULL | FILTER _ NOT_NULL AS q0 RETURN (q0.X AS X) }(digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Nested Loop Join
    FLATMAP (q2.X AS X)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS X)" ]; - 2 [ label=<
    Type Filter
    WHERE record IS [A]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDA, )" ]; + 2 [ label=<
    Type Filter
    WHERE record IS [A]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDA, INT AS X)" ]; 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 4 [ label=<
    Primary Storage
    record types: [X, A, B, R]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q14 NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS X, )" ]; - 6 [ label=<
    Value Computation
    FIRST $q14 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS X, )" ]; - 7 [ label=<
    Value Computation
    MAP (q2.X AS X, q10._1._0 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS X, )" ]; - 8 [ label=<
    Streaming Aggregate
    COLLECT (max_i(q66._0.IDB) AS _0)
    GROUP BY (q66._0.Q AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS _0 AS _0, )" ]; - 9 [ label=<
    Value Computation
    MAP (q6 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDB, AS _0)" ]; - 10 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN q2.X]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDB, )" ]; - 11 [ label=<
    Index
    IB
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDB, )" ]; - 3 -> 2 [ label=< q70> label="q70" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 [ label=<
    Predicate Filter
    WHERE q14 NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS X, INT AS _1)" ]; + 6 [ label=<
    Value Computation
    FIRST $q14 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS X, INT AS _1)" ]; + 7 [ label=<
    Value Computation
    MAP (q2.X AS X, q10._1._0 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS X, INT AS _1)" ]; + 8 [ label=<
    Streaming Aggregate
    COLLECT (max_i(q69._0.IDB) AS _0)
    GROUP BY (q69._0.Q AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS _0 AS _0, INT AS _0 AS _1)" ]; + 9 [ label=<
    Value Computation
    MAP (q6 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDB, INT AS Q, INT AS R AS _0)" ]; + 10 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN q2.X]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDB, INT AS Q, INT AS R)" ]; + 11 [ label=<
    Index
    IB
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDB, INT AS Q, INT AS R)" ]; + 3 -> 2 [ label=< q74> label="q74" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q14> label="q14" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ label=< q14> label="q14" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ label=< q10> label="q10" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 9 -> 8 [ label=< q66> label="q66" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 9 -> 8 [ label=< q69> label="q69" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 10 -> 9 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 11 -> 10 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 1 [ label=< q14> label="q14" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; @@ -130,31 +130,31 @@ i rankDir=LR; 2 -> 5 [ color="red" style="invis" ]; } -}+ +}, n -subquery-tests\EXPLAIN select x from a where exists (select max(x), max(idb) from b where q > x group by q)* - ʐ(.08;@SCAN(<,>) | TFILTER A | FLATMAP q0 -> { ISCAN(IB [[GREATER_THAN q0.X]]) | MAP (_ AS _0) | AGG (max_i(q0.X) AS _0, max_i(_._0.IDB) AS _1) GROUP BY (_._0.Q AS _0) | MAP (_._1._0 AS _0, _._1._1 AS _1) | DEFAULT NULL | FILTER _ NOT_NULL AS q0 RETURN (q0.X AS X) }(digraph G { +subquery-tests\EXPLAIN select x from a where exists (select max(x), max(idb) from b where q > x group by q)+ +  (.0L8;@SCAN(<,>) | TFILTER A | FLATMAP q0 -> { ISCAN(IB [[GREATER_THAN q0.X]]) | MAP (_ AS _0) | AGG (max_i(q0.X) AS _0, max_i(_._0.IDB) AS _1) GROUP BY (_._0.Q AS _0) | MAP (_._1._0 AS _0, _._1._1 AS _1) | DEFAULT NULL | FILTER _ NOT_NULL AS q0 RETURN (q0.X AS X) }(digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Nested Loop Join
    FLATMAP (q2.X AS X)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS X)" ]; - 2 [ label=<
    Type Filter
    WHERE record IS [A]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDA, )" ]; + 2 [ label=<
    Type Filter
    WHERE record IS [A]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDA, INT AS X)" ]; 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 4 [ label=<
    Primary Storage
    record types: [X, A, B, R]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q14 NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS _0, )" ]; - 6 [ label=<
    Value Computation
    FIRST $q14 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS _0, )" ]; - 7 [ label=<
    Value Computation
    MAP (q10._1._0 AS _0, q10._1._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS _0, )" ]; - 8 [ label=<
    Streaming Aggregate
    COLLECT (max_i(q2.X) AS _0, max_i(q66._0.IDB) AS _1)
    GROUP BY (q66._0.Q AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS _0 AS _0, )" ]; - 9 [ label=<
    Value Computation
    MAP (q6 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDB, AS _0)" ]; - 10 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN q2.X]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDB, )" ]; - 11 [ label=<
    Index
    IB
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDB, )" ]; - 3 -> 2 [ label=< q70> label="q70" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 [ label=<
    Predicate Filter
    WHERE q14 NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS _0, INT AS _1)" ]; + 6 [ label=<
    Value Computation
    FIRST $q14 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS _0, INT AS _1)" ]; + 7 [ label=<
    Value Computation
    MAP (q10._1._0 AS _0, q10._1._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS _0, INT AS _1)" ]; + 8 [ label=<
    Streaming Aggregate
    COLLECT (max_i(q2.X) AS _0, max_i(q69._0.IDB) AS _1)
    GROUP BY (q69._0.Q AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS _0 AS _0, INT AS _0, INT AS _1 AS _1)" ]; + 9 [ label=<
    Value Computation
    MAP (q6 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDB, INT AS Q, INT AS R AS _0)" ]; + 10 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN q2.X]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDB, INT AS Q, INT AS R)" ]; + 11 [ label=<
    Index
    IB
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDB, INT AS Q, INT AS R)" ]; + 3 -> 2 [ label=< q74> label="q74" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q14> label="q14" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ label=< q14> label="q14" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ label=< q10> label="q10" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 9 -> 8 [ label=< q66> label="q66" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 9 -> 8 [ label=< q69> label="q69" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 10 -> 9 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 11 -> 10 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 1 [ label=< q14> label="q14" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; @@ -163,31 +163,31 @@ n rankDir=LR; 2 -> 5 [ color="red" style="invis" ]; } -}+ +}, p -subquery-tests^EXPLAIN select x from a where exists (select max(a.x), max(idb) from b where q > x group by q)* -҈ (.0\8;@SCAN(<,>) | TFILTER A | FLATMAP q0 -> { ISCAN(IB [[GREATER_THAN q0.X]]) | MAP (_ AS _0) | AGG (max_i(q0.X) AS _0, max_i(_._0.IDB) AS _1) GROUP BY (_._0.Q AS _0) | MAP (_._1._0 AS _0, _._1._1 AS _1) | DEFAULT NULL | FILTER _ NOT_NULL AS q0 RETURN (q0.X AS X) }(digraph G { +subquery-tests^EXPLAIN select x from a where exists (select max(a.x), max(idb) from b where q > x group by q)+ +Ϩ ه(.0:8;@SCAN(<,>) | TFILTER A | FLATMAP q0 -> { ISCAN(IB [[GREATER_THAN q0.X]]) | MAP (_ AS _0) | AGG (max_i(q0.X) AS _0, max_i(_._0.IDB) AS _1) GROUP BY (_._0.Q AS _0) | MAP (_._1._0 AS _0, _._1._1 AS _1) | DEFAULT NULL | FILTER _ NOT_NULL AS q0 RETURN (q0.X AS X) }(digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Nested Loop Join
    FLATMAP (q2.X AS X)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS X)" ]; - 2 [ label=<
    Type Filter
    WHERE record IS [A]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDA, )" ]; + 2 [ label=<
    Type Filter
    WHERE record IS [A]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDA, INT AS X)" ]; 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 4 [ label=<
    Primary Storage
    record types: [X, A, B, R]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 5 [ label=<
    Predicate Filter
    WHERE q14 NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS _0, )" ]; - 6 [ label=<
    Value Computation
    FIRST $q14 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS _0, )" ]; - 7 [ label=<
    Value Computation
    MAP (q10._1._0 AS _0, q10._1._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS _0, )" ]; - 8 [ label=<
    Streaming Aggregate
    COLLECT (max_i(q2.X) AS _0, max_i(q66._0.IDB) AS _1)
    GROUP BY (q66._0.Q AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS _0 AS _0, )" ]; - 9 [ label=<
    Value Computation
    MAP (q6 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDB, AS _0)" ]; - 10 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN q2.X]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDB, )" ]; - 11 [ label=<
    Index
    IB
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDB, )" ]; - 3 -> 2 [ label=< q70> label="q70" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 [ label=<
    Predicate Filter
    WHERE q14 NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS _0, INT AS _1)" ]; + 6 [ label=<
    Value Computation
    FIRST $q14 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS _0, INT AS _1)" ]; + 7 [ label=<
    Value Computation
    MAP (q10._1._0 AS _0, q10._1._1 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS _0, INT AS _1)" ]; + 8 [ label=<
    Streaming Aggregate
    COLLECT (max_i(q2.X) AS _0, max_i(q69._0.IDB) AS _1)
    GROUP BY (q69._0.Q AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS _0 AS _0, INT AS _0, INT AS _1 AS _1)" ]; + 9 [ label=<
    Value Computation
    MAP (q6 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDB, INT AS Q, INT AS R AS _0)" ]; + 10 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN q2.X]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDB, INT AS Q, INT AS R)" ]; + 11 [ label=<
    Index
    IB
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS IDB, INT AS Q, INT AS R)" ]; + 3 -> 2 [ label=< q74> label="q74" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q14> label="q14" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ label=< q14> label="q14" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ label=< q10> label="q10" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 9 -> 8 [ label=< q66> label="q66" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 9 -> 8 [ label=< q69> label="q69" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 10 -> 9 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 11 -> 10 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 1 [ label=< q14> label="q14" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; diff --git a/yaml-tests/src/test/resources/subquery-tests.metrics.yaml b/yaml-tests/src/test/resources/subquery-tests.metrics.yaml index 0d5d84ce1c..5ef3255027 100644 --- a/yaml-tests/src/test/resources/subquery-tests.metrics.yaml +++ b/yaml-tests/src/test/resources/subquery-tests.metrics.yaml @@ -4,11 +4,11 @@ subquery-tests: (_.IDA AS IDA) | DEFAULT NULL | FLATMAP q0 -> { SCAN(<,>) | TFILTER A | FILTER q0 NOT_NULL AS q1 RETURN (q1.IDA AS IDA) } task_count: 660 - task_total_time_ms: 92 - transform_count: 187 - transform_time_ms: 38 + task_total_time_ms: 34 + transform_count: 195 + transform_time_ms: 7 transform_yield_count: 41 - insert_time_ms: 3 + insert_time_ms: 1 insert_new_count: 72 insert_reused_count: 5 - query: EXPLAIN select idx from x where exists (select x from a where ida = 1); @@ -16,11 +16,11 @@ subquery-tests: (_.X AS X) | DEFAULT NULL | FLATMAP q0 -> { SCAN(<,>) | TFILTER X | FILTER q0 NOT_NULL AS q1 RETURN (q1.IDX AS IDX) } task_count: 688 - task_total_time_ms: 157 - transform_count: 195 - transform_time_ms: 86 + task_total_time_ms: 29 + transform_count: 204 + transform_time_ms: 7 transform_yield_count: 46 - insert_time_ms: 4 + insert_time_ms: 1 insert_new_count: 75 insert_reused_count: 5 - query: EXPLAIN select x from a where exists (select a.x, max(idb) from b where @@ -30,9 +30,9 @@ subquery-tests: (q0.X AS X, _._1._0 AS _1) | DEFAULT NULL | FILTER _ NOT_NULL AS q0 RETURN (q0.X AS X) } task_count: 612 - task_total_time_ms: 34 - transform_count: 175 - transform_time_ms: 19 + task_total_time_ms: 33 + transform_count: 182 + transform_time_ms: 15 transform_yield_count: 46 insert_time_ms: 0 insert_new_count: 59 @@ -44,11 +44,11 @@ subquery-tests: (q0.X AS X, _._1._0 AS _1) | DEFAULT NULL | FILTER _ NOT_NULL AS q0 RETURN (q0.X AS X) } task_count: 612 - task_total_time_ms: 71 - transform_count: 175 - transform_time_ms: 18 + task_total_time_ms: 33 + transform_count: 182 + transform_time_ms: 10 transform_yield_count: 46 - insert_time_ms: 2 + insert_time_ms: 1 insert_new_count: 59 insert_reused_count: 3 - query: EXPLAIN select x from a where exists (select max(x), max(idb) from b where @@ -58,11 +58,11 @@ subquery-tests: (_._0.Q AS _0) | MAP (_._1._0 AS _0, _._1._1 AS _1) | DEFAULT NULL | FILTER _ NOT_NULL AS q0 RETURN (q0.X AS X) } task_count: 612 - task_total_time_ms: 39 - transform_count: 175 - transform_time_ms: 17 + task_total_time_ms: 27 + transform_count: 182 + transform_time_ms: 11 transform_yield_count: 46 - insert_time_ms: 2 + insert_time_ms: 1 insert_new_count: 59 insert_reused_count: 3 - query: EXPLAIN select x from a where exists (select max(a.x), max(idb) from b @@ -72,10 +72,10 @@ subquery-tests: (_._0.Q AS _0) | MAP (_._1._0 AS _0, _._1._1 AS _1) | DEFAULT NULL | FILTER _ NOT_NULL AS q0 RETURN (q0.X AS X) } task_count: 612 - task_total_time_ms: 39 - transform_count: 175 - transform_time_ms: 15 + task_total_time_ms: 34 + transform_count: 182 + transform_time_ms: 10 transform_yield_count: 46 - insert_time_ms: 1 + insert_time_ms: 0 insert_new_count: 59 insert_reused_count: 3 diff --git a/yaml-tests/src/test/resources/table-functions.metrics.binpb b/yaml-tests/src/test/resources/table-functions.metrics.binpb index c658a64bab..578386b5f1 100644 Binary files a/yaml-tests/src/test/resources/table-functions.metrics.binpb and b/yaml-tests/src/test/resources/table-functions.metrics.binpb differ diff --git a/yaml-tests/src/test/resources/table-functions.metrics.yaml b/yaml-tests/src/test/resources/table-functions.metrics.yaml index a81567f64f..0422b248f9 100644 --- a/yaml-tests/src/test/resources/table-functions.metrics.yaml +++ b/yaml-tests/src/test/resources/table-functions.metrics.yaml @@ -18,7 +18,7 @@ table-functions: AS Y, @c19 AS Z) AS W), (@c24 AS B, @c26 AS C, (@c29 AS X, @c31 AS Y, @c33 AS Z) AS W)) | MAP (_.B AS B, _.C AS C, _.W AS W) task_count: 116 - task_total_time_ms: 1 + task_total_time_ms: 0 transform_count: 30 transform_time_ms: 0 transform_yield_count: 6 @@ -72,9 +72,9 @@ table-functions: AS Z) AS W)) | FILTER _.B LESS_THAN @c68 | MAP (_.B AS B, _.C AS Q, _.W.X AS X) task_count: 186 - task_total_time_ms: 3 + task_total_time_ms: 2 transform_count: 60 - transform_time_ms: 1 + transform_time_ms: 0 transform_yield_count: 11 insert_time_ms: 0 insert_new_count: 21 @@ -104,7 +104,7 @@ table-functions: - query: EXPLAIN select ID as X from range(3) as Y explain: TF range(0l, promote(@c8 AS LONG), STEP 1l) | MAP (_.ID AS X) task_count: 116 - task_total_time_ms: 1 + task_total_time_ms: 0 transform_count: 30 transform_time_ms: 0 transform_yield_count: 6 @@ -127,10 +127,10 @@ table-functions: explain: SCAN(<,>) | FLATMAP q0 -> { TF range(0l, q0.ID, STEP 1l) AS q1 RETURN (q0.ID AS X, q0.COL1 AS Y, q1.ID AS Z) } task_count: 160 - task_total_time_ms: 2 - transform_count: 49 + task_total_time_ms: 5 + transform_count: 51 transform_time_ms: 0 transform_yield_count: 13 - insert_time_ms: 0 + insert_time_ms: 1 insert_new_count: 15 insert_reused_count: 0 diff --git a/yaml-tests/src/test/resources/union-empty-tables.metrics.binpb b/yaml-tests/src/test/resources/union-empty-tables.metrics.binpb index de139de30c..1eb15b9be5 100644 --- a/yaml-tests/src/test/resources/union-empty-tables.metrics.binpb +++ b/yaml-tests/src/test/resources/union-empty-tables.metrics.binpb @@ -1,430 +1,428 @@ - + A - unnamed-14EXPLAIN select sum(col1) as a, count(*) as b from t1 -䟌@ y(08@SCAN(<,>) | TFILTER T1 | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0, count_star(*) AS _1) | ON EMPTY NULL | MAP (_._0._0 AS A, coalesce_long(_._0._1, promote(0l AS LONG)) AS B)digraph G { + unnamed-14EXPLAIN select sum(col1) as a, count(*) as b from t1 +ۏD 6(08@SCAN(<,>) | TFILTER T1 | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0, count_star(*) AS _1) | ON EMPTY NULL | MAP (_._0._0 AS A, coalesce_long(_._0._1, promote(0l AS LONG)) AS B)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS A, coalesce_long(q6._0._1, promote(0l AS LONG)) AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, )" ]; - 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q34._0.COL1) AS _0, count_star(*) AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 5 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q6._0._0 AS A, coalesce_long(q6._0._1, promote(0l AS LONG)) AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B)" ]; + 2 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1 AS _0)" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q37._0.COL1) AS _0, count_star(*) AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 5 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 6 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 7 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q34> label="q34" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q37> label="q37" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q25> label="q25" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}J +}L  - unnamed-1EXPLAIN select sum(a) as a, sum(b) as b from (select sum(col1) as a, count(*) as b from t1 union all select sum(col1) as a, count(*) as b from t2) as xI -  Ŷ(*0δ58@@SCAN(<,>) | TFILTER T1 | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0, count_star(*) AS _1) | ON EMPTY NULL | MAP (_._0._0 AS A, coalesce_long(_._0._1, promote(0l AS LONG)) AS B) ⊎ SCAN(<,>) | TFILTER T2 | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0, count_star(*) AS _1) | ON EMPTY NULL | MAP (_._0._0 AS A, coalesce_long(_._0._1, promote(0l AS LONG)) AS B) | MAP (_ AS _0) | AGG (sum_l(_._0.A) AS _0, sum_l(_._0.B) AS _1) | ON EMPTY NULL | MAP (_._0._0 AS A, _._0._1 AS B)Edigraph G { + unnamed-1EXPLAIN select sum(a) as a, sum(b) as b from (select sum(col1) as a, count(*) as b from t1 union all select sum(col1) as a, count(*) as b from t2) as xK + (*08@@SCAN(<,>) | TFILTER T1 | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0, count_star(*) AS _1) | ON EMPTY NULL | MAP (_._0._0 AS A, coalesce_long(_._0._1, promote(0l AS LONG)) AS B) ⊎ SCAN(<,>) | TFILTER T2 | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0, count_star(*) AS _1) | ON EMPTY NULL | MAP (_._0._0 AS A, coalesce_long(_._0._1, promote(0l AS LONG)) AS B) | MAP (_ AS _0) | AGG (sum_l(_._0.A) AS _0, sum_l(_._0.B) AS _1) | ON EMPTY NULL | MAP (_._0._0 AS A, _._0._1 AS B)Gdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q24._0._0 AS A, q24._0._1 AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, )" ]; - 2 [ label=<
    Value Computation
    $q24 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q91._0.A) AS _0, sum_l(q91._0.B) AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q20 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, AS _0)" ]; - 5 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS A, )" ]; - 6 [ label=<
    Value Computation
    MAP (q6._0._0 AS A, coalesce_long(q6._0._1, promote(0l AS LONG)) AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, )" ]; - 7 [ label=<
    Value Computation
    MAP (q16._0._0 AS A, coalesce_long(q16._0._1, promote(0l AS LONG)) AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, )" ]; - 8 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, AS _0)" ]; - 9 [ label=<
    Value Computation
    $q16 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, AS _0)" ]; - 10 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q82._0.COL1) AS _0, count_star(*) AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, AS _0)" ]; - 11 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q67._0.COL1) AS _0, count_star(*) AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, AS _0)" ]; - 12 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 13 [ label=<
    Value Computation
    MAP (q12 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 14 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 15 [ label=<
    Type Filter
    WHERE record IS [T2]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q24._0._0 AS A, q24._0._1 AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B)" ]; + 2 [ label=<
    Value Computation
    $q24 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1 AS _0)" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q97._0.A) AS _0, sum_l(q97._0.B) AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q20 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B AS _0)" ]; + 5 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS A, LONG AS B)" ]; + 6 [ label=<
    Value Computation
    MAP (q16._0._0 AS A, coalesce_long(q16._0._1, promote(0l AS LONG)) AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B)" ]; + 7 [ label=<
    Value Computation
    MAP (q6._0._0 AS A, coalesce_long(q6._0._1, promote(0l AS LONG)) AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B)" ]; + 8 [ label=<
    Value Computation
    $q16 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1 AS _0)" ]; + 9 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1 AS _0)" ]; + 10 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q70._0.COL1) AS _0, count_star(*) AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1 AS _0)" ]; + 11 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q88._0.COL1) AS _0, count_star(*) AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1 AS _0)" ]; + 12 [ label=<
    Value Computation
    MAP (q12 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3 AS _0)" ]; + 13 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 14 [ label=<
    Type Filter
    WHERE record IS [T2]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 15 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 16 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 17 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 18 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 19 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q91> label="q91" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q97> label="q97" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q20> label="q20" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q86> label="q86" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 5 [ label=< q88> label="q88" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 8 -> 6 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 9 -> 7 [ label=< q16> label="q16" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 10 -> 8 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 11 -> 9 [ label=< q16> label="q16" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 12 -> 10 [ label=< q82> label="q82" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 13 -> 11 [ label=< q67> label="q67" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 14 -> 12 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 15 -> 13 [ label=< q12> label="q12" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 16 -> 14 [ label=< q72> label="q72" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 17 -> 15 [ label=< q57> label="q57" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q94> label="q94" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 5 [ label=< q92> label="q92" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 8 -> 6 [ label=< q16> label="q16" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 9 -> 7 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 10 -> 8 [ label=< q16> label="q16" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 11 -> 9 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 12 -> 10 [ label=< q70> label="q70" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 13 -> 11 [ label=< q88> label="q88" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 14 -> 12 [ label=< q12> label="q12" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 15 -> 13 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 16 -> 14 [ label=< q58> label="q58" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 17 -> 15 [ label=< q76> label="q76" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 18 -> 16 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 19 -> 17 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}! +}! R - unnamed-1EEXPLAIN select col1, col2 from t1 union all select col1, col2 from t1 -P (0 8!@SCAN(<,>) | TFILTER T1 | MAP (_.COL1 AS COL1, _.COL2 AS COL2) ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.COL1 AS COL1, _.COL2 AS COL2)digraph G { + unnamed-1EEXPLAIN select col1, col2 from t1 union all select col1, col2 from t1! +W u(08!@SCAN(<,>) | TFILTER T1 | MAP (_.COL1 AS COL1, _.COL2 AS COL2) ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.COL1 AS COL1, _.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS COL1, )" ]; - 2 [ label=<
    Value Computation
    MAP (q2.COL1 AS COL1, q2.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 3 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS COL1, LONG AS COL2)" ]; + 2 [ label=<
    Value Computation
    MAP (q2.COL1 AS COL1, q2.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 4 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 5 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 6 [ label=<
    Value Computation
    MAP (q8.COL1 AS COL1, q8.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, )" ]; - 7 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 6 [ label=<
    Value Computation
    MAP (q8.COL1 AS COL1, q8.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL1, LONG AS COL2)" ]; + 7 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 8 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 9 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q45> label="q45" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q51> label="q51" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q57> label="q57" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ label=< q8> label="q8" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 8 -> 7 [ label=< q30> label="q30" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 8 -> 7 [ label=< q31> label="q31" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 9 -> 8 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 1 [ label=< q53> label="q53" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 6 -> 1 [ label=< q59> label="q59" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} A - unnamed-14EXPLAIN select * from t1 union all select * from t1; -P 傲(08@1SCAN(<,>) | TFILTER T1 ⊎ SCAN(<,>) | TFILTER T1digraph G { + unnamed-14EXPLAIN select * from t1 union all select * from t1; +БW (08@1SCAN(<,>) | TFILTER T1 ⊎ SCAN(<,>) | TFILTER T1digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, )" ]; - 2 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 2 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 4 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 5 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 5 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 6 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 7 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q39> label="q39" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 3 -> 2 [ label=< q43> label="q43" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q47> label="q47" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q30> label="q30" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q53> label="q53" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q31> label="q31" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 1 [ label=< q49> label="q49" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 5 -> 1 [ label=< q55> label="q55" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} N - unnamed-1AEXPLAIN select * from t1 union all select id, col1, col2 from t1; -U Š(0Ǿ8!@dSCAN(<,>) | TFILTER T1 ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)digraph G { + unnamed-1AEXPLAIN select * from t1 union all select id, col1, col2 from t1; +Ʒ\ (08!@dSCAN(<,>) | TFILTER T1 ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, )" ]; - 2 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 2 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 4 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 5 [ label=<
    Value Computation
    MAP (q8.ID AS ID, q8.COL1 AS COL1, q8.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 5 [ label=<
    Value Computation
    MAP (q8.ID AS ID, q8.COL1 AS COL1, q8.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 7 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 8 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q40> label="q40" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 3 -> 2 [ label=< q44> label="q44" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q48> label="q48" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q54> label="q54" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q8> label="q8" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q30> label="q30" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 6 [ label=< q31> label="q31" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 1 [ label=< q50> label="q50" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 5 -> 1 [ label=< q56> label="q56" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} N - unnamed-1AEXPLAIN select id, col1, col2 from t1 union all select * from t1; -U (0ܝ8!@dSCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) ⊎ SCAN(<,>) | TFILTER T1digraph G { + unnamed-1AEXPLAIN select id, col1, col2 from t1 union all select * from t1; +\ y(0Ȣ 8!@dSCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) ⊎ SCAN(<,>) | TFILTER T1digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, )" ]; - 2 [ label=<
    Value Computation
    MAP (q2.ID AS ID, q2.COL1 AS COL1, q2.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 2 [ label=<
    Value Computation
    MAP (q2.ID AS ID, q2.COL1 AS COL1, q2.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 4 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 5 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 6 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 7 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 8 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q39> label="q39" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q43> label="q43" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q48> label="q48" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 6 [ label=< q30> label="q30" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q54> label="q54" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 6 [ label=< q31> label="q31" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 1 [ label=< q50> label="q50" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}% + 6 -> 1 [ label=< q56> label="q56" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}& ] - unnamed-1PEXPLAIN select id as W, col1 as X, col2 as Y from t1 union all select * from t1;$ -v (08'@SCAN(<,>) | TFILTER T1 | MAP (_.ID AS W, _.COL1 AS X, _.COL2 AS Y) | MAP (_.W AS W, _.X AS X, _.Y AS Y) ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)#digraph G { + unnamed-1PEXPLAIN select id as W, col1 as X, col2 as Y from t1 union all select * from t1;% +؝} (08'@SCAN(<,>) | TFILTER T1 | MAP (_.ID AS W, _.COL1 AS X, _.COL2 AS Y) | MAP (_.W AS W, _.X AS X, _.Y AS Y) ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)$digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS W, )" ]; - 2 [ label=<
    Value Computation
    MAP (q6.W AS W, q6.X AS X, q6.Y AS Y)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS W, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2.ID AS W, q2.COL1 AS X, q2.COL2 AS Y)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS W, )" ]; - 4 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS W, LONG AS X, LONG AS Y)" ]; + 2 [ label=<
    Value Computation
    MAP (q6.W AS W, q6.X AS X, q6.Y AS Y)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS W, LONG AS X, LONG AS Y)" ]; + 3 [ label=<
    Value Computation
    MAP (q2.ID AS W, q2.COL1 AS X, q2.COL2 AS Y)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS W, LONG AS X, LONG AS Y)" ]; + 4 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 5 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 6 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 7 [ label=<
    Value Computation
    MAP (q12.ID AS ID, q12.COL1 AS COL1, q12.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 8 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 7 [ label=<
    Value Computation
    MAP (q12.ID AS ID, q12.COL1 AS COL1, q12.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 8 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 9 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 10 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q46> label="q46" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q50> label="q50" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q57> label="q57" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q63> label="q63" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ label=< q12> label="q12" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 9 -> 8 [ label=< q36> label="q36" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 9 -> 8 [ label=< q37> label="q37" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 10 -> 9 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 1 [ label=< q59> label="q59" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}% + 7 -> 1 [ label=< q65> label="q65" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}& _ - unnamed-1REXPLAIN (select id as W, col1 as X, col2 as Y from t1) union all select * from t1;$ -v ܳ(0(8'@SCAN(<,>) | TFILTER T1 | MAP (_.ID AS W, _.COL1 AS X, _.COL2 AS Y) | MAP (_.W AS W, _.X AS X, _.Y AS Y) ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)#digraph G { + unnamed-1REXPLAIN (select id as W, col1 as X, col2 as Y from t1) union all select * from t1;% +} (08'@SCAN(<,>) | TFILTER T1 | MAP (_.ID AS W, _.COL1 AS X, _.COL2 AS Y) | MAP (_.W AS W, _.X AS X, _.Y AS Y) ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)$digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS W, )" ]; - 2 [ label=<
    Value Computation
    MAP (q6.W AS W, q6.X AS X, q6.Y AS Y)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS W, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2.ID AS W, q2.COL1 AS X, q2.COL2 AS Y)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS W, )" ]; - 4 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS W, LONG AS X, LONG AS Y)" ]; + 2 [ label=<
    Value Computation
    MAP (q6.W AS W, q6.X AS X, q6.Y AS Y)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS W, LONG AS X, LONG AS Y)" ]; + 3 [ label=<
    Value Computation
    MAP (q2.ID AS W, q2.COL1 AS X, q2.COL2 AS Y)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS W, LONG AS X, LONG AS Y)" ]; + 4 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 5 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 6 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 7 [ label=<
    Value Computation
    MAP (q12.ID AS ID, q12.COL1 AS COL1, q12.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 8 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 7 [ label=<
    Value Computation
    MAP (q12.ID AS ID, q12.COL1 AS COL1, q12.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 8 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 9 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 10 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q46> label="q46" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q50> label="q50" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q57> label="q57" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q63> label="q63" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ label=< q12> label="q12" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 9 -> 8 [ label=< q36> label="q36" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 9 -> 8 [ label=< q37> label="q37" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 10 -> 9 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 1 [ label=< q59> label="q59" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}% + 7 -> 1 [ label=< q65> label="q65" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}& _ - unnamed-1REXPLAIN select id as W, col1 as X, col2 as Y from t1 union all (select * from t1);$ -v (0!8'@SCAN(<,>) | TFILTER T1 | MAP (_.ID AS W, _.COL1 AS X, _.COL2 AS Y) | MAP (_.W AS W, _.X AS X, _.Y AS Y) ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)#digraph G { + unnamed-1REXPLAIN select id as W, col1 as X, col2 as Y from t1 union all (select * from t1);% +} ȟ(0ב8'@SCAN(<,>) | TFILTER T1 | MAP (_.ID AS W, _.COL1 AS X, _.COL2 AS Y) | MAP (_.W AS W, _.X AS X, _.Y AS Y) ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)$digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS W, )" ]; - 2 [ label=<
    Value Computation
    MAP (q6.W AS W, q6.X AS X, q6.Y AS Y)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS W, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2.ID AS W, q2.COL1 AS X, q2.COL2 AS Y)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS W, )" ]; - 4 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS W, LONG AS X, LONG AS Y)" ]; + 2 [ label=<
    Value Computation
    MAP (q6.W AS W, q6.X AS X, q6.Y AS Y)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS W, LONG AS X, LONG AS Y)" ]; + 3 [ label=<
    Value Computation
    MAP (q2.ID AS W, q2.COL1 AS X, q2.COL2 AS Y)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS W, LONG AS X, LONG AS Y)" ]; + 4 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 5 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 6 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 7 [ label=<
    Value Computation
    MAP (q12.ID AS ID, q12.COL1 AS COL1, q12.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 8 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 7 [ label=<
    Value Computation
    MAP (q12.ID AS ID, q12.COL1 AS COL1, q12.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 8 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 9 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 10 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q46> label="q46" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q50> label="q50" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q57> label="q57" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q63> label="q63" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ label=< q12> label="q12" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 9 -> 8 [ label=< q36> label="q36" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 9 -> 8 [ label=< q37> label="q37" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 10 -> 9 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 1 [ label=< q59> label="q59" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}% + 7 -> 1 [ label=< q65> label="q65" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}& a - unnamed-1TEXPLAIN (select id as W, col1 as X, col2 as Y from t1 union all (select * from t1));$ -v ɔ(08'@SCAN(<,>) | TFILTER T1 | MAP (_.ID AS W, _.COL1 AS X, _.COL2 AS Y) | MAP (_.W AS W, _.X AS X, _.Y AS Y) ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)#digraph G { + unnamed-1TEXPLAIN (select id as W, col1 as X, col2 as Y from t1 union all (select * from t1));% +͓} (08'@SCAN(<,>) | TFILTER T1 | MAP (_.ID AS W, _.COL1 AS X, _.COL2 AS Y) | MAP (_.W AS W, _.X AS X, _.Y AS Y) ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)$digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS W, )" ]; - 2 [ label=<
    Value Computation
    MAP (q6.W AS W, q6.X AS X, q6.Y AS Y)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS W, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2.ID AS W, q2.COL1 AS X, q2.COL2 AS Y)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS W, )" ]; - 4 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS W, LONG AS X, LONG AS Y)" ]; + 2 [ label=<
    Value Computation
    MAP (q6.W AS W, q6.X AS X, q6.Y AS Y)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS W, LONG AS X, LONG AS Y)" ]; + 3 [ label=<
    Value Computation
    MAP (q2.ID AS W, q2.COL1 AS X, q2.COL2 AS Y)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS W, LONG AS X, LONG AS Y)" ]; + 4 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 5 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 6 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 7 [ label=<
    Value Computation
    MAP (q12.ID AS ID, q12.COL1 AS COL1, q12.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 8 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 7 [ label=<
    Value Computation
    MAP (q12.ID AS ID, q12.COL1 AS COL1, q12.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 8 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 9 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 10 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q46> label="q46" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q50> label="q50" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q57> label="q57" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q63> label="q63" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ label=< q12> label="q12" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 9 -> 8 [ label=< q36> label="q36" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 9 -> 8 [ label=< q37> label="q37" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 10 -> 9 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 1 [ label=< q59> label="q59" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}% + 7 -> 1 [ label=< q65> label="q65" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}& a - unnamed-1TEXPLAIN ((select id as W, col1 as X, col2 as Y from t1) union all select * from t1);$ -v (0֟$8'@SCAN(<,>) | TFILTER T1 | MAP (_.ID AS W, _.COL1 AS X, _.COL2 AS Y) | MAP (_.W AS W, _.X AS X, _.Y AS Y) ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)#digraph G { + unnamed-1TEXPLAIN ((select id as W, col1 as X, col2 as Y from t1) union all select * from t1);% +ۨ} (08'@SCAN(<,>) | TFILTER T1 | MAP (_.ID AS W, _.COL1 AS X, _.COL2 AS Y) | MAP (_.W AS W, _.X AS X, _.Y AS Y) ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)$digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS W, )" ]; - 2 [ label=<
    Value Computation
    MAP (q6.W AS W, q6.X AS X, q6.Y AS Y)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS W, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2.ID AS W, q2.COL1 AS X, q2.COL2 AS Y)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS W, )" ]; - 4 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS W, LONG AS X, LONG AS Y)" ]; + 2 [ label=<
    Value Computation
    MAP (q6.W AS W, q6.X AS X, q6.Y AS Y)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS W, LONG AS X, LONG AS Y)" ]; + 3 [ label=<
    Value Computation
    MAP (q2.ID AS W, q2.COL1 AS X, q2.COL2 AS Y)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS W, LONG AS X, LONG AS Y)" ]; + 4 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 5 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 6 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 7 [ label=<
    Value Computation
    MAP (q12.ID AS ID, q12.COL1 AS COL1, q12.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 8 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 7 [ label=<
    Value Computation
    MAP (q12.ID AS ID, q12.COL1 AS COL1, q12.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 8 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 9 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 10 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q46> label="q46" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q50> label="q50" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q57> label="q57" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q63> label="q63" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ label=< q12> label="q12" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 9 -> 8 [ label=< q36> label="q36" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 9 -> 8 [ label=< q37> label="q37" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 10 -> 9 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 1 [ label=< q59> label="q59" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}) + 7 -> 1 [ label=< q65> label="q65" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}* F - unnamed-19EXPLAIN select a, b from t3 union all select a, b from t4( -  ('0%8,@SCAN(<,>) | TFILTER T3 | MAP (_.A AS A, _.B AS B) | MAP (_.A AS A, promote(_.B AS DOUBLE) AS B) ⊎ SCAN(<,>) | TFILTER T4 | MAP (_.A AS A, _.B AS B) | MAP (promote(_.A AS DOUBLE) AS A, _.B AS B)&digraph G { + unnamed-19EXPLAIN select a, b from t3 union all select a, b from t4) + 쥘('08,@SCAN(<,>) | TFILTER T3 | MAP (_.A AS A, _.B AS B) | MAP (_.A AS A, promote(_.B AS DOUBLE) AS B) ⊎ SCAN(<,>) | TFILTER T4 | MAP (_.A AS A, _.B AS B) | MAP (promote(_.A AS DOUBLE) AS A, _.B AS B)'digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(DOUBLE AS A, )" ]; - 2 [ label=<
    Value Computation
    MAP (q6.A AS A, promote(q6.B AS DOUBLE) AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(DOUBLE AS A, )" ]; - 3 [ label=<
    Value Computation
    MAP (q2.A AS A, q2.B AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(DOUBLE AS A, )" ]; - 4 [ label=<
    Type Filter
    WHERE record IS [T3]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(DOUBLE AS A, DOUBLE AS B)" ]; + 2 [ label=<
    Value Computation
    MAP (q6.A AS A, promote(q6.B AS DOUBLE) AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(DOUBLE AS A, DOUBLE AS B)" ]; + 3 [ label=<
    Value Computation
    MAP (q2.A AS A, q2.B AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(DOUBLE AS A, LONG AS B)" ]; + 4 [ label=<
    Type Filter
    WHERE record IS [T3]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, DOUBLE AS A, LONG AS B)" ]; 5 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 6 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 7 [ label=<
    Value Computation
    MAP (promote(q14.A AS DOUBLE) AS A, q14.B AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(DOUBLE AS A, )" ]; - 8 [ label=<
    Value Computation
    MAP (q10.A AS A, q10.B AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, )" ]; - 9 [ label=<
    Type Filter
    WHERE record IS [T4]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 7 [ label=<
    Value Computation
    MAP (promote(q14.A AS DOUBLE) AS A, q14.B AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(DOUBLE AS A, DOUBLE AS B)" ]; + 8 [ label=<
    Value Computation
    MAP (q10.A AS A, q10.B AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, DOUBLE AS B)" ]; + 9 [ label=<
    Type Filter
    WHERE record IS [T4]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, DOUBLE AS B)" ]; 10 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 11 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q67> label="q67" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q71> label="q71" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 2 -> 1 [ label=< q78> label="q78" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q84> label="q84" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 7 [ label=< q14> label="q14" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 9 -> 8 [ label=< q10> label="q10" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 10 -> 9 [ label=< q55> label="q55" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 10 -> 9 [ label=< q56> label="q56" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 11 -> 10 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 1 [ label=< q80> label="q80" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}9 + 7 -> 1 [ label=< q86> label="q86" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}:  - unnamed-1}EXPLAIN select sum(Y) as S from (select count(*) as Y from t3 where a < 10 group by a union all select count(*) from t4) as X8 -  (7078D@AISCAN(MV10 [[LESS_THAN promote(@c22 AS DOUBLE)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS Y) ⊎ SCAN(<,>) | TFILTER T4 | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) | MAP (_ AS _0) | AGG (sum_l(_._0.Y) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS S)5digraph G { + unnamed-1}EXPLAIN select sum(Y) as S from (select count(*) as Y from t3 where a < 10 group by a union all select count(*) from t4) as X9 +  (70"8D@AISCAN(MV10 [[LESS_THAN promote(@c22 AS DOUBLE)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS Y) ⊎ SCAN(<,>) | TFILTER T4 | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) | MAP (_ AS _0) | AGG (sum_l(_._0.Y) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS S)6digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q26._0._0 AS S)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS S)" ]; 2 [ label=<
    Value Computation
    $q26 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q98._0.Y) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q104._0.Y) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 4 [ label=<
    Value Computation
    MAP (q22 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS Y AS _0)" ]; 5 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS Y)" ]; 6 [ label=<
    Value Computation
    MAP (q6._1 AS Y)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS Y)" ]; 7 [ label=<
    Value Computation
    MAP (coalesce_long(q16._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 8 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[LESS_THAN promote(@c22 AS DOUBLE)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(DOUBLE AS _0, )" ]; + 8 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[LESS_THAN promote(@c22 AS DOUBLE)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(DOUBLE AS _0, LONG AS _1)" ]; 9 [ label=<
    Value Computation
    $q16 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 10 [ label=<
    Index
    MV10
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 10 [ label=<
    Index
    MV10
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, DOUBLE AS A, LONG AS B)" ]; 11 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 12 [ label=<
    Value Computation
    MAP (q12 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 13 [ label=<
    Type Filter
    WHERE record IS [T4]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 12 [ label=<
    Value Computation
    MAP (q12 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, DOUBLE AS B AS _0)" ]; + 13 [ label=<
    Type Filter
    WHERE record IS [T4]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, DOUBLE AS B)" ]; 14 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 15 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q98> label="q98" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q104> label="q104" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q93> label="q93" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 5 [ label=< q95> label="q95" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q99> label="q99" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 5 [ label=< q101> label="q101" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 6 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 9 -> 7 [ label=< q16> label="q16" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 10 -> 8 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 11 -> 9 [ label=< q16> label="q16" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 12 -> 11 [ label=< q80> label="q80" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 12 -> 11 [ label=< q83> label="q83" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 13 -> 12 [ label=< q12> label="q12" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 14 -> 13 [ label=< q70> label="q70" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 14 -> 13 [ label=< q71> label="q71" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 15 -> 14 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}H +}F r - unnamed-1eEXPLAIN select sum(Y) as S from (select count(*) as Y from t3 union all select count(*) from t1) as XG -ƒ  (10/8D@SCAN(<,>) | TFILTER T3 | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS Y) ⊎ SCAN(<,>) | TFILTER T1 | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) | MAP (_ AS _0) | AGG (sum_l(_._0.Y) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS S)Ddigraph G { + unnamed-1eEXPLAIN select sum(Y) as S from (select count(*) as Y from t3 union all select count(*) from t1) as XE +͍ (=0?8Y@AISCAN(MV10 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | AGG sum_l(_._1) GROUP BY () | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS Y) ⊎ SCAN(<,>) | TFILTER T1 | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) | MAP (_ AS _0) | AGG (sum_l(_._0.Y) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS S)Bdigraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q26._0._0 AS S)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS S)" ]; 2 [ label=<
    Value Computation
    $q26 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q104._0.Y) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q131._0.Y) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 4 [ label=<
    Value Computation
    MAP (q22 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS Y AS _0)" ]; 5 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS Y)" ]; 6 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS Y)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS Y)" ]; 7 [ label=<
    Value Computation
    MAP (coalesce_long(q16._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 8 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 9 [ label=<
    Value Computation
    $q16 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 10 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 10 [ label=<
    Value Computation
    MAP ((q4._1 AS _0) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 11 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 12 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 13 [ label=<
    Value Computation
    MAP (q12 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 14 [ label=<
    Type Filter
    WHERE record IS [T3]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 15 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 16 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; + 12 [ label=<
    Streaming Aggregate
    COLLECT sum_l(q105._1)
    GROUP BY ()
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; + 13 [ label=<
    Value Computation
    MAP (q12 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 14 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(DOUBLE AS _0, LONG AS _1)" ]; + 15 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 16 [ label=<
    Index
    MV10
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, DOUBLE AS A, LONG AS B)" ]; 17 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 18 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 19 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q104> label="q104" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q131> label="q131" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q99> label="q99" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 5 [ label=< q101> label="q101" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q126> label="q126" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 5 [ label=< q128> label="q128" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 6 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 9 -> 7 [ label=< q16> label="q16" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 10 -> 8 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 11 -> 9 [ label=< q16> label="q16" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 12 -> 10 [ label=< q95> label="q95" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 13 -> 11 [ label=< q80> label="q80" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 14 -> 12 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 12 -> 10 [ label=< q4> label="q4" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 13 -> 11 [ label=< q83> label="q83" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 14 -> 12 [ label=< q105> label="q105" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 15 -> 13 [ label=< q12> label="q12" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 16 -> 14 [ label=< q85> label="q85" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 17 -> 15 [ label=< q70> label="q70" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 18 -> 16 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 19 -> 17 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 16 -> 14 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 17 -> 15 [ label=< q71> label="q71" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 18 -> 17 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}@ +}A  - unnamed-1xEXPLAIN select col2 from t1 where exists (select a from t3 where col2 <= id union all select b from t4 where col2 <= id)? - ۂ(=08M@SCAN(<,>) | TFILTER T1 | FLATMAP q0 -> { SCAN(<,>) | TFILTER T3 | FILTER _.ID GREATER_THAN_OR_EQUALS q0.COL2 | MAP (_.A AS A) ⊎ SCAN(<,>) | TFILTER T4 | FILTER _.ID GREATER_THAN_OR_EQUALS q0.COL2 | MAP (_.B AS B) | DEFAULT NULL | FILTER _ NOT_NULL AS q1 RETURN (q0.COL2 AS COL2) }) | TFILTER T1 | FLATMAP q0 -> { SCAN(<,>) | TFILTER T3 | FILTER _.ID GREATER_THAN_OR_EQUALS q0.COL2 | MAP (_.A AS A) ⊎ SCAN(<,>) | TFILTER T4 | FILTER _.ID GREATER_THAN_OR_EQUALS q0.COL2 | MAP (_.B AS B) | DEFAULT NULL | FILTER _ NOT_NULL AS q1 RETURN (q0.COL2 AS COL2) }=digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Nested Loop Join
    FLATMAP (q2.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS COL2)" ]; - 2 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 2 [ label=<
    Type Filter
    WHERE record IS [T1]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 4 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 5 [ label=<
    Predicate Filter
    WHERE q22 NOT_NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(DOUBLE AS A)" ]; 6 [ label=<
    Value Computation
    FIRST $q22 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(DOUBLE AS A)" ]; 7 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(DOUBLE AS A)" ]; - 8 [ label=<
    Value Computation
    MAP (q75.B AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(DOUBLE AS B)" ]; - 9 [ label=<
    Value Computation
    MAP (q91.A AS A)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(DOUBLE AS A)" ]; - 10 [ label=<
    Predicate Filter
    WHERE q12.ID GREATER_THAN_OR_EQUALS q2.COL2
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 11 [ label=<
    Predicate Filter
    WHERE q6.ID GREATER_THAN_OR_EQUALS q2.COL2
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 12 [ label=<
    Type Filter
    WHERE record IS [T4]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 13 [ label=<
    Type Filter
    WHERE record IS [T3]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 8 [ label=<
    Value Computation
    MAP (q96.A AS A)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(DOUBLE AS A)" ]; + 9 [ label=<
    Value Computation
    MAP (q77.B AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(DOUBLE AS B)" ]; + 10 [ label=<
    Predicate Filter
    WHERE q6.ID GREATER_THAN_OR_EQUALS q2.COL2
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, DOUBLE AS A, LONG AS B)" ]; + 11 [ label=<
    Predicate Filter
    WHERE q12.ID GREATER_THAN_OR_EQUALS q2.COL2
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, DOUBLE AS B)" ]; + 12 [ label=<
    Type Filter
    WHERE record IS [T3]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, DOUBLE AS A, LONG AS B)" ]; + 13 [ label=<
    Type Filter
    WHERE record IS [T4]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, DOUBLE AS B)" ]; 14 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 15 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 16 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 17 [ label=<
    Primary Storage
    record types: [T4, T5, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q105> label="q105" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 3 -> 2 [ label=< q112> label="q112" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 3 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 5 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 8 -> 7 [ label=< q102> label="q102" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 9 -> 7 [ label=< q100> label="q100" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 10 -> 8 [ label=< q75> label="q75" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 11 -> 9 [ label=< q91> label="q91" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 12 -> 10 [ label=< q12> label="q12" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 13 -> 11 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 14 -> 12 [ label=< q69> label="q69" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 15 -> 13 [ label=< q85> label="q85" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 8 -> 7 [ label=< q106> label="q106" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 9 -> 7 [ label=< q108> label="q108" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 10 -> 8 [ label=< q96> label="q96" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 11 -> 9 [ label=< q77> label="q77" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 12 -> 10 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 13 -> 11 [ label=< q12> label="q12" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 14 -> 12 [ label=< q89> label="q89" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 15 -> 13 [ label=< q70> label="q70" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 16 -> 14 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 17 -> 15 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 1 [ label=< q22> label="q22" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; diff --git a/yaml-tests/src/test/resources/union-empty-tables.metrics.yaml b/yaml-tests/src/test/resources/union-empty-tables.metrics.yaml index 62e81fadec..d5fbb7b5b6 100644 --- a/yaml-tests/src/test/resources/union-empty-tables.metrics.yaml +++ b/yaml-tests/src/test/resources/union-empty-tables.metrics.yaml @@ -4,9 +4,9 @@ unnamed-1: count_star(*) AS _1) | ON EMPTY NULL | MAP (_._0._0 AS A, coalesce_long(_._0._1, promote(0l AS LONG)) AS B) task_count: 260 - task_total_time_ms: 8 - transform_count: 64 - transform_time_ms: 1 + task_total_time_ms: 2 + transform_count: 68 + transform_time_ms: 0 transform_yield_count: 17 insert_time_ms: 0 insert_new_count: 24 @@ -21,9 +21,9 @@ unnamed-1: AGG (sum_l(_._0.A) AS _0, sum_l(_._0.B) AS _1) | ON EMPTY NULL | MAP (_._0._0 AS A, _._0._1 AS B) task_count: 691 - task_total_time_ms: 26 - transform_count: 174 - transform_time_ms: 5 + task_total_time_ms: 15 + transform_count: 182 + transform_time_ms: 3 transform_yield_count: 42 insert_time_ms: 0 insert_new_count: 64 @@ -32,9 +32,9 @@ unnamed-1: explain: SCAN(<,>) | TFILTER T1 | MAP (_.COL1 AS COL1, _.COL2 AS COL2) ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.COL1 AS COL1, _.COL2 AS COL2) task_count: 323 - task_total_time_ms: 15 - transform_count: 80 - transform_time_ms: 3 + task_total_time_ms: 6 + transform_count: 87 + transform_time_ms: 1 transform_yield_count: 25 insert_time_ms: 0 insert_new_count: 33 @@ -42,8 +42,8 @@ unnamed-1: - query: EXPLAIN select * from t1 union all select * from t1; explain: SCAN(<,>) | TFILTER T1 ⊎ SCAN(<,>) | TFILTER T1 task_count: 323 - task_total_time_ms: 9 - transform_count: 80 + task_total_time_ms: 8 + transform_count: 87 transform_time_ms: 2 transform_yield_count: 25 insert_time_ms: 0 @@ -53,9 +53,9 @@ unnamed-1: explain: SCAN(<,>) | TFILTER T1 ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) task_count: 351 - task_total_time_ms: 11 - transform_count: 85 - transform_time_ms: 2 + task_total_time_ms: 16 + transform_count: 92 + transform_time_ms: 9 transform_yield_count: 27 insert_time_ms: 0 insert_new_count: 33 @@ -64,9 +64,9 @@ unnamed-1: explain: SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) ⊎ SCAN(<,>) | TFILTER T1 task_count: 351 - task_total_time_ms: 11 - transform_count: 85 - transform_time_ms: 3 + task_total_time_ms: 8 + transform_count: 92 + transform_time_ms: 1 transform_yield_count: 27 insert_time_ms: 0 insert_new_count: 33 @@ -77,9 +77,9 @@ unnamed-1: MAP (_.W AS W, _.X AS X, _.Y AS Y) ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) task_count: 447 - task_total_time_ms: 17 - transform_count: 118 - transform_time_ms: 3 + task_total_time_ms: 13 + transform_count: 125 + transform_time_ms: 2 transform_yield_count: 29 insert_time_ms: 0 insert_new_count: 39 @@ -90,9 +90,9 @@ unnamed-1: MAP (_.W AS W, _.X AS X, _.Y AS Y) ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) task_count: 447 - task_total_time_ms: 16 - transform_count: 118 - transform_time_ms: 3 + task_total_time_ms: 12 + transform_count: 125 + transform_time_ms: 2 transform_yield_count: 29 insert_time_ms: 0 insert_new_count: 39 @@ -103,9 +103,9 @@ unnamed-1: MAP (_.W AS W, _.X AS X, _.Y AS Y) ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) task_count: 447 - task_total_time_ms: 17 - transform_count: 118 - transform_time_ms: 3 + task_total_time_ms: 12 + transform_count: 125 + transform_time_ms: 2 transform_yield_count: 29 insert_time_ms: 0 insert_new_count: 39 @@ -116,8 +116,8 @@ unnamed-1: MAP (_.W AS W, _.X AS X, _.Y AS Y) ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) task_count: 447 - task_total_time_ms: 9 - transform_count: 118 + task_total_time_ms: 13 + transform_count: 125 transform_time_ms: 2 transform_yield_count: 29 insert_time_ms: 0 @@ -129,9 +129,9 @@ unnamed-1: MAP (_.W AS W, _.X AS X, _.Y AS Y) ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) task_count: 447 - task_total_time_ms: 18 - transform_count: 118 - transform_time_ms: 3 + task_total_time_ms: 9 + transform_count: 125 + transform_time_ms: 2 transform_yield_count: 29 insert_time_ms: 0 insert_new_count: 39 @@ -141,9 +141,9 @@ unnamed-1: AS DOUBLE) AS B) ⊎ SCAN(<,>) | TFILTER T4 | MAP (_.A AS A, _.B AS B) | MAP (promote(_.A AS DOUBLE) AS A, _.B AS B) task_count: 485 - task_total_time_ms: 19 - transform_count: 131 - transform_time_ms: 4 + task_total_time_ms: 10 + transform_count: 139 + transform_time_ms: 2 transform_yield_count: 39 insert_time_ms: 0 insert_new_count: 44 @@ -156,28 +156,29 @@ unnamed-1: promote(0l AS LONG)) AS _0) | MAP (_ AS _0) | AGG (sum_l(_._0.Y) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS S)' task_count: 773 - task_total_time_ms: 29 - transform_count: 220 - transform_time_ms: 9 + task_total_time_ms: 26 + transform_count: 231 + transform_time_ms: 12 transform_yield_count: 55 insert_time_ms: 0 insert_new_count: 68 insert_reused_count: 4 - query: EXPLAIN select sum(Y) as S from (select count(*) as Y from t3 union all select count(*) from t1) as X - explain: SCAN(<,>) | TFILTER T3 | MAP (_ AS _0) | AGG (count_star(*) AS _0) | - ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS Y) ⊎ SCAN(<,>) - | TFILTER T1 | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | - MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) | MAP (_ AS _0) | - AGG (sum_l(_._0.Y) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS S) - task_count: 727 - task_total_time_ms: 18 - transform_count: 188 - transform_time_ms: 5 - transform_yield_count: 49 - insert_time_ms: 0 - insert_new_count: 68 - insert_reused_count: 5 + explain: 'AISCAN(MV10 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | AGG sum_l(_._1) + GROUP BY () | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, + promote(0l AS LONG)) AS Y) ⊎ SCAN(<,>) | TFILTER T1 | MAP (_ AS _0) | AGG + (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l + AS LONG)) AS _0) | MAP (_ AS _0) | AGG (sum_l(_._0.Y) AS _0) | ON EMPTY NULL + | MAP (_._0._0 AS S)' + task_count: 926 + task_total_time_ms: 37 + transform_count: 262 + transform_time_ms: 18 + transform_yield_count: 61 + insert_time_ms: 1 + insert_new_count: 89 + insert_reused_count: 7 - query: EXPLAIN select col2 from t1 where exists (select a from t3 where col2 <= id union all select b from t4 where col2 <= id) explain: SCAN(<,>) | TFILTER T1 | FLATMAP q0 -> { SCAN(<,>) | TFILTER T3 | FILTER @@ -185,10 +186,10 @@ unnamed-1: T4 | FILTER _.ID GREATER_THAN_OR_EQUALS q0.COL2 | MAP (_.B AS B) | DEFAULT NULL | FILTER _ NOT_NULL AS q1 RETURN (q0.COL2 AS COL2) } task_count: 773 - task_total_time_ms: 31 - transform_count: 230 - transform_time_ms: 10 + task_total_time_ms: 32 + transform_count: 241 + transform_time_ms: 8 transform_yield_count: 61 - insert_time_ms: 2 + insert_time_ms: 1 insert_new_count: 77 insert_reused_count: 8 diff --git a/yaml-tests/src/test/resources/union-empty-tables.yamsql b/yaml-tests/src/test/resources/union-empty-tables.yamsql index f79e2092e1..a9eb1748ee 100644 --- a/yaml-tests/src/test/resources/union-empty-tables.yamsql +++ b/yaml-tests/src/test/resources/union-empty-tables.yamsql @@ -82,7 +82,7 @@ test_block: - unorderedResult: [{0}] - - query: select sum(Y) as S from (select count(*) as Y from t3 union all select count(*) from t1) as X - - explain: "SCAN(<,>) | TFILTER T3 | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS Y) ⊎ SCAN(<,>) | TFILTER T1 | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) | MAP (_ AS _0) | AGG (sum_l(_._0.Y) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS S)" + - explain: "AISCAN(MV10 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | AGG sum_l(_._1) GROUP BY () | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS Y) ⊎ SCAN(<,>) | TFILTER T1 | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) | MAP (_ AS _0) | AGG (sum_l(_._0.Y) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS S)" - unorderedResult: [{0}] - - query: select col2 from t1 where exists (select a from t3 where col2 <= id union all select b from t4 where col2 <= id) diff --git a/yaml-tests/src/test/resources/union.metrics.binpb b/yaml-tests/src/test/resources/union.metrics.binpb index 7527b67a5c..e124ad1f3e 100644 --- a/yaml-tests/src/test/resources/union.metrics.binpb +++ b/yaml-tests/src/test/resources/union.metrics.binpb @@ -1,133 +1,131 @@ -G +I  - union-testsEXPLAIN select sum(a) as a, sum(b) as b from (select sum(col1) as a, count(*) as b from t1 union all select sum(col1) as a, count(*) as b from t2) as xE -  (5088L@ISCAN(VI1 <,>) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0, count_star(*) AS _1) | ON EMPTY NULL | MAP (_._0._0 AS A, coalesce_long(_._0._1, promote(0l AS LONG)) AS B) ⊎ SCAN(<,>) | TFILTER T2 | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0, count_star(*) AS _1) | ON EMPTY NULL | MAP (_._0._0 AS A, coalesce_long(_._0._1, promote(0l AS LONG)) AS B) | MAP (_ AS _0) | AGG (sum_l(_._0.A) AS _0, sum_l(_._0.B) AS _1) | ON EMPTY NULL | MAP (_._0._0 AS A, _._0._1 AS B)Adigraph G { + union-testsEXPLAIN select sum(a) as a, sum(b) as b from (select sum(col1) as a, count(*) as b from t1 union all select sum(col1) as a, count(*) as b from t2) as xG + (508L@ISCAN(VI1 <,>) | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0, count_star(*) AS _1) | ON EMPTY NULL | MAP (_._0._0 AS A, coalesce_long(_._0._1, promote(0l AS LONG)) AS B) ⊎ SCAN(<,>) | TFILTER T2 | MAP (_ AS _0) | AGG (sum_l(_._0.COL1) AS _0, count_star(*) AS _1) | ON EMPTY NULL | MAP (_._0._0 AS A, coalesce_long(_._0._1, promote(0l AS LONG)) AS B) | MAP (_ AS _0) | AGG (sum_l(_._0.A) AS _0, sum_l(_._0.B) AS _1) | ON EMPTY NULL | MAP (_._0._0 AS A, _._0._1 AS B)Cdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (q24._0._0 AS A, q24._0._1 AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, )" ]; - 2 [ label=<
    Value Computation
    $q24 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q111._0.A) AS _0, sum_l(q111._0.B) AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, AS _0)" ]; - 4 [ label=<
    Value Computation
    MAP (q20 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, AS _0)" ]; - 5 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS A, )" ]; - 6 [ label=<
    Value Computation
    MAP (q6._0._0 AS A, coalesce_long(q6._0._1, promote(0l AS LONG)) AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, )" ]; - 7 [ label=<
    Value Computation
    MAP (q16._0._0 AS A, coalesce_long(q16._0._1, promote(0l AS LONG)) AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, )" ]; - 8 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, AS _0)" ]; - 9 [ label=<
    Value Computation
    $q16 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, AS _0)" ]; - 10 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q102._0.COL1) AS _0, count_star(*) AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, AS _0)" ]; - 11 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q73._0.COL1) AS _0, count_star(*) AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, AS _0)" ]; - 12 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 13 [ label=<
    Value Computation
    MAP (q12 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 14 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 15 [ label=<
    Type Filter
    WHERE record IS [T2]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 16 [ label=<
    Index
    VI1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (q24._0._0 AS A, q24._0._1 AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B)" ]; + 2 [ label=<
    Value Computation
    $q24 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1 AS _0)" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q120._0.A) AS _0, sum_l(q120._0.B) AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1 AS _0)" ]; + 4 [ label=<
    Value Computation
    MAP (q20 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B AS _0)" ]; + 5 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS A, LONG AS B)" ]; + 6 [ label=<
    Value Computation
    MAP (q6._0._0 AS A, coalesce_long(q6._0._1, promote(0l AS LONG)) AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B)" ]; + 7 [ label=<
    Value Computation
    MAP (q16._0._0 AS A, coalesce_long(q16._0._1, promote(0l AS LONG)) AS B)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, LONG AS B)" ]; + 8 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1 AS _0)" ]; + 9 [ label=<
    Value Computation
    $q16 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1 AS _0)" ]; + 10 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q111._0.COL1) AS _0, count_star(*) AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1 AS _0)" ]; + 11 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q76._0.COL1) AS _0, count_star(*) AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0, LONG AS _1 AS _0)" ]; + 12 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 13 [ label=<
    Value Computation
    MAP (q12 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3 AS _0)" ]; + 14 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 15 [ label=<
    Type Filter
    WHERE record IS [T2]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2, LONG AS COL3)" ]; + 16 [ label=<
    Index
    VI1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 17 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 18 [ label=<
    Primary Storage
    record types: [T4, T5, T6, T7, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q111> label="q111" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q120> label="q120" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q20> label="q20" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q106> label="q106" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 5 [ label=< q108> label="q108" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q115> label="q115" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 5 [ label=< q117> label="q117" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 6 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 9 -> 7 [ label=< q16> label="q16" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 10 -> 8 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 11 -> 9 [ label=< q16> label="q16" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 12 -> 10 [ label=< q102> label="q102" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 13 -> 11 [ label=< q73> label="q73" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 12 -> 10 [ label=< q111> label="q111" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 13 -> 11 [ label=< q76> label="q76" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 14 -> 12 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 15 -> 13 [ label=< q12> label="q12" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 16 -> 14 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 17 -> 15 [ label=< q63> label="q63" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 17 -> 15 [ label=< q64> label="q64" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 18 -> 17 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q24> label="q24" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}9 +}:  - union-tests}EXPLAIN select sum(Y) as S from (select count(*) as Y from t3 where a < 10 group by a union all select count(*) from t4) as X8 - (70'8D@AISCAN(MV10 [[LESS_THAN promote(@c22 AS DOUBLE)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS Y) ⊎ SCAN(<,>) | TFILTER T4 | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) | MAP (_ AS _0) | AGG (sum_l(_._0.Y) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS S)5digraph G { + union-tests}EXPLAIN select sum(Y) as S from (select count(*) as Y from t3 where a < 10 group by a union all select count(*) from t4) as X9 + (70ݞ(8D@AISCAN(MV10 [[LESS_THAN promote(@c22 AS DOUBLE)]] BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | MAP (_._1 AS Y) ⊎ SCAN(<,>) | TFILTER T4 | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) | MAP (_ AS _0) | AGG (sum_l(_._0.Y) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS S)6digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q26._0._0 AS S)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS S)" ]; 2 [ label=<
    Value Computation
    $q26 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q98._0.Y) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q104._0.Y) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 4 [ label=<
    Value Computation
    MAP (q22 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS Y AS _0)" ]; 5 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS Y)" ]; 6 [ label=<
    Value Computation
    MAP (q6._1 AS Y)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS Y)" ]; 7 [ label=<
    Value Computation
    MAP (coalesce_long(q16._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 8 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[LESS_THAN promote(@c22 AS DOUBLE)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(DOUBLE AS _0, )" ]; + 8 [ label=<
    Index Scan
    scan type: BY_GROUP
    comparisons: [[LESS_THAN promote(@c22 AS DOUBLE)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(DOUBLE AS _0, LONG AS _1)" ]; 9 [ label=<
    Value Computation
    $q16 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 10 [ label=<
    Index
    MV10
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 10 [ label=<
    Index
    MV10
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, DOUBLE AS A, LONG AS B)" ]; 11 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 12 [ label=<
    Value Computation
    MAP (q12 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 13 [ label=<
    Type Filter
    WHERE record IS [T4]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 12 [ label=<
    Value Computation
    MAP (q12 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, DOUBLE AS B AS _0)" ]; + 13 [ label=<
    Type Filter
    WHERE record IS [T4]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS A, DOUBLE AS B)" ]; 14 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 15 [ label=<
    Primary Storage
    record types: [T4, T5, T6, T7, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q98> label="q98" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q104> label="q104" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q93> label="q93" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 5 [ label=< q95> label="q95" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q99> label="q99" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 5 [ label=< q101> label="q101" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 6 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 9 -> 7 [ label=< q16> label="q16" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 10 -> 8 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 11 -> 9 [ label=< q16> label="q16" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 12 -> 11 [ label=< q80> label="q80" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 12 -> 11 [ label=< q83> label="q83" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 13 -> 12 [ label=< q12> label="q12" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 14 -> 13 [ label=< q70> label="q70" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 14 -> 13 [ label=< q71> label="q71" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 15 -> 14 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}D +}B t - union-testseEXPLAIN select sum(Y) as S from (select count(*) as Y from t3 union all select count(*) from t1) as XC - (<0?8P@SCAN(<,>) | TFILTER T3 | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS Y) ⊎ ISCAN(VI1 <,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) | MAP (_ AS _0) | AGG (sum_l(_._0.Y) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS S)@digraph G { + union-testseEXPLAIN select sum(Y) as S from (select count(*) as Y from t3 union all select count(*) from t1) as XA + (H0M8e@ AISCAN(MV10 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | AGG sum_l(_._1) GROUP BY () | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS Y) ⊎ ISCAN(VI1 <,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) | MAP (_ AS _0) | AGG (sum_l(_._0.Y) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS S)>digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q26._0._0 AS S)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS S)" ]; 2 [ label=<
    Value Computation
    $q26 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q124._0.Y) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q154._0.Y) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 4 [ label=<
    Value Computation
    MAP (q22 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS Y AS _0)" ]; 5 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS Y)" ]; 6 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS Y)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS Y)" ]; 7 [ label=<
    Value Computation
    MAP (coalesce_long(q16._0._0, promote(0l AS LONG)) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 8 [ label=<
    Value Computation
    $q6 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 9 [ label=<
    Value Computation
    $q16 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 10 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 10 [ label=<
    Value Computation
    MAP ((q4._1 AS _0) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 11 [ label=<
    Streaming Aggregate
    COLLECT (count_star(*) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 12 [ label=<
    Value Computation
    MAP (q2 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 13 [ label=<
    Value Computation
    MAP (q12 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, AS _0)" ]; - 14 [ label=<
    Type Filter
    WHERE record IS [T3]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 15 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 16 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 17 [ label=<
    Index
    VI1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 18 [ label=<
    Primary Storage
    record types: [T4, T5, T6, T7, T1, T2, T3]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; + 12 [ label=<
    Streaming Aggregate
    COLLECT sum_l(q128._1)
    GROUP BY ()
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; + 13 [ label=<
    Value Computation
    MAP (q12 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2 AS _0)" ]; + 14 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(DOUBLE AS _0, LONG AS _1)" ]; + 15 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 16 [ label=<
    Index
    MV10
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, DOUBLE AS A, LONG AS B)" ]; + 17 [ label=<
    Index
    VI1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q124> label="q124" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q154> label="q154" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q119> label="q119" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 5 [ label=< q121> label="q121" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q149> label="q149" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 5 [ label=< q151> label="q151" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 6 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 9 -> 7 [ label=< q16> label="q16" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 10 -> 8 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 11 -> 9 [ label=< q16> label="q16" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 12 -> 10 [ label=< q115> label="q115" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 13 -> 11 [ label=< q100> label="q100" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 14 -> 12 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 12 -> 10 [ label=< q4> label="q4" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 13 -> 11 [ label=< q106> label="q106" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 14 -> 12 [ label=< q128> label="q128" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 15 -> 13 [ label=< q12> label="q12" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 16 -> 14 [ label=< q105> label="q105" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 16 -> 14 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 17 -> 15 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 18 -> 16 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}9 +}: t - union-testseEXPLAIN select sum(Y) as S from (select count(*) as Y from t6 union all select count(*) from t7) as X9 - (J0T8h@ AISCAN(MV11 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS Y) ⊎ AISCAN(MV12 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) | MAP (_ AS _0) | AGG (sum_l(_._0.Y) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS S)5digraph G { + union-testseEXPLAIN select sum(Y) as S from (select count(*) as Y from t6 union all select count(*) from t7) as X9 + (J0I8h@ AISCAN(MV11 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS Y) ⊎ AISCAN(MV12 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) | MAP (_ AS _0) | AGG (sum_l(_._0.Y) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS S)6digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q26._0._0 AS S)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS S)" ]; 2 [ label=<
    Value Computation
    $q26 OR NULL
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; - 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q134._0.Y) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; + 3 [ label=<
    Streaming Aggregate
    COLLECT (sum_l(q146._0.Y) AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 4 [ label=<
    Value Computation
    MAP (q22 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS Y AS _0)" ]; 5 [ label=<
    Union All
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS Y)" ]; 6 [ label=<
    Value Computation
    MAP (coalesce_long(q6._0._0, promote(0l AS LONG)) AS Y)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS Y)" ]; @@ -138,13 +136,13 @@ t 11 [ label=<
    Value Computation
    MAP (q14 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0 AS _0)" ]; 12 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; 13 [ label=<
    Index Scan
    scan type: BY_GROUP
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 14 [ label=<
    Index
    MV11
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 15 [ label=<
    Index
    MV12
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 14 [ label=<
    Index
    MV11
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 15 [ label=<
    Index
    MV12
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ label=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q134> label="q134" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q146> label="q146" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ label=< q22> label="q22" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q129> label="q129" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 7 -> 5 [ label=< q131> label="q131" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q141> label="q141" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 5 [ label=< q143> label="q143" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 8 -> 6 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 9 -> 7 [ label=< q16> label="q16" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 10 -> 8 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; diff --git a/yaml-tests/src/test/resources/union.metrics.yaml b/yaml-tests/src/test/resources/union.metrics.yaml index 57f92c7035..75a421a065 100644 --- a/yaml-tests/src/test/resources/union.metrics.yaml +++ b/yaml-tests/src/test/resources/union.metrics.yaml @@ -8,9 +8,9 @@ union-tests: promote(0l AS LONG)) AS B) | MAP (_ AS _0) | AGG (sum_l(_._0.A) AS _0, sum_l(_._0.B) AS _1) | ON EMPTY NULL | MAP (_._0._0 AS A, _._0._1 AS B) task_count: 765 - task_total_time_ms: 25 - transform_count: 189 - transform_time_ms: 7 + task_total_time_ms: 10 + transform_count: 197 + transform_time_ms: 3 transform_yield_count: 53 insert_time_ms: 0 insert_new_count: 76 @@ -23,28 +23,29 @@ union-tests: promote(0l AS LONG)) AS _0) | MAP (_ AS _0) | AGG (sum_l(_._0.Y) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS S)' task_count: 773 - task_total_time_ms: 32 - transform_count: 220 - transform_time_ms: 11 + task_total_time_ms: 31 + transform_count: 231 + transform_time_ms: 13 transform_yield_count: 55 insert_time_ms: 0 insert_new_count: 68 insert_reused_count: 4 - query: EXPLAIN select sum(Y) as S from (select count(*) as Y from t3 union all select count(*) from t1) as X - explain: SCAN(<,>) | TFILTER T3 | MAP (_ AS _0) | AGG (count_star(*) AS _0) | - ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS Y) ⊎ ISCAN(VI1 - <,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, - promote(0l AS LONG)) AS _0) | MAP (_ AS _0) | AGG (sum_l(_._0.Y) AS _0) | - ON EMPTY NULL | MAP (_._0._0 AS S) - task_count: 801 - task_total_time_ms: 31 - transform_count: 203 - transform_time_ms: 9 - transform_yield_count: 60 + explain: 'AISCAN(MV10 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | AGG sum_l(_._1) + GROUP BY () | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, + promote(0l AS LONG)) AS Y) ⊎ ISCAN(VI1 <,>) | MAP (_ AS _0) | AGG (count_star(*) + AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) + AS _0) | MAP (_ AS _0) | AGG (sum_l(_._0.Y) AS _0) | ON EMPTY NULL | MAP (_._0._0 + AS S)' + task_count: 1000 + task_total_time_ms: 37 + transform_count: 277 + transform_time_ms: 14 + transform_yield_count: 72 insert_time_ms: 1 - insert_new_count: 80 - insert_reused_count: 7 + insert_new_count: 101 + insert_reused_count: 9 - query: EXPLAIN select sum(Y) as S from (select count(*) as Y from t6 union all select count(*) from t7) as X explain: 'AISCAN(MV11 <,> BY_GROUP -> [_0: VALUE:[0]]) | MAP (_ AS _0) | ON EMPTY @@ -53,9 +54,9 @@ union-tests: promote(0l AS LONG)) AS _0) | MAP (_ AS _0) | AGG (sum_l(_._0.Y) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS S)' task_count: 1083 - task_total_time_ms: 41 - transform_count: 311 - transform_time_ms: 12 + task_total_time_ms: 36 + transform_count: 325 + transform_time_ms: 13 transform_yield_count: 74 insert_time_ms: 1 insert_new_count: 104 diff --git a/yaml-tests/src/test/resources/union.yamsql b/yaml-tests/src/test/resources/union.yamsql index 7b273d1d7e..e055519a91 100644 --- a/yaml-tests/src/test/resources/union.yamsql +++ b/yaml-tests/src/test/resources/union.yamsql @@ -160,7 +160,7 @@ test_block: - result: [{S: 2}] - - query: select sum(Y) as S from (select count(*) as Y from t3 union all select count(*) from t1) as X - - explain: "SCAN(<,>) | TFILTER T3 | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS Y) ⊎ ISCAN(VI1 <,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) | MAP (_ AS _0) | AGG (sum_l(_._0.Y) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS S)" + - explain: "AISCAN(MV10 <,> BY_GROUP -> [_0: KEY:[0], _1: VALUE:[0]]) | AGG sum_l(_._1) GROUP BY () | MAP ((_._1 AS _0) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS Y) ⊎ ISCAN(VI1 <,>) | MAP (_ AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0) | MAP (_ AS _0) | AGG (sum_l(_._0.Y) AS _0) | ON EMPTY NULL | MAP (_._0._0 AS S)" - result: [{S: 5}] - - query: select col2 from t1 where exists (select a from t3 where col2 <= id union all select b from t4 where col2 <= id) diff --git a/yaml-tests/src/test/resources/update-delete-returning.metrics.binpb b/yaml-tests/src/test/resources/update-delete-returning.metrics.binpb index 430fab6cfa..98c5104d09 100644 --- a/yaml-tests/src/test/resources/update-delete-returning.metrics.binpb +++ b/yaml-tests/src/test/resources/update-delete-returning.metrics.binpb @@ -1,71 +1,71 @@ - + e - unnamed-1XEXPLAIN update A set A2 = 42, A3 = 44 where A1 <= 2 returning "new".A3 OPTIONS(DRY RUN); -ջJ P(08@tSCAN(<,>) | DISTINCT BY PK | FILTER _.A1 LESS_THAN_OR_EQUALS promote(@c15 AS LONG) | UPDATE A | MAP (_.new.A3 AS A3)digraph G { + unnamed-1XEXPLAIN update A set A2 = 42, A3 = 44 where A1 <= 2 returning "new".A3 OPTIONS(DRY RUN); +}N ;(08@tSCAN(<,>) | DISTINCT BY PK | FILTER _.A1 LESS_THAN_OR_EQUALS promote(@c15 AS LONG) | UPDATE A | MAP (_.new.A3 AS A3)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6.new.A3 AS A3)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A3)" ]; - 2 [ label=<
    Modification
    UPDATE
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, AS old, )" ]; - 3 [ label=<
    Primary Storage
    A
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, AS old, )" ]; - 4 [ label=<
    Predicate Filter
    WHERE q34.A1 LESS_THAN_OR_EQUALS promote(@c15 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; - 5 [ label=<
    Unordered Primary Key Distinct
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS A1, )" ]; - 6 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; - 7 [ label=<
    Primary Storage
    record types: [A]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; - 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="none" arrowtail="normal" dir="both" ]; - 4 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q34> label="q34" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q32> label="q32" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Modification
    UPDATE
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3 AS old, LONG AS A1, LONG AS A2, LONG AS A3 AS new)" ]; + 3 [ label=<
    Predicate Filter
    WHERE q37.A1 LESS_THAN_OR_EQUALS promote(@c15 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; + 4 [ label=<
    Primary Storage
    A
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3 AS old, LONG AS A1, LONG AS A2, LONG AS A3 AS new)" ]; + 5 [ label=<
    Unordered Primary Key Distinct
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; + 6 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; + 7 [ label=<
    Primary Storage
    record types: [A]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; + 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="none" arrowtail="normal" dir="both" ]; + 5 -> 3 [ label=< q37> label="q37" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q35> label="q35" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; { rank=same; rankDir=LR; - 4 -> 3 [ color="red" style="invis" ]; + 3 -> 4 [ color="red" style="invis" ]; } -} +} T - unnamed-1GEXPLAIN update A set A2 = 42, A3 = 44 where A1 <= 2 returning "new".A3; -ջJ P(08@tSCAN(<,>) | DISTINCT BY PK | FILTER _.A1 LESS_THAN_OR_EQUALS promote(@c15 AS LONG) | UPDATE A | MAP (_.new.A3 AS A3)digraph G { + unnamed-1GEXPLAIN update A set A2 = 42, A3 = 44 where A1 <= 2 returning "new".A3; +}N ;(08@tSCAN(<,>) | DISTINCT BY PK | FILTER _.A1 LESS_THAN_OR_EQUALS promote(@c15 AS LONG) | UPDATE A | MAP (_.new.A3 AS A3)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6.new.A3 AS A3)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A3)" ]; - 2 [ label=<
    Modification
    UPDATE
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, AS old, )" ]; - 3 [ label=<
    Predicate Filter
    WHERE q34.A1 LESS_THAN_OR_EQUALS promote(@c15 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; - 4 [ label=<
    Primary Storage
    A
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, AS old, )" ]; - 5 [ label=<
    Unordered Primary Key Distinct
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS A1, )" ]; - 6 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; - 7 [ label=<
    Primary Storage
    record types: [A]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; - 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="none" arrowtail="normal" dir="both" ]; - 5 -> 3 [ label=< q34> label="q34" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q32> label="q32" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Modification
    UPDATE
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3 AS old, LONG AS A1, LONG AS A2, LONG AS A3 AS new)" ]; + 3 [ label=<
    Primary Storage
    A
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3 AS old, LONG AS A1, LONG AS A2, LONG AS A3 AS new)" ]; + 4 [ label=<
    Predicate Filter
    WHERE q37.A1 LESS_THAN_OR_EQUALS promote(@c15 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; + 5 [ label=<
    Unordered Primary Key Distinct
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; + 6 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; + 7 [ label=<
    Primary Storage
    record types: [A]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; + 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="none" arrowtail="normal" dir="both" ]; + 4 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q37> label="q37" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q35> label="q35" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; { rank=same; rankDir=LR; - 3 -> 4 [ color="red" style="invis" ]; + 4 -> 3 [ color="red" style="invis" ]; } -} +} p - unnamed-1cEXPLAIN update A set A2 = 42, A3 = 44 where A1 <= 2 returning "new".A3 + "new".A3 OPTIONS(DRY RUN); -J Ɍh(08@SCAN(<,>) | DISTINCT BY PK | FILTER _.A1 LESS_THAN_OR_EQUALS promote(@c15 AS LONG) | UPDATE A | MAP (_.new.A3 + _.new.A3 AS _0)digraph G { + unnamed-1cEXPLAIN update A set A2 = 42, A3 = 44 where A1 <= 2 returning "new".A3 + "new".A3 OPTIONS(DRY RUN); +{N 8(08@SCAN(<,>) | DISTINCT BY PK | FILTER _.A1 LESS_THAN_OR_EQUALS promote(@c15 AS LONG) | UPDATE A | MAP (_.new.A3 + _.new.A3 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6.new.A3 + q6.new.A3 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Modification
    UPDATE
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, AS old, )" ]; - 3 [ label=<
    Predicate Filter
    WHERE q34.A1 LESS_THAN_OR_EQUALS promote(@c15 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; - 4 [ label=<
    Primary Storage
    A
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, AS old, )" ]; - 5 [ label=<
    Unordered Primary Key Distinct
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS A1, )" ]; - 6 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; - 7 [ label=<
    Primary Storage
    record types: [A]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; + 2 [ label=<
    Modification
    UPDATE
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3 AS old, LONG AS A1, LONG AS A2, LONG AS A3 AS new)" ]; + 3 [ label=<
    Predicate Filter
    WHERE q37.A1 LESS_THAN_OR_EQUALS promote(@c15 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; + 4 [ label=<
    Primary Storage
    A
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3 AS old, LONG AS A1, LONG AS A2, LONG AS A3 AS new)" ]; + 5 [ label=<
    Unordered Primary Key Distinct
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; + 6 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; + 7 [ label=<
    Primary Storage
    record types: [A]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 4 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="none" arrowtail="normal" dir="both" ]; - 5 -> 3 [ label=< q34> label="q34" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q32> label="q32" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 3 [ label=< q37> label="q37" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q35> label="q35" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; { @@ -73,46 +73,46 @@ p rankDir=LR; 3 -> 4 [ color="red" style="invis" ]; } -} +} _ - unnamed-1REXPLAIN update A set A2 = 42, A3 = 44 where A1 <= 2 returning "new".A3 + "new".A3; -J Ɍh(08@SCAN(<,>) | DISTINCT BY PK | FILTER _.A1 LESS_THAN_OR_EQUALS promote(@c15 AS LONG) | UPDATE A | MAP (_.new.A3 + _.new.A3 AS _0)digraph G { + unnamed-1REXPLAIN update A set A2 = 42, A3 = 44 where A1 <= 2 returning "new".A3 + "new".A3; +{N 8(08@SCAN(<,>) | DISTINCT BY PK | FILTER _.A1 LESS_THAN_OR_EQUALS promote(@c15 AS LONG) | UPDATE A | MAP (_.new.A3 + _.new.A3 AS _0)digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
    Value Computation
    MAP (q6.new.A3 + q6.new.A3 AS _0)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS _0)" ]; - 2 [ label=<
    Modification
    UPDATE
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, AS old, )" ]; - 3 [ label=<
    Primary Storage
    A
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, AS old, )" ]; - 4 [ label=<
    Predicate Filter
    WHERE q34.A1 LESS_THAN_OR_EQUALS promote(@c15 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; - 5 [ label=<
    Unordered Primary Key Distinct
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS A1, )" ]; - 6 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; - 7 [ label=<
    Primary Storage
    record types: [A]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; - 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="none" arrowtail="normal" dir="both" ]; - 4 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 4 [ label=< q34> label="q34" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 6 -> 5 [ label=< q32> label="q32" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 [ label=<
    Modification
    UPDATE
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3 AS old, LONG AS A1, LONG AS A2, LONG AS A3 AS new)" ]; + 3 [ label=<
    Predicate Filter
    WHERE q37.A1 LESS_THAN_OR_EQUALS promote(@c15 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; + 4 [ label=<
    Primary Storage
    A
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3 AS old, LONG AS A1, LONG AS A2, LONG AS A3 AS new)" ]; + 5 [ label=<
    Unordered Primary Key Distinct
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; + 6 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; + 7 [ label=<
    Primary Storage
    record types: [A]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; + 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="none" arrowtail="normal" dir="both" ]; + 5 -> 3 [ label=< q37> label="q37" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q35> label="q35" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 7 -> 6 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; { rank=same; rankDir=LR; - 4 -> 3 [ color="red" style="invis" ]; + 3 -> 4 [ color="red" style="invis" ]; } -} +} H - unnamed-1;EXPLAIN update A set A2 = 52 where A1 > 2 OPTIONS(DRY RUN); -7 R(08@VSCAN(<,>) | DISTINCT BY PK | FILTER _.A1 GREATER_THAN promote(@c10 AS LONG) | UPDATE Adigraph G { + unnamed-1;EXPLAIN update A set A2 = 52 where A1 > 2 OPTIONS(DRY RUN); +]; -(08@VSCAN(<,>) | DISTINCT BY PK | FILTER _.A1 GREATER_THAN promote(@c10 AS LONG) | UPDATE Adigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Modification
    UPDATE
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, AS old, )" ]; - 2 [ label=<
    Predicate Filter
    WHERE q31.A1 GREATER_THAN promote(@c10 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; - 3 [ label=<
    Unordered Primary Key Distinct
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS A1, )" ]; - 4 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; - 5 [ label=<
    Primary Storage
    record types: [A]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; - 6 [ label=<
    Primary Storage
    A
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, AS old, )" ]; - 3 -> 2 [ label=< q31> label="q31" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q29> label="q29" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 1 [ label=<
    Modification
    UPDATE
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3 AS old, LONG AS A1, LONG AS A2, LONG AS A3 AS new)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q34.A1 GREATER_THAN promote(@c10 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; + 3 [ label=<
    Unordered Primary Key Distinct
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; + 4 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; + 5 [ label=<
    Primary Storage
    record types: [A]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; + 6 [ label=<
    Primary Storage
    A
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3 AS old, LONG AS A1, LONG AS A2, LONG AS A3 AS new)" ]; + 3 -> 2 [ label=< q34> label="q34" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q32> label="q32" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="none" arrowtail="normal" dir="both" ]; @@ -121,21 +121,21 @@ H rankDir=LR; 2 -> 6 [ color="red" style="invis" ]; } -} +} 7 - unnamed-1*EXPLAIN update A set A2 = 52 where A1 > 2; -7 R(08@VSCAN(<,>) | DISTINCT BY PK | FILTER _.A1 GREATER_THAN promote(@c10 AS LONG) | UPDATE Adigraph G { + unnamed-1*EXPLAIN update A set A2 = 52 where A1 > 2; +]; -(08@VSCAN(<,>) | DISTINCT BY PK | FILTER _.A1 GREATER_THAN promote(@c10 AS LONG) | UPDATE Adigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Modification
    UPDATE
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, AS old, )" ]; - 2 [ label=<
    Predicate Filter
    WHERE q31.A1 GREATER_THAN promote(@c10 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; - 3 [ label=<
    Unordered Primary Key Distinct
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS A1, )" ]; - 4 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; - 5 [ label=<
    Primary Storage
    record types: [A]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, )" ]; - 6 [ label=<
    Primary Storage
    A
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, AS old, )" ]; - 3 -> 2 [ label=< q31> label="q31" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q29> label="q29" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 1 [ label=<
    Modification
    UPDATE
    > color="black" shape="plain" style="filled" fillcolor="lightcoral" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3 AS old, LONG AS A1, LONG AS A2, LONG AS A3 AS new)" ]; + 2 [ label=<
    Predicate Filter
    WHERE q34.A1 GREATER_THAN promote(@c10 AS LONG)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; + 3 [ label=<
    Unordered Primary Key Distinct
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; + 4 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; + 5 [ label=<
    Primary Storage
    record types: [A]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3)" ]; + 6 [ label=<
    Primary Storage
    A
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A1, LONG AS A2, LONG AS A3 AS old, LONG AS A1, LONG AS A2, LONG AS A3 AS new)" ]; + 3 -> 2 [ label=< q34> label="q34" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q32> label="q32" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 6 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="none" arrowtail="normal" dir="both" ]; diff --git a/yaml-tests/src/test/resources/update-delete-returning.metrics.yaml b/yaml-tests/src/test/resources/update-delete-returning.metrics.yaml index 640133b87f..6f69c33750 100644 --- a/yaml-tests/src/test/resources/update-delete-returning.metrics.yaml +++ b/yaml-tests/src/test/resources/update-delete-returning.metrics.yaml @@ -5,8 +5,8 @@ unnamed-1: AS LONG) | UPDATE A | MAP (_.new.A3 AS A3) task_count: 288 task_total_time_ms: 2 - transform_count: 74 - transform_time_ms: 1 + transform_count: 78 + transform_time_ms: 0 transform_yield_count: 19 insert_time_ms: 0 insert_new_count: 25 @@ -16,8 +16,8 @@ unnamed-1: AS LONG) | UPDATE A | MAP (_.new.A3 AS A3) task_count: 288 task_total_time_ms: 2 - transform_count: 74 - transform_time_ms: 1 + transform_count: 78 + transform_time_ms: 0 transform_yield_count: 19 insert_time_ms: 0 insert_new_count: 25 @@ -27,9 +27,9 @@ unnamed-1: explain: SCAN(<,>) | DISTINCT BY PK | FILTER _.A1 LESS_THAN_OR_EQUALS promote(@c15 AS LONG) | UPDATE A | MAP (_.new.A3 + _.new.A3 AS _0) task_count: 288 - task_total_time_ms: 3 - transform_count: 74 - transform_time_ms: 1 + task_total_time_ms: 2 + transform_count: 78 + transform_time_ms: 0 transform_yield_count: 19 insert_time_ms: 0 insert_new_count: 25 @@ -39,9 +39,9 @@ unnamed-1: explain: SCAN(<,>) | DISTINCT BY PK | FILTER _.A1 LESS_THAN_OR_EQUALS promote(@c15 AS LONG) | UPDATE A | MAP (_.new.A3 + _.new.A3 AS _0) task_count: 288 - task_total_time_ms: 3 - transform_count: 74 - transform_time_ms: 1 + task_total_time_ms: 2 + transform_count: 78 + transform_time_ms: 0 transform_yield_count: 19 insert_time_ms: 0 insert_new_count: 25 @@ -50,9 +50,9 @@ unnamed-1: explain: SCAN(<,>) | DISTINCT BY PK | FILTER _.A1 GREATER_THAN promote(@c10 AS LONG) | UPDATE A task_count: 225 - task_total_time_ms: 2 - transform_count: 55 - transform_time_ms: 1 + task_total_time_ms: 1 + transform_count: 59 + transform_time_ms: 0 transform_yield_count: 17 insert_time_ms: 0 insert_new_count: 21 @@ -61,9 +61,9 @@ unnamed-1: explain: SCAN(<,>) | DISTINCT BY PK | FILTER _.A1 GREATER_THAN promote(@c10 AS LONG) | UPDATE A task_count: 225 - task_total_time_ms: 2 - transform_count: 55 - transform_time_ms: 1 + task_total_time_ms: 1 + transform_count: 59 + transform_time_ms: 0 transform_yield_count: 17 insert_time_ms: 0 insert_new_count: 21 diff --git a/yaml-tests/src/test/resources/versions-tests.metrics.binpb b/yaml-tests/src/test/resources/versions-tests.metrics.binpb index 261e8595cf..0a6d0c3b3c 100644 --- a/yaml-tests/src/test/resources/versions-tests.metrics.binpb +++ b/yaml-tests/src/test/resources/versions-tests.metrics.binpb @@ -1,167 +1,168 @@ - + X - unnamed-2KEXPLAIN select "__ROW_VERSION" as version, t1.col2 from t1 where col1 = 10; - (:0w8L@XISCAN(I1 [EQUALS promote(@c14 AS LONG)]) | MAP (version([_]) AS VERSION, _.COL2 AS COL2) + unnamed-2KEXPLAIN select "__ROW_VERSION" as version, t1.col2 from t1 where col1 = 10; + (:0Y8L@XISCAN(I1 [EQUALS promote(@c14 AS LONG)]) | MAP (version([_]) AS VERSION, _.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (version([q2]) AS VERSION, q2.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS VERSION, )" ]; - 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c14 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (version([q2]) AS VERSION, q2.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS VERSION, LONG AS COL2)" ]; + 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c14 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} 9 - unnamed-2,EXPLAIN select t1.* from t1 where col1 = 10; - (;0O8?@(ISCAN(I1 [EQUALS promote(@c10 AS LONG)])digraph G { + unnamed-2,EXPLAIN select t1.* from t1 where col1 = 10; +  (60ծ18;@WISCAN(I1 [EQUALS promote(@c10 AS LONG)]) ∩ SCAN(<,>) COMPARE BY (recordType(_), _.ID)digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c10 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 2 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 2 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 1 [ label=<
    Intersection
    COMPARE BY (recordType(_), _.ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c10 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 4 [ label=<
    Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 5 [ label=<
    Primary Storage
    record types: [T1]
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q92> label="q92" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 1 [ label=< q94> label="q94" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}  - unnamed-2xEXPLAIN select s.version, s.col2 from (select "__ROW_VERSION" as version, t1.col2 as col2 from t1 where col1 = 10) AS s; - ݀(<0s8P@XISCAN(I1 [EQUALS promote(@c26 AS LONG)]) | MAP (version([_]) AS VERSION, _.COL2 AS COL2) + unnamed-2xEXPLAIN select s.version, s.col2 from (select "__ROW_VERSION" as version, t1.col2 as col2 from t1 where col1 = 10) AS s; + 噭(<08P@XISCAN(I1 [EQUALS promote(@c26 AS LONG)]) | MAP (version([_]) AS VERSION, _.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (version([q2]) AS VERSION, q2.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS VERSION, )" ]; - 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c26 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (version([q2]) AS VERSION, q2.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS VERSION, LONG AS COL2)" ]; + 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c26 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} z - unnamed-2mEXPLAIN select s."__ROW_VERSION", s.col2 from (select "__ROW_VERSION", t1.col2 from t1 where col1 = 10) AS s; -Ν (<0Ҫt8P@^ISCAN(I1 [EQUALS promote(@c22 AS LONG)]) | MAP (version([_]) AS __ROW_VERSION, _.COL2 AS COL2) + unnamed-2mEXPLAIN select s."__ROW_VERSION", s.col2 from (select "__ROW_VERSION", t1.col2 from t1 where col1 = 10) AS s; +ܰ  (<0G8P@^ISCAN(I1 [EQUALS promote(@c22 AS LONG)]) | MAP (version([_]) AS __ROW_VERSION, _.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (version([q2]) AS __ROW_VERSION, q2.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS __ROW_VERSION, )" ]; - 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c22 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (version([q2]) AS __ROW_VERSION, q2.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS __ROW_VERSION, LONG AS COL2)" ]; + 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c22 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} U - unnamed-2HEXPLAIN select "__ROW_VERSION" as version, t1.* from t1 where col1 = 20; - (:0n8L@tISCAN(I1 [EQUALS promote(@c14 AS LONG)]) | MAP (version([_]) AS VERSION, _.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) -digraph G { + unnamed-2HEXPLAIN select "__ROW_VERSION" as version, t1.* from t1 where col1 = 20; + (:0a8L@tISCAN(I1 [EQUALS promote(@c14 AS LONG)]) | MAP (version([_]) AS VERSION, _.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (version([q2]) AS VERSION, q2.ID AS ID, q2.COL1 AS COL1, q2.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS VERSION, )" ]; - 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c14 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (version([q2]) AS VERSION, q2.ID AS ID, q2.COL1 AS COL1, q2.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS VERSION, LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c14 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} W - unnamed-2JEXPLAIN select "__ROW_VERSION" as version, (t1.*) from t1 where col1 = 20; - (:0w8L@QISCAN(I1 [EQUALS promote(@c16 AS LONG)]) | MAP (version([_]) AS VERSION, _ AS _1) + unnamed-2JEXPLAIN select "__ROW_VERSION" as version, (t1.*) from t1 where col1 = 20; + ؇(:0\8L@QISCAN(I1 [EQUALS promote(@c16 AS LONG)]) | MAP (version([_]) AS VERSION, _ AS _1) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (version([q2]) AS VERSION, q2 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS VERSION, )" ]; - 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c16 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (version([q2]) AS VERSION, q2 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS VERSION, LONG AS ID, LONG AS COL1, LONG AS COL2 AS _1)" ]; + 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c16 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} J - unnamed-2=EXPLAIN select "__ROW_VERSION", t1.* from t1 where col1 = 20; - (:0i8L@zISCAN(I1 [EQUALS promote(@c12 AS LONG)]) | MAP (version([_]) AS __ROW_VERSION, _.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) -digraph G { + unnamed-2=EXPLAIN select "__ROW_VERSION", t1.* from t1 where col1 = 20; + + (:0ǔ78L@zISCAN(I1 [EQUALS promote(@c12 AS LONG)]) | MAP (version([_]) AS __ROW_VERSION, _.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (version([q2]) AS __ROW_VERSION, q2.ID AS ID, q2.COL1 AS COL1, q2.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS __ROW_VERSION, )" ]; - 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c12 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (version([q2]) AS __ROW_VERSION, q2.ID AS ID, q2.COL1 AS COL1, q2.COL2 AS COL2)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS __ROW_VERSION, LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c12 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} L - unnamed-2?EXPLAIN select "__ROW_VERSION", (t1.*) from t1 where col1 = 20; -˻ (:0s8L@WISCAN(I1 [EQUALS promote(@c14 AS LONG)]) | MAP (version([_]) AS __ROW_VERSION, _ AS _1) -digraph G { + unnamed-2?EXPLAIN select "__ROW_VERSION", (t1.*) from t1 where col1 = 20; + ϒ(:0ΜY8L@WISCAN(I1 [EQUALS promote(@c14 AS LONG)]) | MAP (version([_]) AS __ROW_VERSION, _ AS _1) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (version([q2]) AS __ROW_VERSION, q2 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS __ROW_VERSION, )" ]; - 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c14 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (version([q2]) AS __ROW_VERSION, q2 AS _1)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS __ROW_VERSION, LONG AS ID, LONG AS COL1, LONG AS COL2 AS _1)" ]; + 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c14 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Index
    I1
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} X - unnamed-2KEXPLAIN select "__ROW_VERSION", t1.id from t1 order by "__ROW_VERSION" ASC; -8 ( 0Ë 8@JISCAN(VERSION_INDEX <,>) | MAP (version([_]) AS __ROW_VERSION, _.ID AS ID) + unnamed-2KEXPLAIN select "__ROW_VERSION", t1.id from t1 order by "__ROW_VERSION" ASC; +< ( 08@JISCAN(VERSION_INDEX <,>) | MAP (version([_]) AS __ROW_VERSION, _.ID AS ID) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (version([q2]) AS __ROW_VERSION, q2.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS __ROW_VERSION, )" ]; - 2 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index
    VERSION_INDEX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (version([q2]) AS __ROW_VERSION, q2.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS __ROW_VERSION, LONG AS ID)" ]; + 2 [ label=<
    Index Scan
    range: <-∞, ∞>
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Index
    VERSION_INDEX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} \ - unnamed-2OEXPLAIN select t1."__ROW_VERSION", t1.id from t1 order by "__ROW_VERSION" DESC; -8 ( 08@RISCAN(VERSION_INDEX <,> REVERSE) | MAP (version([_]) AS __ROW_VERSION, _.ID AS ID) -digraph G { + unnamed-2OEXPLAIN select t1."__ROW_VERSION", t1.id from t1 order by "__ROW_VERSION" DESC; +< ( 08@RISCAN(VERSION_INDEX <,> REVERSE) | MAP (version([_]) AS __ROW_VERSION, _.ID AS ID) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (version([q2]) AS __ROW_VERSION, q2.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS __ROW_VERSION, )" ]; - 2 [ label=<
    Index Scan
    range: <-∞, ∞>
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index
    VERSION_INDEX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (version([q2]) AS __ROW_VERSION, q2.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS __ROW_VERSION, LONG AS ID)" ]; + 2 [ label=<
    Index Scan
    range: <-∞, ∞>
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Index
    VERSION_INDEX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} k - unnamed-2^EXPLAIN select t1."__ROW_VERSION", t1.id from t1 where col1 = 20 order by "__ROW_VERSION" ASC; - e ѿ('08!@mISCAN(GROUPED_VERSION_INDEX [EQUALS promote(@c14 AS LONG)]) | MAP (version([_]) AS __ROW_VERSION, _.ID AS ID) + unnamed-2^EXPLAIN select t1."__ROW_VERSION", t1.id from t1 where col1 = 20 order by "__ROW_VERSION" ASC; +i ('08!@mISCAN(GROUPED_VERSION_INDEX [EQUALS promote(@c14 AS LONG)]) | MAP (version([_]) AS __ROW_VERSION, _.ID AS ID) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (version([q2]) AS __ROW_VERSION, q2.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS __ROW_VERSION, )" ]; - 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c14 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index
    GROUPED_VERSION_INDEX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (version([q2]) AS __ROW_VERSION, q2.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS __ROW_VERSION, LONG AS ID)" ]; + 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c14 AS LONG)]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Index
    GROUPED_VERSION_INDEX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} i - unnamed-2\EXPLAIN select "__ROW_VERSION", t1.id from t1 where col1 = 20 order by "__ROW_VERSION" DESC; -e ('08!@uISCAN(GROUPED_VERSION_INDEX [EQUALS promote(@c12 AS LONG)] REVERSE) | MAP (version([_]) AS __ROW_VERSION, _.ID AS ID) -digraph G { + unnamed-2\EXPLAIN select "__ROW_VERSION", t1.id from t1 where col1 = 20 order by "__ROW_VERSION" DESC; +i ҵ('08!@uISCAN(GROUPED_VERSION_INDEX [EQUALS promote(@c12 AS LONG)] REVERSE) | MAP (version([_]) AS __ROW_VERSION, _.ID AS ID) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (version([q2]) AS __ROW_VERSION, q2.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS __ROW_VERSION, )" ]; - 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c12 AS LONG)]
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index
    GROUPED_VERSION_INDEX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (version([q2]) AS __ROW_VERSION, q2.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS __ROW_VERSION, LONG AS ID)" ]; + 2 [ label=<
    Index Scan
    comparisons: [EQUALS promote(@c12 AS LONG)]
    direction: reversed
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Index
    GROUPED_VERSION_INDEX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +} x - unnamed-2kEXPLAIN select "__ROW_VERSION", col1, t1.id from t1 where col1 > 10 order by col1 asc, "__ROW_VERSION" asc; -U (%08@ISCAN(GROUPED_VERSION_INDEX [[GREATER_THAN promote(@c14 AS LONG)]]) | MAP (version([_]) AS __ROW_VERSION, _.COL1 AS COL1, _.ID AS ID) -digraph G { + unnamed-2kEXPLAIN select "__ROW_VERSION", col1, t1.id from t1 where col1 > 10 order by col1 asc, "__ROW_VERSION" asc; +Y (%08@ISCAN(GROUPED_VERSION_INDEX [[GREATER_THAN promote(@c14 AS LONG)]]) | MAP (version([_]) AS __ROW_VERSION, _.COL1 AS COL1, _.ID AS ID) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
    Value Computation
    MAP (version([q2]) AS __ROW_VERSION, q2.COL1 AS COL1, q2.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS __ROW_VERSION, )" ]; - 2 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN promote(@c14 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; - 3 [ label=<
    Index
    GROUPED_VERSION_INDEX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, )" ]; + 1 [ label=<
    Value Computation
    MAP (version([q2]) AS __ROW_VERSION, q2.COL1 AS COL1, q2.ID AS ID)
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS __ROW_VERSION, LONG AS COL1, LONG AS ID)" ]; + 2 [ label=<
    Index Scan
    comparisons: [[GREATER_THAN promote(@c14 AS LONG)]]
    > color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; + 3 [ label=<
    Index
    GROUPED_VERSION_INDEX
    > color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, LONG AS COL2)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; } \ No newline at end of file diff --git a/yaml-tests/src/test/resources/versions-tests.metrics.yaml b/yaml-tests/src/test/resources/versions-tests.metrics.yaml index 193f567744..263f8d6632 100644 --- a/yaml-tests/src/test/resources/versions-tests.metrics.yaml +++ b/yaml-tests/src/test/resources/versions-tests.metrics.yaml @@ -4,33 +4,34 @@ unnamed-2: explain: ISCAN(I1 [EQUALS promote(@c14 AS LONG)]) | MAP (version([_]) AS VERSION, _.COL2 AS COL2) task_count: 699 - task_total_time_ms: 41 - transform_count: 179 - transform_time_ms: 13 + task_total_time_ms: 31 + transform_count: 183 + transform_time_ms: 8 transform_yield_count: 58 insert_time_ms: 1 insert_new_count: 76 insert_reused_count: 6 - query: EXPLAIN select t1.* from t1 where col1 = 10; - explain: ISCAN(I1 [EQUALS promote(@c10 AS LONG)]) - task_count: 571 - task_total_time_ms: 34 - transform_count: 130 - transform_time_ms: 11 - transform_yield_count: 59 - insert_time_ms: 1 - insert_new_count: 63 - insert_reused_count: 8 + explain: ISCAN(I1 [EQUALS promote(@c10 AS LONG)]) ∩ SCAN(<,>) COMPARE BY (recordType(_), + _.ID) + task_count: 559 + task_total_time_ms: 28 + transform_count: 128 + transform_time_ms: 10 + transform_yield_count: 54 + insert_time_ms: 0 + insert_new_count: 59 + insert_reused_count: 4 - query: EXPLAIN select s.version, s.col2 from (select "__ROW_VERSION" as version, t1.col2 as col2 from t1 where col1 = 10) AS s; explain: ISCAN(I1 [EQUALS promote(@c26 AS LONG)]) | MAP (version([_]) AS VERSION, _.COL2 AS COL2) task_count: 725 - task_total_time_ms: 44 - transform_count: 190 + task_total_time_ms: 40 + transform_count: 194 transform_time_ms: 13 transform_yield_count: 60 - insert_time_ms: 1 + insert_time_ms: 3 insert_new_count: 80 insert_reused_count: 7 - query: EXPLAIN select s."__ROW_VERSION", s.col2 from (select "__ROW_VERSION", @@ -38,9 +39,9 @@ unnamed-2: explain: ISCAN(I1 [EQUALS promote(@c22 AS LONG)]) | MAP (version([_]) AS __ROW_VERSION, _.COL2 AS COL2) task_count: 725 - task_total_time_ms: 38 - transform_count: 190 - transform_time_ms: 14 + task_total_time_ms: 29 + transform_count: 194 + transform_time_ms: 8 transform_yield_count: 60 insert_time_ms: 1 insert_new_count: 80 @@ -49,9 +50,9 @@ unnamed-2: explain: ISCAN(I1 [EQUALS promote(@c14 AS LONG)]) | MAP (version([_]) AS VERSION, _.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) task_count: 699 - task_total_time_ms: 47 - transform_count: 179 - transform_time_ms: 15 + task_total_time_ms: 39 + transform_count: 183 + transform_time_ms: 14 transform_yield_count: 58 insert_time_ms: 1 insert_new_count: 76 @@ -61,9 +62,9 @@ unnamed-2: explain: ISCAN(I1 [EQUALS promote(@c16 AS LONG)]) | MAP (version([_]) AS VERSION, _ AS _1) task_count: 699 - task_total_time_ms: 43 - transform_count: 179 - transform_time_ms: 16 + task_total_time_ms: 34 + transform_count: 183 + transform_time_ms: 12 transform_yield_count: 58 insert_time_ms: 1 insert_new_count: 76 @@ -72,20 +73,20 @@ unnamed-2: explain: ISCAN(I1 [EQUALS promote(@c12 AS LONG)]) | MAP (version([_]) AS __ROW_VERSION, _.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) task_count: 699 - task_total_time_ms: 39 - transform_count: 179 - transform_time_ms: 13 + task_total_time_ms: 21 + transform_count: 183 + transform_time_ms: 7 transform_yield_count: 58 - insert_time_ms: 1 + insert_time_ms: 0 insert_new_count: 76 insert_reused_count: 6 - query: EXPLAIN select "__ROW_VERSION", (t1.*) from t1 where col1 = 20; explain: ISCAN(I1 [EQUALS promote(@c14 AS LONG)]) | MAP (version([_]) AS __ROW_VERSION, _ AS _1) task_count: 699 - task_total_time_ms: 44 - transform_count: 179 - transform_time_ms: 13 + task_total_time_ms: 32 + transform_count: 183 + transform_time_ms: 10 transform_yield_count: 58 insert_time_ms: 1 insert_new_count: 76 @@ -95,9 +96,9 @@ unnamed-2: explain: ISCAN(VERSION_INDEX <,>) | MAP (version([_]) AS __ROW_VERSION, _.ID AS ID) task_count: 206 - task_total_time_ms: 7 - transform_count: 56 - transform_time_ms: 3 + task_total_time_ms: 12 + transform_count: 60 + transform_time_ms: 6 transform_yield_count: 32 insert_time_ms: 0 insert_new_count: 17 @@ -107,9 +108,9 @@ unnamed-2: explain: ISCAN(VERSION_INDEX <,> REVERSE) | MAP (version([_]) AS __ROW_VERSION, _.ID AS ID) task_count: 206 - task_total_time_ms: 9 - transform_count: 56 - transform_time_ms: 5 + task_total_time_ms: 11 + transform_count: 60 + transform_time_ms: 6 transform_yield_count: 32 insert_time_ms: 0 insert_new_count: 17 @@ -119,9 +120,9 @@ unnamed-2: explain: ISCAN(GROUPED_VERSION_INDEX [EQUALS promote(@c14 AS LONG)]) | MAP (version([_]) AS __ROW_VERSION, _.ID AS ID) task_count: 351 - task_total_time_ms: 24 - transform_count: 101 - transform_time_ms: 9 + task_total_time_ms: 15 + transform_count: 105 + transform_time_ms: 6 transform_yield_count: 39 insert_time_ms: 0 insert_new_count: 33 @@ -131,9 +132,9 @@ unnamed-2: explain: ISCAN(GROUPED_VERSION_INDEX [EQUALS promote(@c12 AS LONG)] REVERSE) | MAP (version([_]) AS __ROW_VERSION, _.ID AS ID) task_count: 351 - task_total_time_ms: 11 - transform_count: 101 - transform_time_ms: 5 + task_total_time_ms: 16 + transform_count: 105 + transform_time_ms: 7 transform_yield_count: 39 insert_time_ms: 0 insert_new_count: 33 @@ -143,9 +144,9 @@ unnamed-2: explain: ISCAN(GROUPED_VERSION_INDEX [[GREATER_THAN promote(@c14 AS LONG)]]) | MAP (version([_]) AS __ROW_VERSION, _.COL1 AS COL1, _.ID AS ID) task_count: 313 - task_total_time_ms: 16 - transform_count: 85 - transform_time_ms: 7 + task_total_time_ms: 18 + transform_count: 89 + transform_time_ms: 8 transform_yield_count: 37 insert_time_ms: 0 insert_new_count: 27 diff --git a/yaml-tests/src/test/resources/versions-tests.yamsql b/yaml-tests/src/test/resources/versions-tests.yamsql index 9ce1d6a220..cc0c095415 100644 --- a/yaml-tests/src/test/resources/versions-tests.yamsql +++ b/yaml-tests/src/test/resources/versions-tests.yamsql @@ -54,7 +54,7 @@ test_block: - # Do not include __ROW_VERSION (as a pseudo-column) in * - query: select t1.* from t1 where col1 = 10; - - explain: "ISCAN(I1 [EQUALS promote(@c10 AS LONG)])" + - explain: "ISCAN(I1 [EQUALS promote(@c10 AS LONG)]) ∩ SCAN(<,>) COMPARE BY (recordType(_), _.ID)" - result: [{ID: 1, COL1: 10, COL2: 1}, {ID: 2, COL1: 10, COL2: 2}, {ID: 3, COL1: 10, COL2: 3}, {ID: 4, COL1: 10, COL2: 4}, {ID: 5, COL1: 10, COL2: 5}] - # Get version column from sub-select