diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/RecordMetaData.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/RecordMetaData.java index f7c0b5232f..444b38f58c 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/RecordMetaData.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/RecordMetaData.java @@ -29,9 +29,9 @@ import com.apple.foundationdb.record.metadata.RecordType; import com.apple.foundationdb.record.metadata.SyntheticRecordType; import com.apple.foundationdb.record.metadata.UnnestedRecordType; +import com.apple.foundationdb.record.metadata.View; import com.apple.foundationdb.record.metadata.expressions.KeyExpression; import com.apple.foundationdb.record.metadata.expressions.LiteralKeyExpression; -import com.apple.foundationdb.record.metadata.View; import com.apple.foundationdb.record.query.plan.cascades.UserDefinedFunction; import com.apple.foundationdb.record.query.plan.cascades.typing.Type; import com.apple.foundationdb.record.query.plan.synthetic.SyntheticRecordPlanner; @@ -45,7 +45,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.Comparator; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; @@ -53,7 +52,6 @@ import java.util.TreeMap; import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Collectors; -import java.util.stream.Stream; /** * Meta-data for Record Layer record stores. @@ -720,11 +718,6 @@ public RecordMetaDataProto.MetaData toProto(@Nullable Descriptors.FileDescriptor return builder.build(); } - @Nonnull - public Map getFieldDescriptorMapFromNames(@Nonnull final Collection recordTypeNames) { - return getFieldDescriptorMap(recordTypeNames.stream().map(this::getRecordType)); - } - @Nonnull public Map getUserDefinedFunctionMap() { return userDefinedFunctionMap; @@ -736,39 +729,50 @@ public Map getViewMap() { } @Nonnull - public static Map getFieldDescriptorMapFromTypes(@Nonnull final Collection recordTypes) { - if (recordTypes.size() == 1) { - final var recordType = Iterables.getOnlyElement(recordTypes); - return Type.Record.toFieldDescriptorMap(recordType.getDescriptor().getFields()); + public Type.Record getPlannerType(@Nonnull String recordTypeName) { + final RecordType recordType = getRecordType(recordTypeName); + Type.Record plannerType = Type.Record.fromDescriptor(recordType.getDescriptor()); + if (storeRecordVersions) { + plannerType = plannerType.addPseudoFields(); } - return getFieldDescriptorMap(recordTypes.stream()); + return plannerType; } @Nonnull - private static Map getFieldDescriptorMap(@Nonnull final Stream recordTypeStream) { + public Type.Record getPlannerType(@Nonnull Collection recordTypeNames) { + if (recordTypeNames.size() == 1) { + final String recordTypeName = Iterables.getOnlyElement(recordTypeNames); + return getPlannerType(recordTypeName); + } // todo: should be removed https://github.com/FoundationDB/fdb-record-layer/issues/1884 - return recordTypeStream - .sorted(Comparator.comparing(RecordType::getName)) - .flatMap(recordType -> recordType.getDescriptor().getFields().stream()) - .collect(Collectors.groupingBy(Descriptors.FieldDescriptor::getName, + LinkedHashMap fieldsByName = recordTypeNames.stream() + .map(this::getPlannerType) + .flatMap(type -> type.getFields().stream()) + .collect(Collectors.groupingBy(Type.Record.Field::getFieldName, LinkedHashMap::new, - Collectors.reducing(null, - (fieldDescriptor, fieldDescriptor2) -> { - Verify.verify(fieldDescriptor != null || fieldDescriptor2 != null); - if (fieldDescriptor == null) { - return fieldDescriptor2; - } - if (fieldDescriptor2 == null) { - return fieldDescriptor; - } - // TODO improve - if (fieldDescriptor.getType().getJavaType() == - fieldDescriptor2.getType().getJavaType()) { - return fieldDescriptor; - } - - throw new IllegalArgumentException("cannot form union type of complex fields"); - }))); + Collectors.reducing(null, (Type.Record.Field f1, Type.Record.Field f2) -> { + Verify.verify(f1 != null || f2 != null); + if (f1 == null) { + return Type.Record.Field.of(f2.getFieldType(), f2.getFieldNameOptional()); + } + if (f2 == null) { + return Type.Record.Field.of(f1.getFieldType(), f1.getFieldNameOptional()); + } + // TODO improve + final Type f1Type = f1.getFieldType(); + final Type f2Type = f2.getFieldType(); + if (f1Type.equals(f2Type)) { + return Type.Record.Field.of(f1Type, f1.getFieldNameOptional()); + } else if (f2Type.isNullable() && f1Type.nullable().equals(f2Type)) { + return Type.Record.Field.of(f2Type, f2.getFieldNameOptional()); + } else if (f1Type.isNullable() && f2Type.nullable().equals(f1Type)) { + return Type.Record.Field.of(f1Type, f1.getFieldNameOptional()); + } + + throw new IllegalArgumentException("cannot form union type of complex fields"); + }) + )); + return Type.Record.fromFields(false, List.copyOf(fieldsByName.values())); } @Nonnull diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/RecordMetaDataBuilder.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/RecordMetaDataBuilder.java index ca8c20e69d..206e73c01e 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/RecordMetaDataBuilder.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/RecordMetaDataBuilder.java @@ -36,13 +36,13 @@ import com.apple.foundationdb.record.metadata.SyntheticRecordType; import com.apple.foundationdb.record.metadata.SyntheticRecordTypeBuilder; import com.apple.foundationdb.record.metadata.UnnestedRecordTypeBuilder; +import com.apple.foundationdb.record.metadata.View; import com.apple.foundationdb.record.metadata.expressions.FieldKeyExpression; import com.apple.foundationdb.record.metadata.expressions.KeyExpression; import com.apple.foundationdb.record.metadata.expressions.LiteralKeyExpression; -import com.apple.foundationdb.record.provider.foundationdb.IndexMaintainerRegistry; import com.apple.foundationdb.record.provider.foundationdb.IndexMaintainerFactoryRegistryImpl; +import com.apple.foundationdb.record.provider.foundationdb.IndexMaintainerRegistry; import com.apple.foundationdb.record.provider.foundationdb.MetaDataProtoEditor; -import com.apple.foundationdb.record.metadata.View; import com.apple.foundationdb.record.query.plan.cascades.UserDefinedFunction; import com.google.common.base.Verify; import com.google.common.collect.ImmutableMap; diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/metadata/expressions/VersionKeyExpression.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/metadata/expressions/VersionKeyExpression.java index f25c67db38..21a9c36988 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/metadata/expressions/VersionKeyExpression.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/metadata/expressions/VersionKeyExpression.java @@ -29,10 +29,11 @@ import com.apple.foundationdb.record.provider.foundationdb.FDBRecordVersion; import com.apple.foundationdb.record.query.plan.cascades.CorrelationIdentifier; import com.apple.foundationdb.record.query.plan.cascades.KeyExpressionVisitor; +import com.apple.foundationdb.record.query.plan.cascades.typing.PseudoField; import com.apple.foundationdb.record.query.plan.cascades.typing.Type; -import com.apple.foundationdb.record.query.plan.cascades.values.QuantifiedRecordValue; +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.Value; -import com.apple.foundationdb.record.query.plan.cascades.values.VersionValue; import com.google.protobuf.Descriptors; import com.google.protobuf.Message; @@ -116,7 +117,7 @@ public R expand(@Nonnull final KeyExpr @Nonnull @Override public Value toValue(@Nonnull final CorrelationIdentifier baseAlias, @Nonnull final Type baseType) { - return new VersionValue(QuantifiedRecordValue.of(baseAlias, baseType)); + return FieldValue.ofFieldName(QuantifiedObjectValue.of(baseAlias, baseType), PseudoField.ROW_VERSION.getFieldName()); } @Override diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/expressions/QueryRecordFunctionWithComparison.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/expressions/QueryRecordFunctionWithComparison.java index 6b14339dea..f94d167d9d 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/expressions/QueryRecordFunctionWithComparison.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/expressions/QueryRecordFunctionWithComparison.java @@ -36,10 +36,11 @@ 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.predicates.ValuePredicate; +import com.apple.foundationdb.record.query.plan.cascades.typing.PseudoField; +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.QuantifiedRecordValue; import com.apple.foundationdb.record.query.plan.cascades.values.RankValue; -import com.apple.foundationdb.record.query.plan.cascades.values.VersionValue; +import com.apple.foundationdb.record.query.plan.cascades.values.Value; import com.google.common.collect.Lists; import com.google.protobuf.Descriptors; import com.google.protobuf.Message; @@ -162,7 +163,7 @@ public GraphExpansion expand(@Nonnull final Quantifier.ForEach baseQuantifier, Quantifier.existential(Reference.initialOf(rankSelectExpression)); return GraphExpansion.ofExists(rankComparisonQuantifier); } else if (function instanceof StoreRecordFunction && FunctionNames.VERSION.equals(function.getName())) { - final VersionValue versionValue = new VersionValue(QuantifiedRecordValue.of(baseQuantifier)); + final Value versionValue = FieldValue.ofFieldNameAndFuseIfPossible(baseQuantifier.getFlowedObjectValue(), PseudoField.ROW_VERSION.getFieldName()); return GraphExpansion.builder() .addPredicate(new ValuePredicate(versionValue, comparison)) .build(); diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/IndexKeyValueToPartialRecord.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/IndexKeyValueToPartialRecord.java index c5a8ddee35..6d7978c060 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/IndexKeyValueToPartialRecord.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/IndexKeyValueToPartialRecord.java @@ -715,7 +715,9 @@ public Builder addField(@Nonnull final String field, @Nonnull final TupleSource @Nonnull final AvailableFields.CopyIfPredicate copyIfPredicate, @Nonnull final ImmutableIntArray ordinalPath, @Nullable final String invertibleFunction) { - validateField(field); + if (!validateField(field)) { + return this; + } FieldCopier copier = new FieldCopier(field, source, copyIfPredicate, ordinalPath, invertibleFunction); if (fields.put(field, copier) != null) { throw new RecordCoreException("setting field more than once: " + field); @@ -725,7 +727,9 @@ public Builder addField(@Nonnull final String field, @Nonnull final TupleSource public Builder addField(@Nonnull final String field, @Nonnull final Value extractFromIndexEntryValue) { - validateField(field); + if (!validateField(field)) { + return this; + } final Copier copier = new FieldWithValueCopier(Quantifier.current(), ConstantPredicate.TRUE, @@ -737,15 +741,18 @@ public Builder addField(@Nonnull final String field, return this; } - private void validateField(final @Nonnull String field) { + private boolean validateField(final @Nonnull String field) { final Descriptors.FieldDescriptor fieldDescriptor = recordDescriptor.findFieldByName(field); if (fieldDescriptor == null) { - throw new MetaDataException("field not found: " + field); + // Field not in record descriptor. This can happen when the PseudoFields are in the index + // definition. Just skip over it + return false; } if (fieldDescriptor.getType() == Descriptors.FieldDescriptor.Type.MESSAGE && !TupleFieldsHelper.isTupleField(fieldDescriptor.getMessageType())) { throw new RecordCoreException("must set nested message field-by-field: " + field); } + return true; } public Builder getFieldBuilder(@Nonnull String field) { diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/bitmap/ComposedBitmapIndexQueryPlan.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/bitmap/ComposedBitmapIndexQueryPlan.java index dc3c0dbcdd..a5a94a16ac 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/bitmap/ComposedBitmapIndexQueryPlan.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/bitmap/ComposedBitmapIndexQueryPlan.java @@ -106,7 +106,7 @@ public RecordCursor executePlan(@Nonnull final // Composers can return null bitmaps when empty, which is then left out of the result set. .filter(indexEntry -> indexEntry.getValue().get(0) != null) .map(indexPlans.get(0).indexEntryToQueriedRecord(store)) - .map(QueryResult::fromQueriedRecord); + .map(queriedRecord -> QueryResult.fromQueriedRecord(getResultValue().getResultType(), context, queriedRecord)); } @Override 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 037b6a3dbe..c315d79c9b 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 @@ -23,7 +23,6 @@ import com.apple.foundationdb.record.EvaluationContext; import com.apple.foundationdb.record.IndexScanType; import com.apple.foundationdb.record.RecordCoreException; -import com.apple.foundationdb.record.RecordMetaData; import com.apple.foundationdb.record.logging.LogMessageKeys; import com.apple.foundationdb.record.metadata.Index; import com.apple.foundationdb.record.metadata.IndexOptions; @@ -399,8 +398,6 @@ public RecordQueryPlan toEquivalentPlan(@Nonnull final PartialMatch partialMatch @Nonnull final Memoizer memoizer, @Nonnull final List comparisonRanges, final boolean reverseScanOrder) { - final var baseRecordType = Type.Record.fromFieldDescriptorsMap(RecordMetaData.getFieldDescriptorMapFromTypes(recordTypes)); - final var selectHavingResultValue = selectHavingExpression.getResultValue(); final var resultType = (Type.Record)selectHavingResultValue.getResultType(); final var messageDescriptor = @@ -420,7 +417,7 @@ public RecordQueryPlan toEquivalentPlan(@Nonnull final PartialMatch partialMatch reverseScanOrder, false, partialMatch.getMatchCandidate(), - baseRecordType, + baseType.narrowRecordMaybe().orElseThrow(() -> new RecordCoreException("type is of wrong implementor")), QueryPlanConstraint.noConstraint()); var plan = new RecordQueryAggregateIndexPlan(aggregateIndexScan, diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/IndexExpansionInfo.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/IndexExpansionInfo.java index 24ccc4dd98..13857e7c5c 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/IndexExpansionInfo.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/IndexExpansionInfo.java @@ -25,6 +25,7 @@ import com.apple.foundationdb.record.metadata.Index; import com.apple.foundationdb.record.metadata.RecordType; import com.apple.foundationdb.record.metadata.expressions.KeyExpression; +import com.apple.foundationdb.record.query.plan.cascades.typing.Type; import com.google.common.collect.ImmutableSet; import javax.annotation.Nonnull; @@ -51,18 +52,22 @@ public final class IndexExpansionInfo { private final Collection indexedRecordTypes; @Nonnull private final Set indexedRecordTypeNames; + @Nonnull + private final Type.Record plannerBaseType; private IndexExpansionInfo(@Nonnull RecordMetaData metaData, @Nonnull Index index, boolean reverse, @Nonnull Collection indexedRecordTypes, @Nonnull Set indexedRecordTypeNames, + @Nonnull Type.Record plannerBaseType, @Nullable KeyExpression commonPrimaryKeyForTypes) { this.metaData = metaData; this.index = index; this.reverse = reverse; this.indexedRecordTypes = indexedRecordTypes; this.indexedRecordTypeNames = indexedRecordTypeNames; + this.plannerBaseType = plannerBaseType; this.commonPrimaryKeyForTypes = commonPrimaryKeyForTypes; } @@ -105,6 +110,11 @@ public Set getAvailableRecordTypeNames() { return metaData.getRecordTypes().keySet(); } + @Nonnull + public Type.Record getPlannerBaseType() { + return plannerBaseType; + } + /** * Create an {@link IndexExpansionInfo} for a given index. * This wraps the given parameters into a single object, as well @@ -126,10 +136,12 @@ public static IndexExpansionInfo createInfo(@Nonnull RecordMetaData metaData, final Set indexedRecordTypeNames = indexedRecordTypes.stream() .map(RecordType::getName) .collect(ImmutableSet.toImmutableSet()); + @Nonnull + final Type.Record plannerBaseType = metaData.getPlannerType(indexedRecordTypeNames); @Nullable final KeyExpression commonPrimaryKeyForTypes = RecordMetaData.commonPrimaryKey(indexedRecordTypes); - return new IndexExpansionInfo(metaData, index, reverse, indexedRecordTypes, indexedRecordTypeNames, commonPrimaryKeyForTypes); + return new IndexExpansionInfo(metaData, index, reverse, indexedRecordTypes, indexedRecordTypeNames, plannerBaseType, commonPrimaryKeyForTypes); } } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/MatchCandidateExpansion.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/MatchCandidateExpansion.java index 29947d291b..e327b45a3b 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/MatchCandidateExpansion.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/MatchCandidateExpansion.java @@ -24,7 +24,6 @@ import com.apple.foundationdb.record.RecordMetaData; import com.apple.foundationdb.record.logging.KeyValueLogMessage; import com.apple.foundationdb.record.metadata.Index; -import com.apple.foundationdb.record.metadata.RecordType; import com.apple.foundationdb.record.metadata.expressions.KeyExpression; import com.apple.foundationdb.record.query.plan.cascades.expressions.FullUnorderedScanExpression; import com.apple.foundationdb.record.query.plan.cascades.expressions.LogicalTypeFilterExpression; @@ -35,7 +34,6 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; -import java.util.Collection; import java.util.Optional; import java.util.Set; @@ -129,7 +127,7 @@ public static Optional fromPrimaryDefinition(@Nonnull final Reco .filter(recordType -> queriedRecordTypeNames.contains(recordType.getName())) .collect(ImmutableList.toImmutableList()); - final var baseRef = createBaseRef(metaData.getRecordTypes().keySet(), queriedRecordTypeNames, queriedRecordTypes, new PrimaryAccessHint()); + final var baseRef = createBaseRef(metaData.getRecordTypes().keySet(), queriedRecordTypeNames, metaData.getPlannerType(queriedRecordTypeNames), new PrimaryAccessHint()); final var expansionVisitor = new PrimaryAccessExpansionVisitor(availableRecordTypes, queriedRecordTypes); return Optional.of(expansionVisitor.expand(() -> Quantifier.forEach(baseRef), primaryKey, isReverse)); } @@ -140,13 +138,13 @@ public static Optional fromPrimaryDefinition(@Nonnull final Reco @Nonnull private static Reference createBaseRef(@Nonnull IndexExpansionInfo info, @Nonnull AccessHint accessHint) { - return createBaseRef(info.getAvailableRecordTypeNames(), info.getIndexedRecordTypeNames(), info.getIndexedRecordTypes(), accessHint); + return createBaseRef(info.getAvailableRecordTypeNames(), info.getIndexedRecordTypeNames(), info.getPlannerBaseType(), accessHint); } @Nonnull private static Reference createBaseRef(@Nonnull final Set availableRecordTypeNames, @Nonnull final Set queriedRecordTypeNames, - @Nonnull final Collection queriedRecordTypes, + @Nonnull final Type.Record baseType, @Nonnull AccessHint accessHint) { final var quantifier = Quantifier.forEach( @@ -157,6 +155,6 @@ private static Reference createBaseRef(@Nonnull final Set availableRecor return Reference.initialOf( new LogicalTypeFilterExpression(queriedRecordTypeNames, quantifier, - Type.Record.fromFieldDescriptorsMap(RecordMetaData.getFieldDescriptorMapFromTypes(queriedRecordTypes)))); + baseType)); } } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/PrimaryScanMatchCandidate.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/PrimaryScanMatchCandidate.java index d088621e56..b52f3e693f 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/PrimaryScanMatchCandidate.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/PrimaryScanMatchCandidate.java @@ -21,7 +21,6 @@ package com.apple.foundationdb.record.query.plan.cascades; import com.apple.foundationdb.record.RecordCoreException; -import com.apple.foundationdb.record.RecordMetaData; import com.apple.foundationdb.record.metadata.RecordType; import com.apple.foundationdb.record.metadata.expressions.KeyExpression; import com.apple.foundationdb.record.query.plan.ScanComparisons; @@ -190,8 +189,7 @@ public RecordQueryPlan toEquivalentPlan(@Nonnull PartialMatch partialMatch, if (queriedRecordTypeNames.size() == availableRecordTypeNames.size()) { scanPlan = new RecordQueryScanPlan(availableRecordTypeNames, - Type.Record.fromFieldDescriptorsMap(RecordMetaData.getFieldDescriptorMapFromTypes(getAvailableRecordTypes())) - .narrowMaybe(Type.Record.class).orElseThrow(() -> new RecordCoreException("type is of wrong implementor")), + baseType.narrowMaybe(Type.Record.class).orElseThrow(() -> new RecordCoreException("type is of wrong implementor")), primaryKey, toScanComparisons(comparisonRanges), reverseScanOrder, @@ -207,13 +205,11 @@ public RecordQueryPlan toEquivalentPlan(@Nonnull PartialMatch partialMatch, reverseScanOrder, false, this); - final var queriedType = - Type.Record.fromFieldDescriptorsMap(RecordMetaData.getFieldDescriptorMapFromTypes(getQueriedRecordTypes())); return new RecordQueryTypeFilterPlan( Quantifier.physical(memoizer.memoizePlan(scanPlan)), queriedRecordTypeNames, - queriedType); + baseType); } } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/ValueIndexScanMatchCandidate.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/ValueIndexScanMatchCandidate.java index d861839d57..662e8882b4 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/ValueIndexScanMatchCandidate.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/ValueIndexScanMatchCandidate.java @@ -21,7 +21,6 @@ package com.apple.foundationdb.record.query.plan.cascades; import com.apple.foundationdb.record.RecordCoreException; -import com.apple.foundationdb.record.RecordMetaData; import com.apple.foundationdb.record.metadata.Index; import com.apple.foundationdb.record.metadata.RecordType; import com.apple.foundationdb.record.metadata.expressions.KeyExpression; @@ -232,8 +231,8 @@ public RecordQueryPlan toEquivalentPlan(@Nonnull final PartialMatch partialMatch final boolean reverseScanOrder) { final var matchInfo = partialMatch.getRegularMatchInfo(); - final var baseRecordType = - Type.Record.fromFieldDescriptorsMap(RecordMetaData.getFieldDescriptorMapFromTypes(queriedRecordTypes)); + final Type.Record baseRecordType = baseType.narrowRecordMaybe().orElseThrow(() -> new RecordCoreException("type is of wrong implementor")); + return tryFetchCoveringIndexScan(partialMatch, planContext, memoizer, comparisonRanges, reverseScanOrder, baseRecordType) .orElseGet(() -> new RecordQueryIndexPlan(index.getName(), diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/WindowedIndexScanMatchCandidate.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/WindowedIndexScanMatchCandidate.java index 8cf313562c..d1d818dc92 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/WindowedIndexScanMatchCandidate.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/WindowedIndexScanMatchCandidate.java @@ -23,7 +23,6 @@ import com.apple.foundationdb.record.EvaluationContext; import com.apple.foundationdb.record.IndexScanType; import com.apple.foundationdb.record.RecordCoreException; -import com.apple.foundationdb.record.RecordMetaData; import com.apple.foundationdb.record.metadata.Index; import com.apple.foundationdb.record.metadata.RecordType; import com.apple.foundationdb.record.metadata.expressions.GroupingKeyExpression; @@ -396,8 +395,7 @@ public RecordQueryPlan toEquivalentPlan(@Nonnull final PartialMatch partialMatch @Nonnull final Memoizer memoizer, @Nonnull final List comparisonRanges, final boolean reverseScanOrder) { - final var baseRecordType = - Type.Record.fromFieldDescriptorsMap(RecordMetaData.getFieldDescriptorMapFromTypes(queriedRecordTypes)); + final Type.Record baseRecordType = baseType.narrowRecordMaybe().orElseThrow(() -> new RecordCoreException("type is of wrong implementor")); return tryFetchCoveringIndexScan(partialMatch, planContext, memoizer, comparisonRanges, reverseScanOrder, baseRecordType) .orElseGet(() -> new RecordQueryIndexPlan(index.getName(), 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 4f69c557f8..8ce67c8b1d 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 @@ -121,9 +121,9 @@ public interface RelationalExpression extends Correlated, static RelationalExpression fromRecordQuery(@Nonnull RecordMetaData recordMetaData, @Nonnull RecordQuery query) { query.validate(recordMetaData); - final var allRecordTypes = recordMetaData.getRecordTypes().keySet(); - final var recordTypesFromQuery = query.getRecordTypes(); - final var queriedRecordTypes = recordTypesFromQuery.isEmpty() ? allRecordTypes : recordTypesFromQuery; + final Set allRecordTypes = recordMetaData.getRecordTypes().keySet(); + final Collection recordTypesFromQuery = query.getRecordTypes(); + final Collection queriedRecordTypes = recordTypesFromQuery.isEmpty() ? allRecordTypes : recordTypesFromQuery; final Reference baseRef; Quantifier.ForEach quantifier; @@ -140,7 +140,7 @@ static RelationalExpression fromRecordQuery(@Nonnull RecordMetaData recordMetaDa new LogicalTypeFilterExpression( new HashSet<>(queriedRecordTypes), Quantifier.forEach(fuseRef), - Type.Record.fromFieldDescriptorsMap(recordMetaData.getFieldDescriptorMapFromNames(queriedRecordTypes)))); + recordMetaData.getPlannerType(queriedRecordTypes))); quantifier = Quantifier.forEach(baseRef); } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/CompatibleTypeEvolutionPredicate.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/CompatibleTypeEvolutionPredicate.java index 413978bda6..99979958c3 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/CompatibleTypeEvolutionPredicate.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/predicates/CompatibleTypeEvolutionPredicate.java @@ -132,8 +132,7 @@ public Boolean eval(@Nullable final FDBRecordStoreBase st // type was dropped return false; } - final Type.Record currentType = - Type.Record.fromFieldDescriptorsMap(recordMetaData.getFieldDescriptorMapFromNames(ImmutableList.of(entry.getKey()))); + final Type.Record currentType = recordMetaData.getPlannerType(entry.getKey()); if (!isAccessCompatibleWithCurrentType(fieldAccessTrieNode, currentType)) { return false; } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/typing/PseudoField.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/typing/PseudoField.java new file mode 100644 index 0000000000..64ac696ad0 --- /dev/null +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/typing/PseudoField.java @@ -0,0 +1,106 @@ +/* + * PseudoField.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.typing; + +import com.apple.foundationdb.record.RecordCoreException; +import com.apple.foundationdb.record.logging.LogMessageKeys; +import com.apple.foundationdb.record.provider.foundationdb.FDBQueriedRecord; +import com.apple.foundationdb.record.provider.foundationdb.FDBRecordVersion; +import com.google.protobuf.Descriptors; +import com.google.protobuf.Message; +import com.google.protobuf.ZeroCopyByteString; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.util.Map; +import java.util.function.Function; + +public enum PseudoField { + ROW_VERSION(Type.primitiveType(Type.TypeCode.VERSION, true), queriedRecord -> { + final FDBRecordVersion version = queriedRecord.getVersion(); + return version == null ? null : ZeroCopyByteString.wrap(version.toBytes(false)); + }), + ; + + @Nonnull + private static final String PREFIX = "__"; + + @Nonnull + private final String fieldName; + @Nonnull + private final Type type; + @Nonnull + private final Function, Object> valueExtractor; + + PseudoField(@Nonnull Type type, @Nonnull Function, Object> valueExtractor) { + this.fieldName = PREFIX + name(); + this.type = type; + this.valueExtractor = valueExtractor; + } + + @Nonnull + public String getFieldName() { + return fieldName; + } + + @Nullable + private Object extractProtoValue(@Nullable FDBQueriedRecord queriedRecord) { + if (queriedRecord == null) { + return null; + } + return valueExtractor.apply(queriedRecord); + } + + public void fillInIfApplicable(@Nonnull Type.Record desiredType, @Nullable FDBQueriedRecord queriedRecord, @Nonnull Message.Builder targetBuilder) { + if (queriedRecord == null) { + return; + } + final Map fieldNameMap = desiredType.getFieldNameFieldMap(); + @Nullable Type.Record.Field field = fieldNameMap.get(fieldName); + if (field == null || !field.getFieldType().equals(type)) { + // Field not in desired type + return; + } + if (queriedRecord.getRecord().getDescriptorForType().findFieldByName(field.getFieldStorageName()) != null) { + // Field is already defined in the record. Do not overwrite + return; + } + @Nullable Object value = extractProtoValue(queriedRecord); + if (value == null) { + // Pseudo-field is not set. Nothing to do + return; + } + + // Set the appropriate field in the target field descriptor + final Descriptors.FieldDescriptor targetFieldDescriptor = targetBuilder.getDescriptorForType().findFieldByName(field.getFieldStorageName()); + if (targetFieldDescriptor == null) { + throw new RecordCoreException("pseudo-field definition missing from target builder") + .addLogInfo(LogMessageKeys.FIELD_NAME, fieldName) + .addLogInfo(LogMessageKeys.RECORD_TYPE, queriedRecord.getRecordType().getName()); + } + targetBuilder.setField(targetFieldDescriptor, value); + } + + @Nonnull + public Type getType() { + return type; + } +} 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 24cc4491b6..f62b9f4476 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 @@ -71,6 +71,7 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Objects; @@ -518,6 +519,7 @@ private static Array fromProtoTypeToArray(@Nullable Descriptors.GenericDescripto private static Descriptors.GenericDescriptor getTypeSpecificDescriptor(@Nonnull final Descriptors.FieldDescriptor fieldDescriptor) { switch (fieldDescriptor.getType()) { case MESSAGE: + case GROUP: return fieldDescriptor.getMessageType(); case ENUM: return fieldDescriptor.getEnumType(); @@ -883,9 +885,9 @@ public static TypeCode fromProtobufFieldDescriptor(@Nonnull final Descriptors.Fi return TypeCode.BOOLEAN; case STRING: return TypeCode.STRING; - case GROUP: case ENUM: return TypeCode.ENUM; + case GROUP: case MESSAGE: return TypeCode.RECORD; case BYTES: @@ -2319,6 +2321,18 @@ public void defineProtoType(final TypeRepository.Builder typeRepositoryBuilder) typeRepositoryBuilder.registerTypeToTypeNameMapping(this, typeName); } + @Nonnull + public Type.Record addPseudoFields() { + final List newFields = new ArrayList<>(fields.size() + 1); + newFields.addAll(fields); + for (PseudoField pseudoField : PseudoField.values()) { + if (!getFieldNameFieldMap().containsKey(pseudoField.getFieldName())) { + newFields.add(Type.Record.Field.of(pseudoField.getType(), Optional.of(pseudoField.getFieldName()))); + } + } + return new Type.Record(name, storageName, isNullable, normalizeFields(newFields)); + } + /** * {@inheritDoc} */ diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/typing/TypeRepository.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/typing/TypeRepository.java index da866fc059..9cc6663eef 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/typing/TypeRepository.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/typing/TypeRepository.java @@ -131,6 +131,10 @@ public static TypeRepository parseFrom(@Nonnull final byte[] schemaDescBuf) thro return new TypeRepository(FileDescriptorSet.parseFrom(schemaDescBuf), Maps.newHashMap()); } + public boolean containsType(@Nonnull Type type) { + return typeToNameMap.containsKey(canonicalizeNullability(type)); + } + /** * Creates a new dynamic message builder for the given message type. * diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/MessageHelpers.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/MessageHelpers.java index 443404b95d..4b873584ae 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/MessageHelpers.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/MessageHelpers.java @@ -250,11 +250,17 @@ public static Message deepCopyMessageIfNeeded(@Nonnull final Descriptors.Descrip } final var builder = DynamicMessage.newBuilder(targetDescriptor); + deepCopyMessage(builder, message); + return builder.build(); + } + + @SuppressWarnings("PMD.CompareObjectsWithEquals") + public static void deepCopyMessage(@Nonnull final Message.Builder builder, @Nonnull final Message message) { for (final var entry : message.getAllFields().entrySet()) { final Descriptors.FieldDescriptor field = entry.getKey(); // find the field on the target side - final var targetField = targetDescriptor.findFieldByNumber(field.getNumber()); + final var targetField = builder.getDescriptorForType().findFieldByNumber(field.getNumber()); if (field.isRepeated()) { for (final var element : (List)entry.getValue()) { @@ -287,8 +293,6 @@ public static Message deepCopyMessageIfNeeded(@Nonnull final Descriptors.Descrip } } builder.mergeUnknownFields(message.getUnknownFields()); - - return builder.build(); } @Nonnull diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/Value.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/Value.java index 0b5da02fef..69584d1003 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/Value.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/Value.java @@ -122,8 +122,9 @@ default Type getResultType() { @Nonnull default Set getDynamicTypes() { return fold(p -> { - if (p instanceof CreatesDynamicTypesValue) { - return ImmutableSet.of(p.getResultType()); + final Type resultType = p.getResultType(); + if (!resultType.isPrimitive()) { + return ImmutableSet.of(resultType); } return ImmutableSet.of(); }, (thisTypes, childTypeSets) -> { diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/VersionValue.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/VersionValue.java index b9a1afd933..108368b65d 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/VersionValue.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/VersionValue.java @@ -34,6 +34,7 @@ import com.apple.foundationdb.record.query.plan.cascades.AliasMap; import com.apple.foundationdb.record.query.plan.cascades.BuiltInFunction; import com.apple.foundationdb.record.query.plan.cascades.CorrelationIdentifier; +import com.apple.foundationdb.record.query.plan.cascades.typing.PseudoField; 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.typing.Type; @@ -209,7 +210,7 @@ public VersionFn() { @Nonnull private static Value encapsulate(@Nonnull final List arguments) { - final var childQuantifiedRecordValue = (QuantifiedRecordValue)Iterables.getOnlyElement(arguments); - return new VersionValue(childQuantifiedRecordValue); + final var childRecordValue = Iterables.getOnlyElement(arguments); + return FieldValue.ofFieldNameAndFuseIfPossible((Value) childRecordValue, PseudoField.ROW_VERSION.getFieldName()); } } diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/simplification/MatchSimpleFieldValueRule.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/simplification/MatchSimpleFieldValueRule.java index fb5837b0f4..fd5b3da0c9 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/simplification/MatchSimpleFieldValueRule.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/simplification/MatchSimpleFieldValueRule.java @@ -24,6 +24,7 @@ import com.apple.foundationdb.record.query.plan.cascades.LinkedIdentityMap; import com.apple.foundationdb.record.query.plan.cascades.matching.structure.BindingMatcher; import com.apple.foundationdb.record.query.plan.cascades.matching.structure.ValueMatchers; +import com.apple.foundationdb.record.query.plan.cascades.typing.PseudoField; import com.apple.foundationdb.record.query.plan.cascades.values.FieldValue; import com.apple.foundationdb.record.query.plan.cascades.values.Value; import com.google.common.base.Verify; @@ -68,6 +69,9 @@ public void onMatch(@Nonnull final ValueComputationRuleCall(); newMatchedValuesMap.put(rootValue, ValueCompensation.noCompensation()); diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/QueryResult.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/QueryResult.java index 02232c6f02..efc11938ce 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/QueryResult.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/QueryResult.java @@ -21,6 +21,7 @@ package com.apple.foundationdb.record.query.plan.plans; import com.apple.foundationdb.annotation.API; +import com.apple.foundationdb.record.EvaluationContext; import com.apple.foundationdb.record.IndexEntry; import com.apple.foundationdb.record.ProtoSerializable; import com.apple.foundationdb.record.RecordCoreException; @@ -28,6 +29,10 @@ import com.apple.foundationdb.record.metadata.RecordType; import com.apple.foundationdb.record.planprotos.PQueryResult; import com.apple.foundationdb.record.provider.foundationdb.FDBQueriedRecord; +import com.apple.foundationdb.record.query.plan.cascades.typing.PseudoField; +import com.apple.foundationdb.record.query.plan.cascades.typing.Type; +import com.apple.foundationdb.record.query.plan.cascades.typing.TypeRepository; +import com.apple.foundationdb.record.query.plan.cascades.values.MessageHelpers; import com.apple.foundationdb.record.query.plan.serialization.PlanSerialization; import com.apple.foundationdb.tuple.ByteArrayUtil2; import com.apple.foundationdb.tuple.Tuple; @@ -41,6 +46,7 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; +import java.util.Objects; import java.util.Optional; /** @@ -235,18 +241,43 @@ public static QueryResult ofComputed(@Nullable final Object computed, @Nullable } /** - * Create a new queriedRecord with the given element. + * Create a new queriedRecord with the given element. This will make a copy in order to extract data from the + * {@link FDBQueriedRecord} that is not in the underlying protobuf message. More details about that information + * in the {@link PseudoField} enum. + * + * @param resultType type of final value to construct + * @param evaluationContext context to use (mainly for the type repository) * @param queriedRecord the given queriedRecord * @return the newly created query queriedRecord + * @see PseudoField for information on the fields that are copied out of the queried record but are not in the + * main definition */ @Nonnull - public static QueryResult fromQueriedRecord(@Nullable final FDBQueriedRecord queriedRecord) { + public static QueryResult fromQueriedRecord(@Nonnull Type resultType, @Nonnull EvaluationContext evaluationContext, @Nullable final FDBQueriedRecord queriedRecord) { if (queriedRecord == null) { return new QueryResult(null, null, null); } - return new QueryResult(queriedRecord.getRecord(), - queriedRecord, - queriedRecord.getPrimaryKey()); + + final TypeRepository typeRepository = evaluationContext.getTypeRepository(); + final Message datum; + if (!typeRepository.containsType(resultType) || !(resultType instanceof Type.Record)) { + // Type not in repository. Just return underlying queriedRecord + datum = queriedRecord.getRecord(); + } else { + // Copy over data from the underlying message + final Message.Builder builder = Objects.requireNonNull(typeRepository.newMessageBuilder(resultType)); + MessageHelpers.deepCopyMessage(builder, queriedRecord.getRecord()); + + // Extract any pseudo-fields + Type.Record recordType = (Type.Record) resultType; + for (PseudoField pseudoField : PseudoField.values()) { + pseudoField.fillInIfApplicable(recordType, queriedRecord, builder); + } + + datum = builder.build(); + } + + return new QueryResult(datum, queriedRecord, queriedRecord.getPrimaryKey()); } @Nonnull diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryAggregateIndexPlan.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryAggregateIndexPlan.java index a1fc333602..94ed80927b 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryAggregateIndexPlan.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryAggregateIndexPlan.java @@ -140,7 +140,7 @@ public RecordCursor executePlan(@Nonnull final final Index index = metaData.getIndex(getIndexName()); return store.coveredIndexQueriedRecord(index, indexEntry, recordType, (M)toRecord.toRecord(recordDescriptor, indexEntry), false); }) - .map(QueryResult::fromQueriedRecord); + .map(queriedRecord -> QueryResult.fromQueriedRecord(resultValue.getResultType(), context, queriedRecord)); } @Nonnull diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryCoveringIndexPlan.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryCoveringIndexPlan.java index e10736c179..0c10b00137 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryCoveringIndexPlan.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryCoveringIndexPlan.java @@ -113,7 +113,7 @@ public RecordCursor executePlan(@Nonnull final return indexPlan .executeEntries(store, context, continuation, executeProperties) .map(indexEntryToQueriedRecord(store)) - .map(QueryResult::fromQueriedRecord); + .map(queriedRecord -> QueryResult.fromQueriedRecord(getResultValue().getResultType(), context, queriedRecord)); } @Nonnull diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryFetchFromPartialRecordPlan.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryFetchFromPartialRecordPlan.java index 8ef51c527e..08624ddbf0 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryFetchFromPartialRecordPlan.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryFetchFromPartialRecordPlan.java @@ -130,7 +130,7 @@ public RecordCursor executePlan(@Nonnull final store, getChild().executePlan(store, context, continuation, executeProperties) .map(QueryResult::getIndexEntry), executeProperties) - .map(QueryResult::fromQueriedRecord); + .map(queriedRecord -> QueryResult.fromQueriedRecord(resultType, context, queriedRecord)); } @Nonnull 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 5d32d720ef..4618aa2fc7 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 @@ -313,7 +313,7 @@ private RecordCursor executeUsingRemoteFetch(@N final IndexScanBounds scanBounds = scanParameters.bind(store, index, context); return store.scanIndexRemoteFetch(index, scanBounds, continuation, executeProperties.asScanProperties(isReverse()), IndexOrphanBehavior.ERROR) .map(store::queriedRecord) - .map(QueryResult::fromQueriedRecord); + .map(queriedRecord -> QueryResult.fromQueriedRecord(resultType, context, queriedRecord)); } @Nonnull diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryInsertPlan.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryInsertPlan.java index 88afc452c1..fa6d0ff80b 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryInsertPlan.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryInsertPlan.java @@ -94,7 +94,7 @@ public PipelineOperation getPipelineOperation() { } else { result = store.saveRecordAsync(message, FDBRecordStoreBase.RecordExistenceCheck.ERROR_IF_EXISTS); } - return result.thenApply(fdbStoredRecord -> QueryResult.fromQueriedRecord(FDBQueriedRecord.stored(fdbStoredRecord))); + return result.thenApply(fdbStoredRecord -> QueryResult.fromQueriedRecord(getTargetType(), context, FDBQueriedRecord.stored(fdbStoredRecord))); } @Nonnull diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryLoadByKeysPlan.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryLoadByKeysPlan.java index a2852f642c..25c8eac253 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryLoadByKeysPlan.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryLoadByKeysPlan.java @@ -102,7 +102,7 @@ public RecordCursor executePlan(@Nonnull final .filter(Objects::nonNull) .map(store::queriedRecord) .skipThenLimit(executeProperties.getSkip(), executeProperties.getReturnedRowLimit()) - .map(QueryResult::fromQueriedRecord); + .map(queriedRecord -> QueryResult.fromQueriedRecord(getResultValue().getResultType(), context, queriedRecord)); } @Override diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryPlanWithIndex.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryPlanWithIndex.java index a32f470a87..5df08c7db0 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryPlanWithIndex.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryPlanWithIndex.java @@ -30,10 +30,10 @@ import com.apple.foundationdb.record.provider.foundationdb.FDBRecordStoreBase; import com.apple.foundationdb.record.query.plan.cascades.FinalMemoizer; import com.apple.foundationdb.record.query.plan.cascades.Quantifier; -import com.apple.foundationdb.record.query.plan.cascades.values.translation.TranslationMap; 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.values.translation.TranslationMap; import com.google.common.base.Verify; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; @@ -87,7 +87,7 @@ default RecordCursor executePlan(@Nonnull FDBRe final Function> entryCursorFunction = nestedContinuation -> executeEntries(store, evaluationContext, nestedContinuation, executeProperties); return fetchIndexRecords(store, evaluationContext, entryCursorFunction, continuation, executeProperties) - .map(QueryResult::fromQueriedRecord); + .map(queriedRecord -> QueryResult.fromQueriedRecord(getResultValue().getResultType(), evaluationContext, queriedRecord)); } @Nonnull diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryScanPlan.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryScanPlan.java index df787bb197..9ea79c9d5e 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryScanPlan.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryScanPlan.java @@ -188,7 +188,7 @@ public RecordCursor executePlan(@Nonnull final range.getLow(), range.getHigh(), range.getLowEndpoint(), range.getHighEndpoint(), continuation, executeProperties.asScanProperties(reverse)) .map(store::queriedRecord) - .map(QueryResult::fromQueriedRecord); + .map(queriedRecord -> QueryResult.fromQueriedRecord(getResultType(), context, queriedRecord)); } @Nullable diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryUpdatePlan.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryUpdatePlan.java index 8b21216682..8ac52148a1 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryUpdatePlan.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/plans/RecordQueryUpdatePlan.java @@ -104,7 +104,7 @@ public PipelineOperation getPipelineOperation() { } else { result = store.saveRecordAsync(message, FDBRecordStoreBase.RecordExistenceCheck.ERROR_IF_NOT_EXISTS_OR_RECORD_TYPE_CHANGED); } - return result.thenApply(fdbStoredRecord -> QueryResult.fromQueriedRecord(FDBQueriedRecord.stored(fdbStoredRecord))); + return result.thenApply(fdbStoredRecord -> QueryResult.fromQueriedRecord(getTargetType(), context, FDBQueriedRecord.stored(fdbStoredRecord))); } @Nonnull diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/sorting/RecordQueryDamPlan.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/sorting/RecordQueryDamPlan.java index da3ed3ad66..225d69c080 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/sorting/RecordQueryDamPlan.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/sorting/RecordQueryDamPlan.java @@ -21,7 +21,6 @@ package com.apple.foundationdb.record.query.plan.sorting; import com.apple.foundationdb.annotation.API; -import com.apple.foundationdb.record.query.plan.HeuristicPlanner; import com.apple.foundationdb.record.EvaluationContext; import com.apple.foundationdb.record.ExecuteProperties; import com.apple.foundationdb.record.ObjectPlanHash; @@ -36,6 +35,7 @@ import com.apple.foundationdb.record.provider.foundationdb.FDBRecordStoreBase; import com.apple.foundationdb.record.provider.foundationdb.FDBStoreTimer; import com.apple.foundationdb.record.query.plan.AvailableFields; +import com.apple.foundationdb.record.query.plan.HeuristicPlanner; import com.apple.foundationdb.record.query.plan.cascades.AliasMap; import com.apple.foundationdb.record.query.plan.cascades.CorrelationIdentifier; import com.apple.foundationdb.record.query.plan.cascades.Quantifier; @@ -121,7 +121,7 @@ public RecordCursor executePlan(@Nonnull FDBRec final FDBStoreTimer timer = store.getTimer(); final RecordCursor> dammed = MemorySortCursor.createDam(adapter, innerCursor, timer, continuation).skipThenLimit(skip, limit); - return dammed.map(QueryResult::fromQueriedRecord); + return dammed.map(queriedRecord -> QueryResult.fromQueriedRecord(getResultValue().getResultType(), context, queriedRecord)); } @Override diff --git a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/sorting/RecordQuerySortPlan.java b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/sorting/RecordQuerySortPlan.java index 35b0fcbe2f..2df3396a8e 100644 --- a/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/sorting/RecordQuerySortPlan.java +++ b/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/sorting/RecordQuerySortPlan.java @@ -113,7 +113,7 @@ public RecordCursor executePlan(@Nonnull FDBRec } else { sorted = FileSortCursor.create(adapter, innerCursor, timer, continuation, skip, limit); } - return sorted.map(QueryResult::fromQueriedRecord); + return sorted.map(queriedRecord -> QueryResult.fromQueriedRecord(getResultValue().getResultType(), context, queriedRecord)); } @Override diff --git a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBQueryGraphTestHelpers.java b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBQueryGraphTestHelpers.java index c00c2dc83b..d5b0115e53 100644 --- a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBQueryGraphTestHelpers.java +++ b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBQueryGraphTestHelpers.java @@ -39,7 +39,6 @@ import com.apple.foundationdb.record.query.plan.cascades.expressions.SelectExpression; 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.typing.Type.Record; 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.Value; @@ -121,7 +120,7 @@ public static Quantifier fullTypeScan(@Nonnull RecordMetaData metaData, @Nonnull return forEach( new LogicalTypeFilterExpression(ImmutableSet.of(typeName), fullScanQun, - Record.fromDescriptor(metaData.getRecordType(typeName).getDescriptor()))); + metaData.getPlannerType(typeName))); } @Nonnull diff --git a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBRepeatedFieldQueryTest.java b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBRepeatedFieldQueryTest.java index 130aa3c1d0..100644efbc 100644 --- a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBRepeatedFieldQueryTest.java +++ b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBRepeatedFieldQueryTest.java @@ -33,6 +33,7 @@ import com.apple.foundationdb.record.TestRecordsWithHeaderProto; import com.apple.foundationdb.record.metadata.expressions.KeyExpression.FanType; import com.apple.foundationdb.record.provider.foundationdb.FDBQueriedRecord; +import com.apple.foundationdb.record.provider.foundationdb.FDBRecord; import com.apple.foundationdb.record.provider.foundationdb.FDBRecordContext; import com.apple.foundationdb.record.query.RecordQuery; import com.apple.foundationdb.record.query.expressions.Query; @@ -589,7 +590,7 @@ void testComplexQuery7() throws Exception { final var typeRepository = TypeRepository.newBuilder().addAllTypes(usedTypes).build(); List byQuery = recordStore.executeQuery(plan, null, EvaluationContext.forBindingsAndTypeRepository(Bindings.EMPTY_BINDINGS, typeRepository), ExecuteProperties.SERIAL_EXECUTE) - .map(QueryResult::getMessage).asList().get(); + .map(QueryResult::getQueriedRecord).map(FDBRecord::getRecord).asList().get(); assertEquals(1, byQuery.size()); assertDiscardedNone(context); TestRecords1Proto.MySimpleRecord simpleByQuery = builder.clear().mergeFrom(byQuery.get(0)).build(); diff --git a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBStreamAggregationTest.java b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBStreamAggregationTest.java index d0c5782248..4f7e1370ee 100644 --- a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBStreamAggregationTest.java +++ b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBStreamAggregationTest.java @@ -34,11 +34,10 @@ import com.apple.foundationdb.record.provider.foundationdb.FDBRecordContext; import com.apple.foundationdb.record.query.expressions.Comparisons; import com.apple.foundationdb.record.query.plan.ScanComparisons; -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.Reference; import com.apple.foundationdb.record.query.plan.cascades.predicates.QueryPredicate; import com.apple.foundationdb.record.query.plan.cascades.predicates.ValuePredicate; -import com.apple.foundationdb.record.query.plan.cascades.typing.Type; import com.apple.foundationdb.record.query.plan.cascades.typing.TypeRepository; import com.apple.foundationdb.record.query.plan.cascades.values.AggregateValue; import com.apple.foundationdb.record.query.plan.cascades.values.CountValue; @@ -892,7 +891,7 @@ private Value createFieldValue(final Quantifier.Physical q, final String fieldNa } private Quantifier.Physical createBaseQuantifier() { - final var resultType = Type.Record.fromFieldDescriptorsMap(recordMetaData.getFieldDescriptorMapFromNames(ImmutableSet.of(recordTypeName))); + final var resultType = recordMetaData.getPlannerType(recordTypeName); final var scanPlan = new RecordQueryScanPlan(ImmutableSet.of(recordTypeName), resultType, null, ScanComparisons.EMPTY, false, false); final var filterPlan = new RecordQueryTypeFilterPlan(Quantifier.physical(Reference.plannedOf(scanPlan)), diff --git a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBVersionsQueryTest.java b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBVersionsQueryTest.java index 2c466d42aa..9c1fa8cdca 100644 --- a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBVersionsQueryTest.java +++ b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBVersionsQueryTest.java @@ -21,6 +21,7 @@ package com.apple.foundationdb.record.provider.foundationdb.query; import com.apple.foundationdb.record.EvaluationContext; +import com.apple.foundationdb.record.ExecuteProperties; import com.apple.foundationdb.record.RecordCoreException; import com.apple.foundationdb.record.RecordCursor; import com.apple.foundationdb.record.RecordCursorResult; @@ -35,6 +36,7 @@ import com.apple.foundationdb.record.provider.foundationdb.FDBQueriedRecord; import com.apple.foundationdb.record.provider.foundationdb.FDBRecord; import com.apple.foundationdb.record.provider.foundationdb.FDBRecordContext; +import com.apple.foundationdb.record.provider.foundationdb.FDBRecordStoreBase; import com.apple.foundationdb.record.provider.foundationdb.FDBRecordVersion; import com.apple.foundationdb.record.provider.foundationdb.FDBStoredRecord; import com.apple.foundationdb.record.provider.foundationdb.FDBTypedRecordStore; @@ -51,9 +53,10 @@ import com.apple.foundationdb.record.query.plan.cascades.expressions.LogicalSortExpression; import com.apple.foundationdb.record.query.plan.cascades.matching.structure.BindingMatcher; import com.apple.foundationdb.record.query.plan.cascades.predicates.ValuePredicate; +import com.apple.foundationdb.record.query.plan.cascades.properties.UsedTypesProperty; +import com.apple.foundationdb.record.query.plan.cascades.typing.PseudoField; +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.QuantifiedRecordValue; -import com.apple.foundationdb.record.query.plan.cascades.values.VersionValue; import com.apple.foundationdb.record.query.plan.plans.QueryResult; import com.apple.foundationdb.record.query.plan.plans.RecordQueryIndexPlan; import com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan; @@ -98,7 +101,6 @@ import static com.apple.foundationdb.record.query.plan.cascades.matching.structure.RecordQueryPlanMatchers.scanComparisons; import static com.apple.foundationdb.record.query.plan.cascades.matching.structure.ValueMatchers.fieldValueWithFieldNames; import static com.apple.foundationdb.record.query.plan.cascades.matching.structure.ValueMatchers.recordConstructorValue; -import static com.apple.foundationdb.record.query.plan.cascades.matching.structure.ValueMatchers.versionValue; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.hasSize; @@ -300,9 +302,9 @@ void residualVersionFilter() { .where(queryComponents(exactly(equalsObject(Query.version().greaterThan(versionForQuery)))))); } else { assertMatchesExactly(plan, predicatesFilterPlan(indexPlanMatcher) - .where(predicates(valuePredicate(versionValue(), new Comparisons.SimpleComparison(Comparisons.Type.GREATER_THAN, versionForQuery))))); + .where(predicates(valuePredicate(fieldValueWithFieldNames(PseudoField.ROW_VERSION.getFieldName()), new Comparisons.SimpleComparison(Comparisons.Type.GREATER_THAN, versionForQuery))))); } - List> queried = typedStore.executeQuery(plan) + List> queried = executeQuery(typedStore, plan) .map(FDBQueriedRecord::getStoredRecord) .asList() .join(); @@ -345,10 +347,10 @@ void residualVersionFilterWithSelectiveResults() { .where(queryComponents(exactly(equalsObject(Query.version().greaterThan(versionForQuery)))))); } else { assertMatchesExactly(plan, predicatesFilterPlan(indexPlanMatcher) - .where(predicates(valuePredicate(versionValue(), new Comparisons.SimpleComparison(Comparisons.Type.GREATER_THAN, versionForQuery))))); + .where(predicates(valuePredicate(fieldValueWithFieldNames(PseudoField.ROW_VERSION.getFieldName()), new Comparisons.SimpleComparison(Comparisons.Type.GREATER_THAN, versionForQuery))))); } - List queried = typedStore.executeQuery(plan) + List queried = executeQuery(typedStore, plan) .map(rec -> rec.getRecord().getRecNo()) .asList() .join(); @@ -427,9 +429,9 @@ void sortFilterOnVersionIndexEntries() { .where(queryComponents(exactly(equalsObject(Query.version().notEquals(excludedVersion)))))); } else { assertMatchesExactly(plan, predicatesFilterPlan(indexPlanMatcher) - .where(predicates(valuePredicate(versionValue(), new Comparisons.SimpleComparison(Comparisons.Type.NOT_EQUALS, excludedVersion))))); + .where(predicates(valuePredicate(fieldValueWithFieldNames(PseudoField.ROW_VERSION.getFieldName()), new Comparisons.SimpleComparison(Comparisons.Type.NOT_EQUALS, excludedVersion))))); } - List> queried = typedStore.executeQuery(plan) + List> queried = executeQuery(typedStore, plan) .map(FDBQueriedRecord::getStoredRecord) .asList() .join(); @@ -493,7 +495,7 @@ void versionGraphQuery() { graphExpansionBuilder.addQuantifier(qun); var recNoValue = FieldValue.ofFieldName(qun.getFlowedObjectValue(), "rec_no"); - var versionValue = new VersionValue(QuantifiedRecordValue.of(qun)); + var versionValue = FieldValue.ofFieldName(qun.getFlowedObjectValue(), PseudoField.ROW_VERSION.getFieldName()); graphExpansionBuilder.addResultColumn(resultColumn(versionValue, "version")); graphExpansionBuilder.addResultColumn(resultColumn(recNoValue, "number")); @@ -509,7 +511,7 @@ void versionGraphQuery() { .where(indexName("versionIndex")) .and(scanComparisons(unbounded())) ) - .where(mapResult(recordConstructorValue(exactly(versionValue(), fieldValueWithFieldNames("rec_no")))))); + .where(mapResult(recordConstructorValue(exactly(fieldValueWithFieldNames(PseudoField.ROW_VERSION.getFieldName()), fieldValueWithFieldNames("rec_no")))))); FDBRecordVersion previousVersion = null; try (RecordCursor cursor = executeCascades(recordStore, plan)) { @@ -557,7 +559,7 @@ void versionInSubSelectQuery() { innerGraphBuilder.addQuantifier(qun); var recNoValue = FieldValue.ofFieldName(qun.getFlowedObjectValue(), "rec_no"); - var versionValue = new VersionValue(QuantifiedRecordValue.of(qun)); + var versionValue = FieldValue.ofFieldName(qun.getFlowedObjectValue(), PseudoField.ROW_VERSION.getFieldName()); innerGraphBuilder.addResultColumn(resultColumn(versionValue, "version")); innerGraphBuilder.addResultColumn(resultColumn(recNoValue, "number")); @@ -580,7 +582,7 @@ void versionInSubSelectQuery() { indexPlan() .where(indexName("versionIndex")) .and(scanComparisons(range("([null],[" + versionForQuery.toVersionstamp() + "]]"))) - ).where(mapResult(recordConstructorValue(exactly(versionValue(), fieldValueWithFieldNames("rec_no")))))); + ).where(mapResult(recordConstructorValue(exactly(fieldValueWithFieldNames(PseudoField.ROW_VERSION.getFieldName()), fieldValueWithFieldNames("rec_no")))))); Set expectedNumbers = records.stream() .filter(rec -> rec.getVersion() != null && rec.getVersion().compareTo(versionForQuery) <= 0) @@ -602,6 +604,13 @@ void versionInSubSelectQuery() { } } + private RecordCursor> executeQuery(@Nonnull FDBRecordStoreBase typedStore, @Nonnull RecordQueryPlan plan) { + final TypeRepository typeRepository = TypeRepository.newBuilder() + .addAllTypes(UsedTypesProperty.usedTypes().evaluate(plan)) + .build(); + return plan.execute(typedStore, EvaluationContext.forTypeRepository(typeRepository), null, ExecuteProperties.SERIAL_EXECUTE); + } + private static void assertInVersionOrder(List> records) { FDBRecordVersion lastVersion = null; for (FDBRecord rec : records) { diff --git a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/GroupByTest.java b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/GroupByTest.java index 8f444e1a28..6ab7b4edb1 100644 --- a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/GroupByTest.java +++ b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/GroupByTest.java @@ -284,7 +284,7 @@ private Reference constructGroupByPlan(final boolean withPredicateInSelectWhere, qun = Quantifier.forEach(Reference.initialOf( new LogicalTypeFilterExpression(ImmutableSet.of("MySimpleRecord"), qun, - Type.Record.fromDescriptor(TestRecords1Proto.MySimpleRecord.getDescriptor())))); + recordStore.getRecordMetaData().getPlannerType("MySimpleRecord")))); final var num2Value = FieldValue.ofFieldName(qun.getFlowedObjectValue(), "num_value_2"); final var strValueIndexed = FieldValue.ofFieldName(qun.getFlowedObjectValue(), "str_value_indexed"); @@ -556,7 +556,7 @@ private Reference constructBitmapGroupByPlan(int bucketSize, boolean zeroGroup) qun = Quantifier.forEach(Reference.initialOf( new LogicalTypeFilterExpression(ImmutableSet.of("MySimpleRecord"), qun, - Type.Record.fromDescriptor(TestRecords1Proto.MySimpleRecord.getDescriptor())))); + recordStore.getRecordMetaData().getPlannerType(allRecordTypes)))); final var scanAlias = qun.getAlias(); final LiteralValue bucketSizeValue = new LiteralValue<>(Type.primitiveType(Type.TypeCode.INT), bucketSize); diff --git a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/SparseIndexTest.java b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/SparseIndexTest.java index aafcba8b58..9fb0749ba9 100644 --- a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/SparseIndexTest.java +++ b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/SparseIndexTest.java @@ -172,7 +172,7 @@ private static Reference constructQueryWithPredicate(boolean addPredicate) { qun = Quantifier.forEach(Reference.initialOf( new LogicalTypeFilterExpression(ImmutableSet.of("MySimpleRecord"), qun, - Type.Record.fromDescriptor(TestRecords1Proto.MySimpleRecord.getDescriptor())))); + Type.Record.fromDescriptor(TestRecords1Proto.MySimpleRecord.getDescriptor()).addPseudoFields()))); final var num2Value = FieldValue.ofFieldName(qun.getFlowedObjectValue(), "num_value_2"); final var queryBuilder = GraphExpansion.builder(); diff --git a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/query/plan/cascades/TypeTest.java b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/query/plan/cascades/TypeTest.java index 1d3ed6b1e2..ddeacec7c8 100644 --- a/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/query/plan/cascades/TypeTest.java +++ b/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/query/plan/cascades/TypeTest.java @@ -27,8 +27,10 @@ import com.apple.foundationdb.record.TestRecords4Proto; import com.apple.foundationdb.record.TestRecords4WrapperProto; import com.apple.foundationdb.record.TestRecordsUuidProto; +import com.apple.foundationdb.record.TestRecordsWithHeaderProto; import com.apple.foundationdb.record.TupleFieldsProto; import com.apple.foundationdb.record.TypeTestProto; +import com.apple.foundationdb.record.evolution.TestHeaderAsGroupProto; import com.apple.foundationdb.record.planprotos.PType; import com.apple.foundationdb.record.query.plan.cascades.typing.Type; import com.apple.foundationdb.record.query.plan.cascades.typing.TypeRepository; @@ -561,6 +563,28 @@ void createEnumProtobuf(@Nonnull Type.Enum enumType, @Nullable String expectedSt .isEqualTo(enumType); } + @Test + void translatesGroupTypeAsRecord() { + final Type.Record fromGroup = Type.Record.fromDescriptor(TestHeaderAsGroupProto.MyRecord.getDescriptor()); + final Type.Record fromNested = Type.Record.fromDescriptor(TestRecordsWithHeaderProto.MyRecord.getDescriptor()); + + assertThat(fromGroup) + .isEqualTo(fromNested) + .hasSameHashCodeAs(fromNested); + + final Type.Record headerType = Type.Record.fromFields(false, ImmutableList.of( + Type.Record.Field.of(Type.primitiveType(Type.TypeCode.LONG, false), Optional.of("rec_no")), + Type.Record.Field.of(Type.primitiveType(Type.TypeCode.STRING, false), Optional.of("path")), + Type.Record.Field.of(Type.primitiveType(Type.TypeCode.INT, true), Optional.of("num")) + )); + + assertThat(fromGroup.getFieldNameFieldMap()) + .hasEntrySatisfying("header", field -> + assertThat(field.getFieldType()) + .isEqualTo(headerType) + .hasSameHashCodeAs(headerType)); + } + @ParameterizedTest(name = "enumEqualsIgnoresName[{0}]") @MethodSource("enumTypes") void enumEqualsIgnoresName(@Nonnull Type.Enum enumType) { diff --git a/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/recordlayer/query/IndexGenerator.java b/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/recordlayer/query/IndexGenerator.java index 8695c4a9e3..e23c8bac73 100644 --- a/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/recordlayer/query/IndexGenerator.java +++ b/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/recordlayer/query/IndexGenerator.java @@ -50,6 +50,7 @@ import com.apple.foundationdb.record.query.plan.cascades.expressions.SelectExpression; import com.apple.foundationdb.record.query.plan.cascades.predicates.AndPredicate; import com.apple.foundationdb.record.query.plan.cascades.predicates.QueryPredicate; +import com.apple.foundationdb.record.query.plan.cascades.typing.PseudoField; import com.apple.foundationdb.record.query.plan.cascades.typing.Type; import com.apple.foundationdb.record.query.plan.cascades.values.AggregateValue; import com.apple.foundationdb.record.query.plan.cascades.values.ArithmeticValue; @@ -176,7 +177,7 @@ public RecordLayerIndex generate(@Nonnull RecordLayerSchemaTemplate.Builder sche Assert.thatUnchecked(simplifiedValues.stream().allMatch(sv -> sv instanceof FieldValue || sv instanceof IndexableAggregateValue || sv instanceof VersionValue || sv instanceof ArithmeticValue)); final var aggregateValues = simplifiedValues.stream().filter(sv -> sv instanceof IndexableAggregateValue).collect(toList()); final var fieldValues = simplifiedValues.stream().filter(sv -> !(sv instanceof IndexableAggregateValue)).collect(toList()); - final var versionValues = simplifiedValues.stream().filter(sv -> sv instanceof VersionValue).map(sv -> (VersionValue) sv).collect(toList()); + final var versionValues = simplifiedValues.stream().filter(sv -> sv instanceof FieldValue && sv.getResultType().equals(PseudoField.ROW_VERSION.getType())).collect(toList()); Assert.thatUnchecked(versionValues.size() <= 1, ErrorCode.UNSUPPORTED_OPERATION, "Cannot have index with more than one version column"); final Map orderingFunctions = new IdentityHashMap<>(); final var orderByValues = getOrderByValues(relationalExpression, orderingFunctions); @@ -531,7 +532,7 @@ private KeyExpression toKeyExpression(@Nonnull Value value) { if (value instanceof VersionValue) { return VersionKeyExpression.VERSION; } else if (value instanceof FieldValue) { - FieldValue fieldValue = (FieldValue) value; + final FieldValue fieldValue = (FieldValue) value; return toKeyExpression(fieldValue.getFieldPath().getFieldAccessors().iterator()); } else if (value instanceof ArithmeticValue) { var children = value.getChildren(); @@ -567,15 +568,16 @@ private static KeyExpression toKeyExpression(@Nonnull FieldValueTrieNode trieNod final var exprConstituents = childrenMap.entrySet().stream().map(nodeEntry -> { final FieldValue.ResolvedAccessor accessor = nodeEntry.getKey(); final FieldValueTrieNode node = nodeEntry.getValue(); - final FieldKeyExpression fieldExpr = toFieldKeyExpression(accessor.getField()); + final KeyExpression expr = toFieldKeyExpression(accessor.getField()); if (node.getChildrenMap() != null) { + final FieldKeyExpression fieldExpr = Assert.castUnchecked(expr, FieldKeyExpression.class); return fieldExpr.nest(toKeyExpression(node, orderingFunctions)); } else if (orderingFunctions.containsKey(node.getValue())) { - return function(orderingFunctions.get(node.getValue()), fieldExpr); + return function(orderingFunctions.get(node.getValue()), expr); } else { - return fieldExpr; + return expr; } - }).map(v -> (KeyExpression) v).collect(toList()); + }).collect(toList()); if (exprConstituents.size() == 1) { return exprConstituents.get(0); } else { @@ -745,12 +747,13 @@ private Value dereference(@Nonnull Value value) { private KeyExpression toKeyExpression(@Nonnull Iterator resolvedAccessors) { Assert.thatUnchecked(resolvedAccessors.hasNext(), "cannot resolve empty list"); final Type.Record.Field field = resolvedAccessors.next().getField(); - final FieldKeyExpression fieldExpression = toFieldKeyExpression(field); + final KeyExpression expression = toFieldKeyExpression(field); if (resolvedAccessors.hasNext()) { KeyExpression childExpression = toKeyExpression(resolvedAccessors); + final FieldKeyExpression fieldExpression = Assert.castUnchecked(expression, FieldKeyExpression.class); return fieldExpression.nest(childExpression); } else { - return fieldExpression; + return expression; } } @@ -767,11 +770,14 @@ private String getRecordTypeName() { } @Nonnull - private static FieldKeyExpression toFieldKeyExpression(@Nonnull Type.Record.Field fieldType) { + private static KeyExpression toFieldKeyExpression(@Nonnull Type.Record.Field fieldType) { Assert.notNullUnchecked(fieldType.getFieldStorageName()); final var fanType = fieldType.getFieldType().getTypeCode() == Type.TypeCode.ARRAY ? KeyExpression.FanType.FanOut : KeyExpression.FanType.None; + if (PseudoField.ROW_VERSION.getType().equals(fieldType.getFieldType()) && PseudoField.ROW_VERSION.getFieldName().equals(fieldType.getFieldName())) { + return VersionKeyExpression.VERSION; + } // At this point, we need to use the storage field name as that will be the name referenced // in Protobuf storage return field(fieldType.getFieldStorageName(), fanType); diff --git a/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/recordlayer/query/LogicalOperator.java b/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/recordlayer/query/LogicalOperator.java index 0f596a8750..a7c4603313 100644 --- a/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/recordlayer/query/LogicalOperator.java +++ b/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/recordlayer/query/LogicalOperator.java @@ -239,7 +239,10 @@ public static LogicalOperator generateTableAccess(@Nonnull Identifier tableId, new Type.AnyRecord(false), new AccessHints(indexAccessHints.toArray(new AccessHint[0]))))); final var table = semanticAnalyzer.getTable(tableId); - final Type.Record type = Assert.castUnchecked(table, RecordLayerTable.class).getType(); + Type.Record type = Assert.castUnchecked(table, RecordLayerTable.class).getType(); + if (semanticAnalyzer.getMetadataCatalog().isStoreRowVersions()) { + type = type.addPseudoFields(); + } final String storageName = type.getStorageName(); Assert.thatUnchecked(storageName != null, "storage name for table access must not be null"); final var typeFilterExpression = new LogicalTypeFilterExpression(ImmutableSet.of(storageName), scanExpression, type); @@ -397,14 +400,8 @@ public static LogicalOperator generateSimpleSelect(@Nonnull Expressions output, }); final var expandedOutput = output.expanded(); SelectExpression selectExpression; - - if (canAvoidProjectingIndividualFields(output, logicalOperators)) { - final var passedThroughResultValue = Iterables.getOnlyElement(output).getUnderlying(); - selectExpression = selectBuilder.build().buildSelectWithResultValue(passedThroughResultValue); - } else { - expandedOutput.underlyingAsColumns().forEach(selectBuilder::addResultColumn); - selectExpression = selectBuilder.build().buildSelect(); - } + expandedOutput.underlyingAsColumns().forEach(selectBuilder::addResultColumn); + selectExpression = selectBuilder.build().buildSelect(); final var resultingQuantifier = Quantifier.forEach(Reference.initialOf(selectExpression)); var resultingExpressions = expandedOutput.rewireQov(resultingQuantifier.getFlowedObjectValue()); @@ -412,35 +409,6 @@ public static LogicalOperator generateSimpleSelect(@Nonnull Expressions output, return LogicalOperator.newOperator(alias, resultingExpressions, resultingQuantifier); } - /** - * Determine whether it is possible to skip projection of individual columns of the underlying quantifier. This is - * to avoid unnecessary "breaking" a record constructor value unnecessarily when the user issues a query as simple - * as {@code SELECT * FROM T}. - *
- * It can be thought of as a premature optimization considering and should be done by the optimizer during an initial - * plan canonicalization phase. - * - * @param output the {@link LogicalOperator}'s output. - * @param logicalOperators The underlying logical operators. - * @return {@code true} if projecting individual columns of the underlying quantifier can be avoided, otherwise - * {@code false}. - */ - private static boolean canAvoidProjectingIndividualFields(@Nonnull Expressions output, - @Nonnull LogicalOperators logicalOperators) { - return // no joins - Iterables.size(logicalOperators.forEachOnly()) == 1 && - // must be a Star expression - Iterables.size(output) == 1 && - Iterables.getOnlyElement(output) instanceof Star && - // special case for CTEs where it is possible that a Star is referencing aliased columns of a named query - // if these columns are aliased differently from the underlying query fragment, then we can only avoid - // projecting individual columns (and lose their aliases) if and only if their names pairwise match the - // underlying query fragment columns. - output.expanded().stream().allMatch(expression -> expression.getName().isEmpty() || - (expression.getUnderlying() instanceof FieldValue && - ((FieldValue) expression.getUnderlying()).getLastFieldName().equals(expression.getName().map(Identifier::getName)))); - } - @Nonnull public static LogicalOperator generateSort(@Nonnull LogicalOperator logicalOperator, @Nonnull List orderBys, diff --git a/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/recordlayer/query/PseudoColumn.java b/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/recordlayer/query/PseudoColumn.java index 48f2f7bba0..0f73301a27 100644 --- a/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/recordlayer/query/PseudoColumn.java +++ b/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/recordlayer/query/PseudoColumn.java @@ -21,9 +21,8 @@ package com.apple.foundationdb.relational.recordlayer.query; import com.apple.foundationdb.record.query.plan.cascades.Quantifier; -import com.apple.foundationdb.record.query.plan.cascades.values.QuantifiedRecordValue; +import com.apple.foundationdb.record.query.plan.cascades.values.FieldValue; import com.apple.foundationdb.record.query.plan.cascades.values.Value; -import com.apple.foundationdb.record.query.plan.cascades.values.VersionValue; import javax.annotation.Nonnull; import java.util.Objects; @@ -34,7 +33,7 @@ * Contains a set of utility methods that are relevant for parsing the AST. */ public enum PseudoColumn { - ROW_VERSION(qun -> new VersionValue(QuantifiedRecordValue.of(qun))), + ROW_VERSION(qun -> FieldValue.ofFieldNameAndFuseIfPossible(qun.getFlowedObjectValue(), "__ROW_VERSION")), ; private static final String PREFIX = "__"; diff --git a/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/recordlayer/query/SemanticAnalyzer.java b/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/recordlayer/query/SemanticAnalyzer.java index e28d62dfb5..4b7b697e82 100644 --- a/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/recordlayer/query/SemanticAnalyzer.java +++ b/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/recordlayer/query/SemanticAnalyzer.java @@ -225,6 +225,11 @@ public boolean functionExists(@Nonnull final Identifier functionIdentifier) { return functionCatalog.containsFunction(functionIdentifier.getName()); } + @Nonnull + public SchemaTemplate getMetadataCatalog() { + return metadataCatalog; + } + @Nonnull public Table getTable(@Nonnull Identifier tableIdentifier) { Assert.thatUnchecked(tableIdentifier.getQualifier().size() <= 1, ErrorCode.INTERNAL_ERROR, () -> String.format(Locale.ROOT, "Unknown table %s", tableIdentifier)); diff --git a/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/recordlayer/query/visitors/ExpressionVisitor.java b/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/recordlayer/query/visitors/ExpressionVisitor.java index c374dd1105..bb8b31b433 100644 --- a/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/recordlayer/query/visitors/ExpressionVisitor.java +++ b/fdb-relational-core/src/main/java/com/apple/foundationdb/relational/recordlayer/query/visitors/ExpressionVisitor.java @@ -787,13 +787,13 @@ public Expression visitRecordConstructor(@Nonnull RelationalParser.RecordConstru return expression.withUnderlying(resultValue); } else { final var star = getDelegate().getSemanticAnalyzer().expandStar(Optional.of(id), getDelegate().getLogicalOperators()); - final var resultValue = star.getUnderlying(); + final var resultValue = RecordConstructorValue.ofColumns(Expressions.of(star.getExpansion()).underlyingAsColumns()); return Expression.ofUnnamed(resultValue); } } if (ctx.STAR() != null) { final var star = getDelegate().getSemanticAnalyzer().expandStar(Optional.empty(), getDelegate().getLogicalOperators()); - final var resultValue = star.getUnderlying(); + final var resultValue = RecordConstructorValue.ofColumns(Expressions.of(star.getExpansion()).underlyingAsColumns()); return Expression.ofUnnamed(resultValue); } final var expressions = parseRecordFieldsUnderReorderings(ctx.expressionWithOptionalName()); diff --git a/fdb-relational-core/src/test/java/com/apple/foundationdb/relational/api/ddl/DdlStatementParsingTest.java b/fdb-relational-core/src/test/java/com/apple/foundationdb/relational/api/ddl/DdlStatementParsingTest.java index 6164015b59..db94d47197 100644 --- a/fdb-relational-core/src/test/java/com/apple/foundationdb/relational/api/ddl/DdlStatementParsingTest.java +++ b/fdb-relational-core/src/test/java/com/apple/foundationdb/relational/api/ddl/DdlStatementParsingTest.java @@ -318,6 +318,17 @@ public ConstantAction getSaveSchemaTemplateConstantAction(@Nonnull final SchemaT } } + @Test + void versionColumnTypeNotSupported() throws Exception { + // The Relational Type hierarchy supports fields with type "version", and it's the type associated with the + // built-in pseudo-field "__ROW_VERSION" if store_row_versions is enabled. This test validates that we can't + // create a column with this version type. If we did, we'd have to worry a little bit about the user creating + // a column that is called "__ROW_VERSION" and has type version, which would be indistinguishable from the + // pseudo-field. + final String stmt = "CREATE SCHEMA TEMPLATE test_template " + + "CREATE TABLE bar (id bigint, foo_field version, PRIMARY KEY(id))"; + shouldFailWith(stmt, ErrorCode.UNKNOWN_TYPE); + } @Test void failsToParseEmptyTemplateStatements() throws Exception { @@ -573,6 +584,35 @@ public ConstantAction getSaveSchemaTemplateConstantAction(@Nonnull SchemaTemplat }); } + @ParameterizedTest + @MethodSource("columnTypePermutations") + void createSchemaTemplatesWithRowVersions(List columns) throws Exception { + final String columnStatement = "CREATE SCHEMA TEMPLATE test_template " + + " CREATE TYPE AS STRUCT foo " + makeColumnDefinition(columns, false) + + " CREATE TABLE bar (col0 bigint, col1 foo, PRIMARY KEY(col0)) " + + " WITH OPTIONS(store_row_versions=true) "; + shouldWorkWithInjectedFactory(columnStatement, new AbstractMetadataOperationsFactory() { + @Nonnull + @Override + public ConstantAction getSaveSchemaTemplateConstantAction(@Nonnull SchemaTemplate template, + @Nonnull Options templateProperties) { + Assertions.assertEquals("test_template", template.getName(), "incorrect template name!"); + DdlTestUtil.ParsedSchema schema = new DdlTestUtil.ParsedSchema(getProtoDescriptor(template)); + Assertions.assertEquals(1, schema.getTables().size(), "Incorrect number of tables"); + Assertions.assertTrue(template.isStoreRowVersions(), "Schema template should store row versions"); + return txn -> { + try { + final DdlTestUtil.ParsedType type = schema.getType("foo"); + Assertions.assertFalse(type.getColumnStrings().contains("__ROW_VERSION"), "__ROW_VERSION column should not be in table definition"); + assertColumnsMatch(type, columns); + } catch (Exception ve) { + throw ExceptionUtil.toRelationalException(ve); + } + }; + } + }); + } + @ParameterizedTest @MethodSource("columnTypePermutations") void createSchemaTemplateTableWithOnlyRecordType(List columns) throws Exception { diff --git a/yaml-tests/src/test/java/YamlIntegrationTests.java b/yaml-tests/src/test/java/YamlIntegrationTests.java index 95cc5614c9..586dcf4cd2 100644 --- a/yaml-tests/src/test/java/YamlIntegrationTests.java +++ b/yaml-tests/src/test/java/YamlIntegrationTests.java @@ -242,6 +242,11 @@ public void primaryKey(YamlTest.Runner runner) throws Exception { runner.runYamsql("primary-key-tests.yamsql"); } + @TestTemplate + public void pseudoFieldClash(YamlTest.Runner runner) throws Exception { + runner.runYamsql("pseudo-field-clash.yamsql"); + } + @TestTemplate public void recursiveCte(YamlTest.Runner runner) throws Exception { runner.runYamsql("recursive-cte.yamsql"); diff --git a/yaml-tests/src/test/resources/between.metrics.binpb b/yaml-tests/src/test/resources/between.metrics.binpb index 1b0ef60cfc..dfc5a7c183 100644 --- a/yaml-tests/src/test/resources/between.metrics.binpb +++ b/yaml-tests/src/test/resources/between.metrics.binpb @@ -1,7 +1,7 @@ ï L between-index-tests5EXPLAIN select * from t1 WHERE col1 BETWEEN 10 AND 10ž -ÇêͳQ ÙÐÓ( 0ïï8#@cISCAN(I1 [[GREATER_THAN_OR_EQUALS promote(@c8 AS INT) && LESS_THAN_OR_EQUALS promote(@c8 AS INT)]])›digraph G { +çÖ¸ï X õû×(!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; @@ -11,7 +11,7 @@ L } P between-index-tests9EXPLAIN select * from t1 WHERE col1 + 5 BETWEEN 10 AND 20» -£á—„M àÜó(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 { +×Ϩè T ’Á…( 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; @@ -23,7 +23,7 @@ P }é T between-index-tests=EXPLAIN select * from t1 WHERE col1 + 5 NOT BETWEEN 10 AND 20 -£ŸÕ©N ¬Ñ÷(0£Ó!8!@tISCAN(I1 <,>) | FILTER _.COL1 + @c8 LESS_THAN promote(@c11 AS INT) OR _.COL1 + @c8 GREATER_THAN promote(@c13 AS INT)ü +ׯáû U Ö¨( 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; diff --git a/yaml-tests/src/test/resources/between.metrics.yaml b/yaml-tests/src/test/resources/between.metrics.yaml index 13e355affc..d74119bdbc 100644 --- a/yaml-tests/src/test/resources/between.metrics.yaml +++ b/yaml-tests/src/test/resources/between.metrics.yaml @@ -2,33 +2,33 @@ between-index-tests: - query: EXPLAIN select * from t1 WHERE col1 BETWEEN 10 AND 10 explain: ISCAN(I1 [[GREATER_THAN_OR_EQUALS promote(@c8 AS INT) && LESS_THAN_OR_EQUALS promote(@c8 AS INT)]]) - task_count: 327 - task_total_time_ms: 17 - transform_count: 81 + task_count: 359 + task_total_time_ms: 20 + transform_count: 88 transform_time_ms: 5 - transform_yield_count: 32 + transform_yield_count: 33 insert_time_ms: 0 - insert_new_count: 35 - insert_reused_count: 4 + insert_new_count: 38 + insert_reused_count: 3 - query: EXPLAIN select * from t1 WHERE col1 + 5 BETWEEN 10 AND 20 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: 291 - task_total_time_ms: 16 - transform_count: 77 + task_count: 343 + task_total_time_ms: 20 + transform_count: 84 transform_time_ms: 6 - transform_yield_count: 29 + transform_yield_count: 32 insert_time_ms: 0 - insert_new_count: 33 - insert_reused_count: 4 + insert_new_count: 38 + insert_reused_count: 2 - query: EXPLAIN select * from t1 WHERE col1 + 5 NOT BETWEEN 10 AND 20 explain: ISCAN(I1 <,>) | FILTER _.COL1 + @c8 LESS_THAN promote(@c11 AS INT) OR _.COL1 + @c8 GREATER_THAN promote(@c13 AS INT) - task_count: 291 - task_total_time_ms: 17 - transform_count: 78 + task_count: 343 + task_total_time_ms: 20 + transform_count: 85 transform_time_ms: 6 - transform_yield_count: 29 + transform_yield_count: 32 insert_time_ms: 0 - insert_new_count: 33 - insert_reused_count: 4 + insert_new_count: 38 + insert_reused_count: 2 diff --git a/yaml-tests/src/test/resources/distinct-from.metrics.binpb b/yaml-tests/src/test/resources/distinct-from.metrics.binpb index da07f9dbbe..3a8e7cdf5a 100644 --- a/yaml-tests/src/test/resources/distinct-from.metrics.binpb +++ b/yaml-tests/src/test/resources/distinct-from.metrics.binpb @@ -1,63 +1,63 @@ Ï U distinct-from-tests>EXPLAIN select * from t1 WHERE col2 is distinct from nullõ -²®îä k õöÊ(.0®Ý382@\COVERING(I2 <,> -> [COL2: KEY[0], ID: KEY[2]]) | FILTER _.COL2 IS_DISTINCT_FROM NULL | FETCHù digraph G { +˜‰€è{ ¢±©(30±‰/8:@\COVERING(I2 <,> -> [COL2: KEY[0], ID: KEY[2]]) | FILTER _.COL2 IS_DISTINCT_FROM NULL | FETCHù 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(INT AS ID, INT AS COL1, INT AS COL2)" ]; - 2 [ label=<
Predicate Filter
WHERE q61.COL2 IS_DISTINCT_FROM NULL
> 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=<
Predicate Filter
WHERE q88.COL2 IS_DISTINCT_FROM NULL
> 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=<
Covering 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)" ]; 4 [ label=<
Index
I2
> 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 [ label=< q61> label="q61" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 3 -> 2 [ label=< q88> label="q88" 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=< q63> label="q63" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}è + 2 -> 1 [ label=< q90> label="q90" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}é N -distinct-from-tests7EXPLAIN select * from t1 WHERE col1 is DISTINCT from 10• -™þƒ p ·§Ü(00¶½986@lCOVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER _.COL1 IS_DISTINCT_FROM promote(@c10 AS INT) | FETCH‰digraph G { +distinct-from-tests7EXPLAIN select * from t1 WHERE col1 is DISTINCT from 10– +¨ƒ°€ ”¢¢(50àž18>@lCOVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER _.COL1 IS_DISTINCT_FROM promote(@c10 AS INT) | FETCH‰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(INT AS ID, INT AS COL1, INT AS COL2)" ]; - 2 [ label=<
Predicate Filter
WHERE q61.COL1 IS_DISTINCT_FROM promote(@c10 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=<
Predicate Filter
WHERE q87.COL1 IS_DISTINCT_FROM promote(@c10 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)" ]; 3 [ label=<
Covering 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)" ]; 4 [ 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 [ label=< q61> label="q61" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 3 -> 2 [ label=< q87> label="q87" 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=< q63> label="q63" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q89> label="q89" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; }Ê P distinct-from-tests9EXPLAIN select * from t1 WHERE null is distinct from col2õ -²±½ì k °Ä(.0„®682@\COVERING(I2 <,> -> [COL2: KEY[0], ID: KEY[2]]) | FILTER _.COL2 IS_DISTINCT_FROM NULL | FETCHù digraph G { +˜䦋{ 韲(30Ÿ/8:@\COVERING(I2 <,> -> [COL2: KEY[0], ID: KEY[2]]) | FILTER _.COL2 IS_DISTINCT_FROM NULL | FETCHù 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(INT AS ID, INT AS COL1, INT AS COL2)" ]; - 2 [ label=<
Predicate Filter
WHERE q61.COL2 IS_DISTINCT_FROM NULL
> 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=<
Predicate Filter
WHERE q88.COL2 IS_DISTINCT_FROM NULL
> 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=<
Covering 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)" ]; 4 [ label=<
Index
I2
> 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 [ label=< q61> label="q61" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 3 -> 2 [ label=< q88> label="q88" 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=< q63> label="q63" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q90> label="q90" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; }ç N distinct-from-tests7EXPLAIN select * from t1 WHERE 10 is distinct from col1” -‚­’ p ð´à(00‡æ·86@kCOVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER _.COL1 IS_DISTINCT_FROM promote(@c6 AS INT) | FETCHˆdigraph G { +¨Ðêÿ€ ´¢¥(50ò¶08>@kCOVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER _.COL1 IS_DISTINCT_FROM promote(@c6 AS INT) | FETCHˆ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(INT AS ID, INT AS COL1, INT AS COL2)" ]; - 2 [ label=<
Predicate Filter
WHERE q61.COL1 IS_DISTINCT_FROM promote(@c6 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=<
Predicate Filter
WHERE q87.COL1 IS_DISTINCT_FROM promote(@c6 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)" ]; 3 [ label=<
Covering 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)" ]; 4 [ 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 [ label=< q61> label="q61" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 3 -> 2 [ label=< q87> label="q87" 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=< q63> label="q63" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}Ä + 2 -> 1 [ label=< q89> label="q89" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}Å P -distinct-from-tests9EXPLAIN select * from t1 WHERE null is distinct from nullï -Ù›˜’ p ±àÀ(00»¨;88@ZCOVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER NULL IS_DISTINCT_FROM NULL | FETCHõ digraph G { +distinct-from-tests9EXPLAIN select * from t1 WHERE null is distinct from nullð +ÜÂ句 ø‡—(60ê§18A@ZCOVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER NULL IS_DISTINCT_FROM NULL | FETCHõ digraph G { fontname=courier; rankdir=BT; splines=polyline; @@ -65,13 +65,13 @@ P 2 [ label=<
Predicate Filter
WHERE NULL IS_DISTINCT_FROM NULL
> 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=<
Covering 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)" ]; 4 [ 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 [ label=< q60> label="q60" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 3 -> 2 [ label=< q90> label="q90" 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=< q62> label="q62" color="gray20" style="bold" 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" ]; +}½ L -distinct-from-tests5EXPLAIN select * from t1 WHERE 10 is distinct from 10ë -Ù†¾¤ p ÝÒ(00€¶=88@XCOVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER @c6 IS_DISTINCT_FROM @c6 | FETCHó digraph G { +distinct-from-tests5EXPLAIN select * from t1 WHERE 10 is distinct from 10ì +Ü–ÊᆠáÖÝ(60ãÆ(8A@XCOVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER @c6 IS_DISTINCT_FROM @c6 | FETCHó digraph G { fontname=courier; rankdir=BT; splines=polyline; @@ -79,67 +79,65 @@ L 2 [ label=<
Predicate Filter
WHERE @c6 IS_DISTINCT_FROM @c6
> 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=<
Covering 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)" ]; 4 [ 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 [ label=< q60> label="q60" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 3 -> 2 [ label=< q90> label="q90" 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=< q62> label="q62" color="gray20" style="bold" 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" ]; }Ù ] not-distinct-from-testsBEXPLAIN select * from t1 WHERE col2 is not distinct from null÷ -²óÁô -j Š€Î(.0ø¢682@]COVERING(I2 <,> -> [COL2: KEY[0], ID: KEY[2]]) | FILTER _.COL2 NOT_DISTINCT_FROM NULL | FETCHú digraph G { +˜Ê㈠y öø®(30óà08:@]COVERING(I2 <,> -> [COL2: KEY[0], ID: KEY[2]]) | FILTER _.COL2 NOT_DISTINCT_FROM NULL | FETCHú 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(INT AS ID, INT AS COL1, INT AS COL2)" ]; - 2 [ label=<
Predicate Filter
WHERE q61.COL2 NOT_DISTINCT_FROM NULL
> 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=<
Predicate Filter
WHERE q88.COL2 NOT_DISTINCT_FROM NULL
> 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=<
Covering 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)" ]; 4 [ label=<
Index
I2
> 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 [ label=< q61> label="q61" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 3 -> 2 [ label=< q88> label="q88" 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=< q63> label="q63" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q90> label="q90" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; }ò V not-distinct-from-tests;EXPLAIN select * from t1 WHERE col1 is not distinct from 20— -ÂçØ× o —ùó(00¸¬>86@mCOVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER _.COL1 NOT_DISTINCT_FROM promote(@c11 AS INT) | FETCHŠdigraph G { +¨‘ŸÎ~ ‹ü‹(50ˆ÷/8>@mCOVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER _.COL1 NOT_DISTINCT_FROM promote(@c11 AS INT) | FETCHŠ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(INT AS ID, INT AS COL1, INT AS COL2)" ]; - 2 [ label=<
Predicate Filter
WHERE q61.COL1 NOT_DISTINCT_FROM promote(@c11 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=<
Predicate Filter
WHERE q87.COL1 NOT_DISTINCT_FROM promote(@c11 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)" ]; 3 [ label=<
Covering 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)" ]; 4 [ 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 [ label=< q61> label="q61" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 3 -> 2 [ label=< q87> label="q87" 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=< q63> label="q63" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q89> label="q89" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; }Ô X not-distinct-from-tests=EXPLAIN select * from t1 WHERE null is not distinct from col2÷ -²¡øñ -j §’Î(.0ó†782@]COVERING(I2 <,> -> [COL2: KEY[0], ID: KEY[2]]) | FILTER _.COL2 NOT_DISTINCT_FROM NULL | FETCHú digraph G { +˜“Ÿ·y ´Þž(30öš+8:@]COVERING(I2 <,> -> [COL2: KEY[0], ID: KEY[2]]) | FILTER _.COL2 NOT_DISTINCT_FROM NULL | FETCHú 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(INT AS ID, INT AS COL1, INT AS COL2)" ]; - 2 [ label=<
Predicate Filter
WHERE q61.COL2 NOT_DISTINCT_FROM NULL
> 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=<
Predicate Filter
WHERE q88.COL2 NOT_DISTINCT_FROM NULL
> 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=<
Covering 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)" ]; 4 [ label=<
Index
I2
> 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 [ label=< q61> label="q61" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 3 -> 2 [ label=< q88> label="q88" 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=< q63> label="q63" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q90> label="q90" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; }ð V not-distinct-from-tests;EXPLAIN select * from t1 WHERE 20 is not distinct from col1• -¬ǵ o æÌë(00¾¼=86@lCOVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER _.COL1 NOT_DISTINCT_FROM promote(@c6 AS INT) | FETCH‰digraph G { +¨æÅ~ ŽÕÀ(50Ü–48>@lCOVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER _.COL1 NOT_DISTINCT_FROM promote(@c6 AS INT) | FETCH‰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(INT AS ID, INT AS COL1, INT AS COL2)" ]; - 2 [ label=<
Predicate Filter
WHERE q61.COL1 NOT_DISTINCT_FROM promote(@c6 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=<
Predicate Filter
WHERE q87.COL1 NOT_DISTINCT_FROM promote(@c6 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)" ]; 3 [ label=<
Covering 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)" ]; 4 [ 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 [ label=< q61> label="q61" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 3 -> 2 [ label=< q87> label="q87" 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=< q63> label="q63" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q89> label="q89" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; }ô _ not-distinct-from-testsDEXPLAIN select count(*) from t1 WHERE null is not distinct from null diff --git a/yaml-tests/src/test/resources/distinct-from.metrics.yaml b/yaml-tests/src/test/resources/distinct-from.metrics.yaml index c04901f313..42930eb65f 100644 --- a/yaml-tests/src/test/resources/distinct-from.metrics.yaml +++ b/yaml-tests/src/test/resources/distinct-from.metrics.yaml @@ -2,114 +2,114 @@ distinct-from-tests: - query: EXPLAIN select * from t1 WHERE col2 is distinct from null explain: 'COVERING(I2 <,> -> [COL2: KEY[0], ID: KEY[2]]) | FILTER _.COL2 IS_DISTINCT_FROM NULL | FETCH' - task_count: 434 - task_total_time_ms: 24 - transform_count: 107 - transform_time_ms: 7 - transform_yield_count: 46 + task_count: 536 + task_total_time_ms: 31 + transform_count: 123 + transform_time_ms: 9 + transform_yield_count: 51 insert_time_ms: 0 - insert_new_count: 50 - insert_reused_count: 7 + insert_new_count: 58 + insert_reused_count: 3 - query: EXPLAIN select * from t1 WHERE col1 is DISTINCT from 10 explain: 'COVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER _.COL1 IS_DISTINCT_FROM promote(@c10 AS INT) | FETCH' - task_count: 450 - task_total_time_ms: 25 - transform_count: 112 - transform_time_ms: 7 - transform_yield_count: 48 + task_count: 552 + task_total_time_ms: 31 + transform_count: 128 + transform_time_ms: 8 + transform_yield_count: 53 insert_time_ms: 0 - insert_new_count: 54 - insert_reused_count: 7 + insert_new_count: 62 + insert_reused_count: 3 - query: EXPLAIN select * from t1 WHERE null is distinct from col2 explain: 'COVERING(I2 <,> -> [COL2: KEY[0], ID: KEY[2]]) | FILTER _.COL2 IS_DISTINCT_FROM NULL | FETCH' - task_count: 434 - task_total_time_ms: 24 - transform_count: 107 - transform_time_ms: 7 - transform_yield_count: 46 + task_count: 536 + task_total_time_ms: 31 + transform_count: 123 + transform_time_ms: 9 + transform_yield_count: 51 insert_time_ms: 0 - insert_new_count: 50 - insert_reused_count: 7 + insert_new_count: 58 + insert_reused_count: 3 - query: EXPLAIN select * from t1 WHERE 10 is distinct from col1 explain: 'COVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER _.COL1 IS_DISTINCT_FROM promote(@c6 AS INT) | FETCH' - task_count: 450 - task_total_time_ms: 25 - transform_count: 112 - transform_time_ms: 7 - transform_yield_count: 48 - insert_time_ms: 3 - insert_new_count: 54 - insert_reused_count: 7 + task_count: 552 + task_total_time_ms: 31 + transform_count: 128 + transform_time_ms: 8 + transform_yield_count: 53 + insert_time_ms: 0 + insert_new_count: 62 + insert_reused_count: 3 - query: EXPLAIN select * from t1 WHERE null is distinct from null explain: 'COVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER NULL IS_DISTINCT_FROM NULL | FETCH' - task_count: 473 - task_total_time_ms: 25 - transform_count: 112 - transform_time_ms: 7 - transform_yield_count: 48 + task_count: 604 + task_total_time_ms: 32 + transform_count: 134 + transform_time_ms: 8 + transform_yield_count: 54 insert_time_ms: 0 - insert_new_count: 56 - insert_reused_count: 8 + insert_new_count: 65 + insert_reused_count: 3 - query: EXPLAIN select * from t1 WHERE 10 is distinct from 10 explain: 'COVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER @c6 IS_DISTINCT_FROM @c6 | FETCH' - task_count: 473 - task_total_time_ms: 25 - transform_count: 112 - transform_time_ms: 7 - transform_yield_count: 48 - insert_time_ms: 1 - insert_new_count: 56 - insert_reused_count: 8 + task_count: 604 + task_total_time_ms: 16 + transform_count: 134 + transform_time_ms: 5 + transform_yield_count: 54 + insert_time_ms: 0 + insert_new_count: 65 + insert_reused_count: 3 not-distinct-from-tests: - query: EXPLAIN select * from t1 WHERE col2 is not distinct from null explain: 'COVERING(I2 <,> -> [COL2: KEY[0], ID: KEY[2]]) | FILTER _.COL2 NOT_DISTINCT_FROM NULL | FETCH' - task_count: 434 - task_total_time_ms: 22 - transform_count: 106 - transform_time_ms: 7 - transform_yield_count: 46 + task_count: 536 + task_total_time_ms: 27 + transform_count: 121 + transform_time_ms: 9 + transform_yield_count: 51 insert_time_ms: 0 - insert_new_count: 50 - insert_reused_count: 7 + insert_new_count: 58 + insert_reused_count: 3 - query: EXPLAIN select * from t1 WHERE col1 is not distinct from 20 explain: 'COVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER _.COL1 NOT_DISTINCT_FROM promote(@c11 AS INT) | FETCH' - task_count: 450 - task_total_time_ms: 24 - transform_count: 111 + task_count: 552 + task_total_time_ms: 34 + transform_count: 126 transform_time_ms: 8 - transform_yield_count: 48 - insert_time_ms: 1 - insert_new_count: 54 - insert_reused_count: 7 + transform_yield_count: 53 + insert_time_ms: 0 + insert_new_count: 62 + insert_reused_count: 3 - query: EXPLAIN select * from t1 WHERE null is not distinct from col2 explain: 'COVERING(I2 <,> -> [COL2: KEY[0], ID: KEY[2]]) | FILTER _.COL2 NOT_DISTINCT_FROM NULL | FETCH' - task_count: 434 - task_total_time_ms: 22 - transform_count: 106 - transform_time_ms: 7 - transform_yield_count: 46 + task_count: 536 + task_total_time_ms: 34 + transform_count: 121 + transform_time_ms: 8 + transform_yield_count: 51 insert_time_ms: 0 - insert_new_count: 50 - insert_reused_count: 7 + insert_new_count: 58 + insert_reused_count: 3 - query: EXPLAIN select * from t1 WHERE 20 is not distinct from col1 explain: 'COVERING(I1 <,> -> [COL1: KEY[0], ID: KEY[2]]) | FILTER _.COL1 NOT_DISTINCT_FROM promote(@c6 AS INT) | FETCH' - task_count: 450 - task_total_time_ms: 23 - transform_count: 111 - transform_time_ms: 8 - transform_yield_count: 48 - insert_time_ms: 1 - insert_new_count: 54 - insert_reused_count: 7 + task_count: 552 + task_total_time_ms: 35 + transform_count: 126 + transform_time_ms: 9 + transform_yield_count: 53 + insert_time_ms: 0 + insert_new_count: 62 + insert_reused_count: 3 - query: EXPLAIN select count(*) from t1 WHERE null is not distinct from null explain: 'AISCAN(CNT <,> BY_GROUP -> [_0: VALUE:[0]]) | FILTER NULL NOT_DISTINCT_FROM NULL | MAP (_ AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l diff --git a/yaml-tests/src/test/resources/enum.metrics.binpb b/yaml-tests/src/test/resources/enum.metrics.binpb index 3b5bac65b0..533a3f3698 100644 --- a/yaml-tests/src/test/resources/enum.metrics.binpb +++ b/yaml-tests/src/test/resources/enum.metrics.binpb @@ -1,70 +1,78 @@ -Î +ó E -enum-tests7EXPLAIN SELECT * From TABLE_A where "mood" = 'CONFUSED'„ -»º÷˜0 †®±(0“¼88@£SCAN(<,>) | TFILTER TABLE_A | FILTER _.mood EQUALS promote(@c8 AS ENUM)Àdigraph G { +enum-tests7EXPLAIN SELECT * From TABLE_A where "mood" = 'CONFUSED'© +ÚÄè4 ‚„Ô(0‹ê8@ÖSCAN(<,>) | TFILTER TABLE_A | FILTER _.mood EQUALS promote(@c8 AS ENUM) | MAP (_.id AS id, _.name AS name, _.mood AS mood)²digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.mood EQUALS promote(@c8 AS ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)>)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS id, STRING AS name, ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)> AS mood)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TABLE_A]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS id, STRING AS name, ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)> AS mood)" ]; - 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: [TABLE_A, TABLE_B]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q19> label="q19" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}Ý + 1 [ label=<
Value Computation
MAP (q26.id AS id, q26.name AS name, q26.mood AS mood)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS id, STRING AS name, ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)> AS mood)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.mood EQUALS promote(@c8 AS ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)>)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS id, STRING AS name, ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)> AS mood)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TABLE_A]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS id, STRING AS name, ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)> AS mood)" ]; + 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: [TABLE_A, TABLE_B]
> 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=< q19> label="q19" 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=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}‚ H -enum-tests:EXPLAIN SELECT * From TABLE_A where "mood" > 'INDIFFERENT' -»Ò¨ÿ0 ©Îô(0´Ô8@©SCAN(<,>) | TFILTER TABLE_A | FILTER _.mood GREATER_THAN promote(@c8 AS ENUM)Ædigraph G { +enum-tests:EXPLAIN SELECT * From TABLE_A where "mood" > 'INDIFFERENT'µ +Ú¨ÊÎ4 ¿…À(0Øí8@ÜSCAN(<,>) | TFILTER TABLE_A | FILTER _.mood GREATER_THAN promote(@c8 AS ENUM) | MAP (_.id AS id, _.name AS name, _.mood AS mood)¸digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.mood GREATER_THAN promote(@c8 AS ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)>)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS id, STRING AS name, ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)> AS mood)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TABLE_A]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS id, STRING AS name, ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)> AS mood)" ]; - 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: [TABLE_A, TABLE_B]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q19> label="q19" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}ó + 1 [ label=<
Value Computation
MAP (q26.id AS id, q26.name AS name, q26.mood AS mood)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS id, STRING AS name, ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)> AS mood)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.mood GREATER_THAN promote(@c8 AS ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)>)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS id, STRING AS name, ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)> AS mood)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TABLE_A]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS id, STRING AS name, ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)> AS mood)" ]; + 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: [TABLE_A, TABLE_B]
> 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=< q19> label="q19" 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=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}— I -enum-tests;EXPLAIN SELECT * From TABLE_A where "mood" >= 'INDIFFERENT'¥ -»½ë’90 Òéæ,(0Óàµ8@³SCAN(<,>) | TFILTER TABLE_A | FILTER _.mood GREATER_THAN_OR_EQUALS promote(@c9 AS ENUM)Ðdigraph G { +enum-tests;EXPLAIN SELECT * From TABLE_A where "mood" >= 'INDIFFERENT'É +ÚÓà©4 ô²¦(0í¥@8@æSCAN(<,>) | TFILTER TABLE_A | FILTER _.mood GREATER_THAN_OR_EQUALS promote(@c9 AS ENUM) | MAP (_.id AS id, _.name AS name, _.mood AS mood)Âdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.mood GREATER_THAN_OR_EQUALS promote(@c9 AS ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)>)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS id, STRING AS name, ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)> AS mood)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TABLE_A]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS id, STRING AS name, ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)> AS mood)" ]; - 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: [TABLE_A, TABLE_B]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q19> label="q19" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}÷ + 1 [ label=<
Value Computation
MAP (q26.id AS id, q26.name AS name, q26.mood AS mood)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS id, STRING AS name, ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)> AS mood)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.mood GREATER_THAN_OR_EQUALS promote(@c9 AS ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)>)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS id, STRING AS name, ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)> AS mood)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TABLE_A]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS id, STRING AS name, ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)> AS mood)" ]; + 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: [TABLE_A, TABLE_B]
> 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=< q19> label="q19" 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=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}› A -enum-tests3EXPLAIN SELECT * From TABLE_A where "mood" < "mood"± -»—Õ90 €¬ú,(0Òȯ8@) | TFILTER TABLE_A | FILTER _.mood LESS_THAN _.moodÔdigraph G { +enum-tests3EXPLAIN SELECT * From TABLE_A where "mood" < "mood"Õ +Úûô÷4 ûáÄ(0÷8@oSCAN(<,>) | TFILTER TABLE_A | FILTER _.mood LESS_THAN _.mood | MAP (_.id AS id, _.name AS name, _.mood AS mood)Ædigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.mood LESS_THAN q2.mood
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS id, STRING AS name, ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)> AS mood)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TABLE_A]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS id, STRING AS name, ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)> AS mood)" ]; - 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: [TABLE_A, TABLE_B]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q19> label="q19" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}þ + 1 [ label=<
Value Computation
MAP (q26.id AS id, q26.name AS name, q26.mood AS mood)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS id, STRING AS name, ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)> AS mood)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.mood LESS_THAN q2.mood
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS id, STRING AS name, ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)> AS mood)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TABLE_A]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS id, STRING AS name, ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)> AS mood)" ]; + 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: [TABLE_A, TABLE_B]
> 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=< q19> label="q19" 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=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}ý E -enum-tests7EXPLAIN SELECT * From TABLE_B where "mood" = 'CONFUSED'´ +enum-tests7EXPLAIN SELECT * From TABLE_B where "mood" = 'CONFUSED'³ -ÏÖ¤©FM Í•7(0ŸÁ©8"@‡ISCAN(B$MOOD [EQUALS promote(@c8 AS ENUM)])‹ digraph G { +ï¥Áö S Ý‘(0‹ï68%@‡ISCAN(B$MOOD [EQUALS promote(@c8 AS ENUM)])‹ digraph G { fontname=courier; rankdir=BT; splines=polyline; @@ -76,26 +84,28 @@ H enum-tests:EXPLAIN SELECT * From TABLE_B where "mood" > 'INDIFFERENT'à -φٲ N ›¹’(0£øQ8"@ISCAN(B$MOOD [[GREATER_THAN promote(@c8 AS ENUM)]])“ digraph G { +ïî¬Ð U 樋(0€®r8%@ISCAN(B$MOOD [[GREATER_THAN promote(@c8 AS ENUM)]])“ digraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
Index Scan
comparisons: [[GREATER_THAN promote(@c8 AS ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)>)]]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS id, STRING AS name, ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)> AS mood)" ]; 2 [ label=<
Index
B$MOOD
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS id, STRING AS name, ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)> AS mood)" ]; 2 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}Û +}ÿ I -enum-tests;EXPLAIN SELECT * From TABLE_A where "mood" != 'INDIFFERENT' -»¬þˆ>0 íÖ–2(0ØÌ»8@§SCAN(<,>) | TFILTER TABLE_A | FILTER _.mood NOT_EQUALS promote(@c9 AS ENUM)Ädigraph G { +enum-tests;EXPLAIN SELECT * From TABLE_A where "mood" != 'INDIFFERENT'± +Ú«™4 œäà(0ðØ8@ÚSCAN(<,>) | TFILTER TABLE_A | FILTER _.mood NOT_EQUALS promote(@c9 AS ENUM) | MAP (_.id AS id, _.name AS name, _.mood AS mood)¶digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.mood NOT_EQUALS promote(@c9 AS ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)>)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS id, STRING AS name, ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)> AS mood)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TABLE_A]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS id, STRING AS name, ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)> AS mood)" ]; - 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: [TABLE_A, TABLE_B]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q19> label="q19" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 1 [ label=<
Value Computation
MAP (q26.id AS id, q26.name AS name, q26.mood AS mood)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS id, STRING AS name, ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)> AS mood)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.mood NOT_EQUALS promote(@c9 AS ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)>)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS id, STRING AS name, ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)> AS mood)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TABLE_A]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS id, STRING AS name, ENUM<JOYFUL(0), HAPPY(1), RELAXED(2), INDIFFERENT(3), CONFUSED(4), SAD(5), ANXIOUS(6), ANGRY(7)> AS mood)" ]; + 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: [TABLE_A, TABLE_B]
> 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=< q19> label="q19" 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=< q26> label="q26" 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/enum.metrics.yaml b/yaml-tests/src/test/resources/enum.metrics.yaml index 888637eb1f..c95fc88b72 100644 --- a/yaml-tests/src/test/resources/enum.metrics.yaml +++ b/yaml-tests/src/test/resources/enum.metrics.yaml @@ -2,79 +2,81 @@ enum-tests: - query: EXPLAIN SELECT * From TABLE_A where "mood" = 'CONFUSED' explain: SCAN(<,>) | TFILTER TABLE_A | FILTER _.mood EQUALS promote(@c8 AS ENUM) - task_count: 187 - task_total_time_ms: 12 - transform_count: 48 - transform_time_ms: 7 - transform_yield_count: 14 + | MAP (_.id AS id, _.name AS name, _.mood AS mood) + task_count: 218 + task_total_time_ms: 10 + transform_count: 52 + transform_time_ms: 3 + transform_yield_count: 16 insert_time_ms: 0 - insert_new_count: 17 - insert_reused_count: 2 + insert_new_count: 20 + insert_reused_count: 1 - query: EXPLAIN SELECT * From TABLE_A where "mood" > 'INDIFFERENT' explain: SCAN(<,>) | TFILTER TABLE_A | FILTER _.mood GREATER_THAN promote(@c8 AS ENUM) - task_count: 187 - task_total_time_ms: 14 - transform_count: 48 - transform_time_ms: 6 - transform_yield_count: 14 + ANXIOUS(6), ANGRY(7)>) | MAP (_.id AS id, _.name AS name, _.mood AS mood) + task_count: 218 + task_total_time_ms: 13 + transform_count: 52 + transform_time_ms: 5 + transform_yield_count: 16 insert_time_ms: 0 - insert_new_count: 17 - insert_reused_count: 2 + insert_new_count: 20 + insert_reused_count: 1 - query: EXPLAIN SELECT * From TABLE_A where "mood" >= 'INDIFFERENT' explain: SCAN(<,>) | TFILTER TABLE_A | FILTER _.mood GREATER_THAN_OR_EQUALS promote(@c9 AS ENUM) - task_count: 187 - task_total_time_ms: 119 - transform_count: 48 - transform_time_ms: 93 - transform_yield_count: 14 - insert_time_ms: 2 - insert_new_count: 17 - insert_reused_count: 2 + ANXIOUS(6), ANGRY(7)>) | MAP (_.id AS id, _.name AS name, _.mood AS mood) + task_count: 218 + task_total_time_ms: 11 + transform_count: 52 + transform_time_ms: 4 + transform_yield_count: 16 + insert_time_ms: 1 + insert_new_count: 20 + insert_reused_count: 1 - query: EXPLAIN SELECT * From TABLE_A where "mood" < "mood" - explain: SCAN(<,>) | TFILTER TABLE_A | FILTER _.mood LESS_THAN _.mood - task_count: 187 - task_total_time_ms: 119 - transform_count: 48 - transform_time_ms: 94 - transform_yield_count: 14 - insert_time_ms: 2 - insert_new_count: 17 - insert_reused_count: 2 + explain: SCAN(<,>) | TFILTER TABLE_A | FILTER _.mood LESS_THAN _.mood | MAP (_.id + AS id, _.name AS name, _.mood AS mood) + task_count: 218 + task_total_time_ms: 12 + transform_count: 52 + transform_time_ms: 5 + transform_yield_count: 16 + insert_time_ms: 0 + insert_new_count: 20 + insert_reused_count: 1 - query: EXPLAIN SELECT * From TABLE_B where "mood" = 'CONFUSED' explain: ISCAN(B$MOOD [EQUALS promote(@c8 AS ENUM)]) - task_count: 335 - task_total_time_ms: 147 - transform_count: 77 - transform_time_ms: 115 - transform_yield_count: 30 - insert_time_ms: 2 - insert_new_count: 34 - insert_reused_count: 4 + task_count: 367 + task_total_time_ms: 25 + transform_count: 83 + transform_time_ms: 10 + transform_yield_count: 31 + insert_time_ms: 0 + insert_new_count: 37 + insert_reused_count: 3 - query: EXPLAIN SELECT * From TABLE_B where "mood" > 'INDIFFERENT' explain: ISCAN(B$MOOD [[GREATER_THAN promote(@c8 AS ENUM)]]) - task_count: 335 - task_total_time_ms: 28 - transform_count: 78 + task_count: 367 + task_total_time_ms: 26 + transform_count: 85 transform_time_ms: 10 - transform_yield_count: 30 + transform_yield_count: 31 insert_time_ms: 1 - insert_new_count: 34 - insert_reused_count: 4 + insert_new_count: 37 + insert_reused_count: 3 - query: EXPLAIN SELECT * From TABLE_A where "mood" != 'INDIFFERENT' explain: SCAN(<,>) | TFILTER TABLE_A | FILTER _.mood NOT_EQUALS promote(@c9 AS ENUM) - task_count: 187 - task_total_time_ms: 130 - transform_count: 48 - transform_time_ms: 105 - transform_yield_count: 14 - insert_time_ms: 3 - insert_new_count: 17 - insert_reused_count: 2 + ANXIOUS(6), ANGRY(7)>) | MAP (_.id AS id, _.name AS name, _.mood AS mood) + task_count: 218 + task_total_time_ms: 12 + transform_count: 52 + transform_time_ms: 5 + transform_yield_count: 16 + insert_time_ms: 0 + insert_new_count: 20 + insert_reused_count: 1 diff --git a/yaml-tests/src/test/resources/enum.yamsql b/yaml-tests/src/test/resources/enum.yamsql index 86e5ddae09..22c30e511a 100644 --- a/yaml-tests/src/test/resources/enum.yamsql +++ b/yaml-tests/src/test/resources/enum.yamsql @@ -70,12 +70,12 @@ test_block: tests: - - query: SELECT * From TABLE_A where "mood" = 'CONFUSED' - - explain: "SCAN(<,>) | TFILTER TABLE_A | FILTER _.mood EQUALS promote(@c8 AS ENUM)" + - explain: "SCAN(<,>) | TFILTER TABLE_A | FILTER _.mood EQUALS promote(@c8 AS ENUM) | MAP (_.id AS id, _.name AS name, _.mood AS mood)" - unorderedResult: [{2, 'bar', 'CONFUSED'}, {11, 'plugh', 'CONFUSED'}] - - query: SELECT * From TABLE_A where "mood" > 'INDIFFERENT' - - explain: "SCAN(<,>) | TFILTER TABLE_A | FILTER _.mood GREATER_THAN promote(@c8 AS ENUM)" + - explain: "SCAN(<,>) | TFILTER TABLE_A | FILTER _.mood GREATER_THAN promote(@c8 AS ENUM) | MAP (_.id AS id, _.name AS name, _.mood AS mood)" - unorderedResult: [{2, 'bar', 'CONFUSED'}, {4, 'qux', 'ANGRY'}, {7, 'grault', 'ANXIOUS'}, @@ -84,7 +84,7 @@ test_block: {13, 'thud', 'SAD'}] - - query: SELECT * From TABLE_A where "mood" >= 'INDIFFERENT' - - explain: "SCAN(<,>) | TFILTER TABLE_A | FILTER _.mood GREATER_THAN_OR_EQUALS promote(@c9 AS ENUM)" + - explain: "SCAN(<,>) | TFILTER TABLE_A | FILTER _.mood GREATER_THAN_OR_EQUALS promote(@c9 AS ENUM) | MAP (_.id AS id, _.name AS name, _.mood AS mood)" - unorderedResult: [{2, 'bar', 'CONFUSED'}, {4, 'qux', 'ANGRY'}, {7, 'grault', 'ANXIOUS'}, @@ -127,7 +127,7 @@ test_block: - unorderedResult: [] - - query: SELECT * From TABLE_A where "mood" < "mood" - - explain: "SCAN(<,>) | TFILTER TABLE_A | FILTER _.mood LESS_THAN _.mood" + - explain: "SCAN(<,>) | TFILTER TABLE_A | FILTER _.mood LESS_THAN _.mood | MAP (_.id AS id, _.name AS name, _.mood AS mood)" - unorderedResult: [] - - query: SELECT * From TABLE_A where "mood" IS NOT NULL AND "id" < 5 @@ -159,6 +159,13 @@ test_block: - maxRows: 0 - unorderedResult: [{2, 'bar', 'CONFUSED'}, {11, 'plugh', 'CONFUSED'}] + - + - query: SELECT * From TABLE_B where "mood" = 'CONFUSED' + # Same as above, but with force continuations enabled. + # This can be combined with the previous query once we no longer care about backwards compatibility with versions older than !current_version + - supported_version: !current_version + - unorderedResult: [{2, 'bar', 'CONFUSED'}, + {11, 'plugh', 'CONFUSED'}] - - query: SELECT * From TABLE_B where "mood" > 'INDIFFERENT' - explain: "ISCAN(B$MOOD [[GREATER_THAN promote(@c8 AS ENUM)]])" @@ -170,9 +177,20 @@ test_block: {8, 'garply', 'SAD'}, {11, 'plugh', 'CONFUSED'}, {13, 'thud', 'SAD'}] + - + - query: SELECT * From TABLE_B where "mood" > 'INDIFFERENT' + # Same as above, but with force continuations enabled. + # This can be combined with the previous query once we no longer care about backwards compatibility with versions older than !current_version + - supported_version: !current_version + - unorderedResult: [{2, 'bar', 'CONFUSED'}, + {4, 'qux', 'ANGRY'}, + {7, 'grault', 'ANXIOUS'}, + {8, 'garply', 'SAD'}, + {11, 'plugh', 'CONFUSED'}, + {13, 'thud', 'SAD'}] - - query: SELECT * From TABLE_A where "mood" != 'INDIFFERENT' - - explain: "SCAN(<,>) | TFILTER TABLE_A | FILTER _.mood NOT_EQUALS promote(@c9 AS ENUM)" + - explain: "SCAN(<,>) | TFILTER TABLE_A | FILTER _.mood NOT_EQUALS promote(@c9 AS ENUM) | MAP (_.id AS id, _.name AS name, _.mood AS mood)" - unorderedResult: [{1, 'foo', 'HAPPY'}, {2, 'bar', 'CONFUSED'}, {3, 'baz', 'JOYFUL'}, diff --git a/yaml-tests/src/test/resources/field-index-tests-proto.yamsql b/yaml-tests/src/test/resources/field-index-tests-proto.yamsql index c45433b5a6..5ffc352d21 100644 --- a/yaml-tests/src/test/resources/field-index-tests-proto.yamsql +++ b/yaml-tests/src/test/resources/field-index-tests-proto.yamsql @@ -58,7 +58,7 @@ test_block: - result: [{ID: !l 5, COL1: !l 10, COL31: !l 5, COL32: !null _, COL2: !l 5}] - - query: select count(*) from (select * from (select * from (select * from "MyTable" where ID = 5) as x) as y) as z; - - explain: "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)" + - explain: "SCAN([EQUALS promote(@c23 AS LONG)]) | MAP ((_.ID AS ID, _.COL1 AS COL1, _.COL31 AS COL31, _.COL32 AS COL32, _.COL2 AS COL2) AS _0) | AGG (count_star(*) AS _0) | ON EMPTY NULL | MAP (coalesce_long(_._0._0, promote(0l AS LONG)) AS _0)" - result: [{!l 1}] - - query: select COL31, COL32 from (select * from (select * from "MyTable") as x) as y where ID = 5; diff --git a/yaml-tests/src/test/resources/indexed-functions.metrics.binpb b/yaml-tests/src/test/resources/indexed-functions.metrics.binpb index 036f4aa190..fb08dd7529 100644 --- a/yaml-tests/src/test/resources/indexed-functions.metrics.binpb +++ b/yaml-tests/src/test/resources/indexed-functions.metrics.binpb @@ -1,9 +1,7 @@ › 5 unnamed-2(EXPLAIN select * from t where b + c > 7;á -ੳ…• ¥“” -(C0À8H@ -4ISCAN(BPLUSC [[GREATER_THAN promote(@c10 AS LONG)]])Œdigraph G { +É¿õ ¡ ­úì (H0š¼\8R@4ISCAN(BPLUSC [[GREATER_THAN promote(@c10 AS LONG)]])Œdigraph G { fontname=courier; rankdir=BT; splines=polyline; @@ -23,23 +21,20 @@ digraph G { 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;Ñ +ɽáú¡ Ⱦˆ (H0–ÉP8R@,ISCAN(DMASK1 [EQUALS promote(@c10 AS LONG)])„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, LONG AS B, LONG AS C, LONG AS D, STRING AS E)" ]; 2 [ 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)" ]; 2 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}Œ +}‹ 5 - unnamed-2(EXPLAIN select * from t where d & 2 = 0;Ò -à««– ø¸â (C0“‘8H@ -,ISCAN(DMASK2 [EQUALS promote(@c10 AS LONG)])„digraph G { + unnamed-2(EXPLAIN select * from t where d & 2 = 0;Ñ +ÉçÞ° ¡ ë‡ó (H0ؼ_8R@,ISCAN(DMASK2 [EQUALS promote(@c10 AS LONG)])„digraph G { fontname=courier; rankdir=BT; splines=polyline; diff --git a/yaml-tests/src/test/resources/indexed-functions.metrics.yaml b/yaml-tests/src/test/resources/indexed-functions.metrics.yaml index 04ae3caf2f..73e83f4de2 100644 --- a/yaml-tests/src/test/resources/indexed-functions.metrics.yaml +++ b/yaml-tests/src/test/resources/indexed-functions.metrics.yaml @@ -1,14 +1,14 @@ 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: 56 - transform_count: 149 - transform_time_ms: 21 - transform_yield_count: 67 - insert_time_ms: 2 - insert_new_count: 72 - insert_reused_count: 10 + task_count: 713 + task_total_time_ms: 69 + transform_count: 161 + transform_time_ms: 24 + transform_yield_count: 72 + insert_time_ms: 1 + insert_new_count: 82 + insert_reused_count: 6 - query: EXPLAIN select a, b + c AS sum from t where e = 'alpha' order by b + c; explain: ISCAN(BPLUSCBYE [EQUALS promote(@c14 AS STRING)]) | MAP (_.A AS A, _.B + _.C AS SUM) @@ -22,21 +22,21 @@ unnamed-2: insert_reused_count: 2 - query: EXPLAIN select * from t where d & 1 = 0; explain: ISCAN(DMASK1 [EQUALS promote(@c10 AS LONG)]) - task_count: 608 - task_total_time_ms: 55 - transform_count: 150 - transform_time_ms: 21 - transform_yield_count: 67 - insert_time_ms: 2 - insert_new_count: 72 - insert_reused_count: 10 + task_count: 713 + task_total_time_ms: 67 + transform_count: 161 + transform_time_ms: 23 + transform_yield_count: 72 + insert_time_ms: 1 + insert_new_count: 82 + insert_reused_count: 6 - query: EXPLAIN select * from t where d & 2 = 0; explain: ISCAN(DMASK2 [EQUALS promote(@c10 AS LONG)]) - task_count: 608 - task_total_time_ms: 55 - transform_count: 150 - transform_time_ms: 20 - transform_yield_count: 67 - insert_time_ms: 2 - insert_new_count: 72 - insert_reused_count: 10 + task_count: 713 + task_total_time_ms: 67 + transform_count: 161 + transform_time_ms: 24 + transform_yield_count: 72 + insert_time_ms: 1 + insert_new_count: 82 + insert_reused_count: 6 diff --git a/yaml-tests/src/test/resources/like.metrics.binpb b/yaml-tests/src/test/resources/like.metrics.binpb index 50bebc2379..0c9ceb04e2 100644 --- a/yaml-tests/src/test/resources/like.metrics.binpb +++ b/yaml-tests/src/test/resources/like.metrics.binpb @@ -1,127 +1,127 @@ -„ +Ý 6 - unnamed-3)EXPLAIN select * from C WHERE C2 LIKE '%'É -Ò–ßðO ÂãÛ(0™—8&@YCOVERING(C2 <,> -> [C1: KEY[2], C2: KEY[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | FETCHÐ digraph G { + unnamed-3)EXPLAIN select * from C WHERE C2 LIKE '%'¢ +ÂãˆÚ_ ùÆÞ(#0Ã80@pCOVERING(C2 <,> -> [C1: KEY[2], C2: KEY[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | MAP (_.C1 AS C1, _.C2 AS C2)’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(INT AS C1, STRING AS C2)" ]; - 2 [ label=<
Predicate Filter
WHERE q41.C2 LIKE @c8 ESCAPE 'null'
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; + 1 [ label=<
Value Computation
MAP (q49.C1 AS C1, q49.C2 AS C2)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; + 2 [ label=<
Predicate Filter
WHERE q45.C2 LIKE @c8 ESCAPE 'null'
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; 3 [ label=<
Covering Index Scan
range: <-∞, ∞>
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; 4 [ label=<
Index
C2
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; - 3 -> 2 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 3 -> 2 [ label=< q45> label="q45" 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=< q49> label="q49" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}Þ 7 - unnamed-3*EXPLAIN select * from C WHERE C2 LIKE 'a%'É -ÒƒžÙO ¬ÃÃ(0âÙ8&@YCOVERING(C2 <,> -> [C1: KEY[2], C2: KEY[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | FETCHÐ digraph G { + unnamed-3*EXPLAIN select * from C WHERE C2 LIKE 'a%'¢ +¸¾™ _ ­­(#0ä!80@pCOVERING(C2 <,> -> [C1: KEY[2], C2: KEY[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | MAP (_.C1 AS C1, _.C2 AS C2)’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(INT AS C1, STRING AS C2)" ]; - 2 [ label=<
Predicate Filter
WHERE q41.C2 LIKE @c8 ESCAPE 'null'
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; + 1 [ label=<
Value Computation
MAP (q49.C1 AS C1, q49.C2 AS C2)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; + 2 [ label=<
Predicate Filter
WHERE q45.C2 LIKE @c8 ESCAPE 'null'
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; 3 [ label=<
Covering Index Scan
range: <-∞, ∞>
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; 4 [ label=<
Index
C2
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; - 3 -> 2 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 3 -> 2 [ label=< q45> label="q45" 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=< q49> label="q49" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}ß 8 - unnamed-3+EXPLAIN select * from C WHERE C2 LIKE 'ap%'É -Òö½§O Û—Ã(0”Ð8&@YCOVERING(C2 <,> -> [C1: KEY[2], C2: KEY[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | FETCHÐ digraph G { + unnamed-3+EXPLAIN select * from C WHERE C2 LIKE 'ap%'¢ +Â’§ƒ_ Çàœ(#0ÇŒ80@pCOVERING(C2 <,> -> [C1: KEY[2], C2: KEY[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | MAP (_.C1 AS C1, _.C2 AS C2)’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(INT AS C1, STRING AS C2)" ]; - 2 [ label=<
Predicate Filter
WHERE q41.C2 LIKE @c8 ESCAPE 'null'
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; + 1 [ label=<
Value Computation
MAP (q49.C1 AS C1, q49.C2 AS C2)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; + 2 [ label=<
Predicate Filter
WHERE q45.C2 LIKE @c8 ESCAPE 'null'
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; 3 [ label=<
Covering Index Scan
range: <-∞, ∞>
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; 4 [ label=<
Index
C2
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; - 3 -> 2 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 3 -> 2 [ label=< q45> label="q45" 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=< q49> label="q49" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}à 9 - unnamed-3,EXPLAIN select * from C WHERE C2 LIKE 'a%l%'É -ÒÉŒåO «×(0Ò¿8&@YCOVERING(C2 <,> -> [C1: KEY[2], C2: KEY[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | FETCHÐ digraph G { + unnamed-3,EXPLAIN select * from C WHERE C2 LIKE 'a%l%'¢ +ÂÏŠ _ âÄ«(#0ˆ÷"80@pCOVERING(C2 <,> -> [C1: KEY[2], C2: KEY[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | MAP (_.C1 AS C1, _.C2 AS C2)’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(INT AS C1, STRING AS C2)" ]; - 2 [ label=<
Predicate Filter
WHERE q41.C2 LIKE @c8 ESCAPE 'null'
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; + 1 [ label=<
Value Computation
MAP (q49.C1 AS C1, q49.C2 AS C2)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; + 2 [ label=<
Predicate Filter
WHERE q45.C2 LIKE @c8 ESCAPE 'null'
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; 3 [ label=<
Covering Index Scan
range: <-∞, ∞>
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; 4 [ label=<
Index
C2
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; - 3 -> 2 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 3 -> 2 [ label=< q45> label="q45" 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=< q49> label="q49" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}ß 8 - unnamed-3+EXPLAIN select * from C WHERE C2 LIKE 'ca%'É -Ò«¸šO è¶Ó(0Õ÷8&@YCOVERING(C2 <,> -> [C1: KEY[2], C2: KEY[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | FETCHÐ digraph G { + unnamed-3+EXPLAIN select * from C WHERE C2 LIKE 'ca%'¢ +Âﵕ_ ÏÊ™(#0í80@pCOVERING(C2 <,> -> [C1: KEY[2], C2: KEY[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | MAP (_.C1 AS C1, _.C2 AS C2)’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(INT AS C1, STRING AS C2)" ]; - 2 [ label=<
Predicate Filter
WHERE q41.C2 LIKE @c8 ESCAPE 'null'
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; + 1 [ label=<
Value Computation
MAP (q49.C1 AS C1, q49.C2 AS C2)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; + 2 [ label=<
Predicate Filter
WHERE q45.C2 LIKE @c8 ESCAPE 'null'
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; 3 [ label=<
Covering Index Scan
range: <-∞, ∞>
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; 4 [ label=<
Index
C2
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; - 3 -> 2 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 3 -> 2 [ label=< q45> label="q45" 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=< q49> label="q49" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}á : - unnamed-3-EXPLAIN select * from C WHERE C2 LIKE 'ca_al'É -Ò‹¦ñO ôÒ×(0’ó8&@YCOVERING(C2 <,> -> [C1: KEY[2], C2: KEY[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | FETCHÐ digraph G { + unnamed-3-EXPLAIN select * from C WHERE C2 LIKE 'ca_al'¢ +ÂÅκ_ ßÕÝ(#0÷¤80@pCOVERING(C2 <,> -> [C1: KEY[2], C2: KEY[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | MAP (_.C1 AS C1, _.C2 AS C2)’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(INT AS C1, STRING AS C2)" ]; - 2 [ label=<
Predicate Filter
WHERE q41.C2 LIKE @c8 ESCAPE 'null'
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; + 1 [ label=<
Value Computation
MAP (q49.C1 AS C1, q49.C2 AS C2)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; + 2 [ label=<
Predicate Filter
WHERE q45.C2 LIKE @c8 ESCAPE 'null'
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; 3 [ label=<
Covering Index Scan
range: <-∞, ∞>
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; 4 [ label=<
Index
C2
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; - 3 -> 2 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 3 -> 2 [ label=< q45> label="q45" 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=< q49> label="q49" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}á : - unnamed-3-EXPLAIN select * from C WHERE C2 LIKE 'ca%al'É -ÒˆˆòO þ“Ï(0ד8&@YCOVERING(C2 <,> -> [C1: KEY[2], C2: KEY[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | FETCHÐ digraph G { + unnamed-3-EXPLAIN select * from C WHERE C2 LIKE 'ca%al'¢ +‡ùÓ_ ×§ß(#0­Ÿ80@pCOVERING(C2 <,> -> [C1: KEY[2], C2: KEY[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | MAP (_.C1 AS C1, _.C2 AS C2)’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(INT AS C1, STRING AS C2)" ]; - 2 [ label=<
Predicate Filter
WHERE q41.C2 LIKE @c8 ESCAPE 'null'
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; + 1 [ label=<
Value Computation
MAP (q49.C1 AS C1, q49.C2 AS C2)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; + 2 [ label=<
Predicate Filter
WHERE q45.C2 LIKE @c8 ESCAPE 'null'
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; 3 [ label=<
Covering Index Scan
range: <-∞, ∞>
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; 4 [ label=<
Index
C2
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; - 3 -> 2 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 3 -> 2 [ label=< q45> label="q45" 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=< q49> label="q49" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}â ; - unnamed-3.EXPLAIN select * from C WHERE C2 LIKE 'ca_al%'É -Ò뜎O ДÏ(0¸Ë8&@YCOVERING(C2 <,> -> [C1: KEY[2], C2: KEY[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | FETCHÐ digraph G { + unnamed-3.EXPLAIN select * from C WHERE C2 LIKE 'ca_al%'¢ + Û_ çÈ•(#0‡É80@pCOVERING(C2 <,> -> [C1: KEY[2], C2: KEY[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | MAP (_.C1 AS C1, _.C2 AS C2)’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(INT AS C1, STRING AS C2)" ]; - 2 [ label=<
Predicate Filter
WHERE q41.C2 LIKE @c8 ESCAPE 'null'
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; + 1 [ label=<
Value Computation
MAP (q49.C1 AS C1, q49.C2 AS C2)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; + 2 [ label=<
Predicate Filter
WHERE q45.C2 LIKE @c8 ESCAPE 'null'
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; 3 [ label=<
Covering Index Scan
range: <-∞, ∞>
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; 4 [ label=<
Index
C2
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; - 3 -> 2 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 3 -> 2 [ label=< q45> label="q45" 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=< q49> label="q49" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}â ; - unnamed-3.EXPLAIN select * from C WHERE C2 LIKE 'ca%al%'É -Ò±™O çÊŽ(0Íü!8&@YCOVERING(C2 <,> -> [C1: KEY[2], C2: KEY[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | FETCHÐ digraph G { + unnamed-3.EXPLAIN select * from C WHERE C2 LIKE 'ca%al%'¢ +¸Ñë_ èìý(#0¿»80@pCOVERING(C2 <,> -> [C1: KEY[2], C2: KEY[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | MAP (_.C1 AS C1, _.C2 AS C2)’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(INT AS C1, STRING AS C2)" ]; - 2 [ label=<
Predicate Filter
WHERE q41.C2 LIKE @c8 ESCAPE 'null'
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; + 1 [ label=<
Value Computation
MAP (q49.C1 AS C1, q49.C2 AS C2)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; + 2 [ label=<
Predicate Filter
WHERE q45.C2 LIKE @c8 ESCAPE 'null'
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; 3 [ label=<
Covering Index Scan
range: <-∞, ∞>
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; 4 [ label=<
Index
C2
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS C1, STRING AS C2)" ]; - 3 -> 2 [ label=< q41> label="q41" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 3 -> 2 [ label=< q45> label="q45" 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=< q49> label="q49" 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/like.metrics.yaml b/yaml-tests/src/test/resources/like.metrics.yaml index ba8c6d1672..430c216e75 100644 --- a/yaml-tests/src/test/resources/like.metrics.yaml +++ b/yaml-tests/src/test/resources/like.metrics.yaml @@ -1,100 +1,100 @@ unnamed-3: - query: EXPLAIN select * from C WHERE C2 LIKE '%' explain: 'COVERING(C2 <,> -> [C1: KEY[2], C2: KEY[0]]) | FILTER _.C2 LIKE @c8 - ESCAPE ''null'' | FETCH' - task_count: 338 - task_total_time_ms: 10 - transform_count: 79 + ESCAPE ''null'' | MAP (_.C1 AS C1, _.C2 AS C2)' + task_count: 450 + task_total_time_ms: 16 + transform_count: 95 transform_time_ms: 3 - transform_yield_count: 29 + transform_yield_count: 35 insert_time_ms: 0 - insert_new_count: 38 - insert_reused_count: 5 + insert_new_count: 48 + insert_reused_count: 3 - query: EXPLAIN select * from C WHERE C2 LIKE 'a%' explain: 'COVERING(C2 <,> -> [C1: KEY[2], C2: KEY[0]]) | FILTER _.C2 LIKE @c8 - ESCAPE ''null'' | FETCH' - task_count: 338 - task_total_time_ms: 9 - transform_count: 79 - transform_time_ms: 3 - transform_yield_count: 29 + ESCAPE ''null'' | MAP (_.C1 AS C1, _.C2 AS C2)' + task_count: 450 + task_total_time_ms: 19 + transform_count: 95 + transform_time_ms: 4 + transform_yield_count: 35 insert_time_ms: 0 - insert_new_count: 38 - insert_reused_count: 5 + insert_new_count: 48 + insert_reused_count: 3 - query: EXPLAIN select * from C WHERE C2 LIKE 'ap%' explain: 'COVERING(C2 <,> -> [C1: KEY[2], C2: KEY[0]]) | FILTER _.C2 LIKE @c8 - ESCAPE ''null'' | FETCH' - task_count: 338 - task_total_time_ms: 9 - transform_count: 79 - transform_time_ms: 3 - transform_yield_count: 29 + ESCAPE ''null'' | MAP (_.C1 AS C1, _.C2 AS C2)' + task_count: 450 + task_total_time_ms: 16 + transform_count: 95 + transform_time_ms: 4 + transform_yield_count: 35 insert_time_ms: 0 - insert_new_count: 38 - insert_reused_count: 5 + insert_new_count: 48 + insert_reused_count: 3 - query: EXPLAIN select * from C WHERE C2 LIKE 'a%l%' explain: 'COVERING(C2 <,> -> [C1: KEY[2], C2: KEY[0]]) | FILTER _.C2 LIKE @c8 - ESCAPE ''null'' | FETCH' - task_count: 338 - task_total_time_ms: 10 - transform_count: 79 - transform_time_ms: 3 - transform_yield_count: 29 + ESCAPE ''null'' | MAP (_.C1 AS C1, _.C2 AS C2)' + task_count: 450 + task_total_time_ms: 19 + transform_count: 95 + transform_time_ms: 4 + transform_yield_count: 35 insert_time_ms: 0 - insert_new_count: 38 - insert_reused_count: 5 + insert_new_count: 48 + insert_reused_count: 3 - query: EXPLAIN select * from C WHERE C2 LIKE 'ca%' explain: 'COVERING(C2 <,> -> [C1: KEY[2], C2: KEY[0]]) | FILTER _.C2 LIKE @c8 - ESCAPE ''null'' | FETCH' - task_count: 338 - task_total_time_ms: 10 - transform_count: 79 - transform_time_ms: 3 - transform_yield_count: 29 + ESCAPE ''null'' | MAP (_.C1 AS C1, _.C2 AS C2)' + task_count: 450 + task_total_time_ms: 17 + transform_count: 95 + transform_time_ms: 4 + transform_yield_count: 35 insert_time_ms: 0 - insert_new_count: 38 - insert_reused_count: 5 + insert_new_count: 48 + insert_reused_count: 3 - query: EXPLAIN select * from C WHERE C2 LIKE 'ca_al' explain: 'COVERING(C2 <,> -> [C1: KEY[2], C2: KEY[0]]) | FILTER _.C2 LIKE @c8 - ESCAPE ''null'' | FETCH' - task_count: 338 - task_total_time_ms: 10 - transform_count: 79 + ESCAPE ''null'' | MAP (_.C1 AS C1, _.C2 AS C2)' + task_count: 450 + task_total_time_ms: 13 + transform_count: 95 transform_time_ms: 3 - transform_yield_count: 29 + transform_yield_count: 35 insert_time_ms: 0 - insert_new_count: 38 - insert_reused_count: 5 + insert_new_count: 48 + insert_reused_count: 3 - query: EXPLAIN select * from C WHERE C2 LIKE 'ca%al' explain: 'COVERING(C2 <,> -> [C1: KEY[2], C2: KEY[0]]) | FILTER _.C2 LIKE @c8 - ESCAPE ''null'' | FETCH' - task_count: 338 - task_total_time_ms: 10 - transform_count: 79 + ESCAPE ''null'' | MAP (_.C1 AS C1, _.C2 AS C2)' + task_count: 450 + task_total_time_ms: 16 + transform_count: 95 transform_time_ms: 3 - transform_yield_count: 29 + transform_yield_count: 35 insert_time_ms: 0 - insert_new_count: 38 - insert_reused_count: 5 + insert_new_count: 48 + insert_reused_count: 3 - query: EXPLAIN select * from C WHERE C2 LIKE 'ca_al%' explain: 'COVERING(C2 <,> -> [C1: KEY[2], C2: KEY[0]]) | FILTER _.C2 LIKE @c8 - ESCAPE ''null'' | FETCH' - task_count: 338 - task_total_time_ms: 10 - transform_count: 79 - transform_time_ms: 3 - transform_yield_count: 29 + ESCAPE ''null'' | MAP (_.C1 AS C1, _.C2 AS C2)' + task_count: 450 + task_total_time_ms: 8 + transform_count: 95 + transform_time_ms: 2 + transform_yield_count: 35 insert_time_ms: 0 - insert_new_count: 38 - insert_reused_count: 5 + insert_new_count: 48 + insert_reused_count: 3 - query: EXPLAIN select * from C WHERE C2 LIKE 'ca%al%' explain: 'COVERING(C2 <,> -> [C1: KEY[2], C2: KEY[0]]) | FILTER _.C2 LIKE @c8 - ESCAPE ''null'' | FETCH' - task_count: 338 - task_total_time_ms: 15 - transform_count: 79 + ESCAPE ''null'' | MAP (_.C1 AS C1, _.C2 AS C2)' + task_count: 450 + task_total_time_ms: 14 + transform_count: 95 transform_time_ms: 4 - transform_yield_count: 29 + transform_yield_count: 35 insert_time_ms: 0 - insert_new_count: 38 - insert_reused_count: 5 + insert_new_count: 48 + insert_reused_count: 3 diff --git a/yaml-tests/src/test/resources/like.yamsql b/yaml-tests/src/test/resources/like.yamsql index 22a9c3da3a..878c92aab9 100644 --- a/yaml-tests/src/test/resources/like.yamsql +++ b/yaml-tests/src/test/resources/like.yamsql @@ -154,7 +154,7 @@ test_block: {'\\||%'}] - - query: select * from C WHERE C2 LIKE '%' - - explain: "COVERING(C2 <,> -> [C1: KEY:[2], C2: KEY:[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | FETCH" + - explain: "COVERING(C2 <,> -> [C1: KEY:[2], C2: KEY:[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | MAP (_.C1 AS C1, _.C2 AS C2)" - result: [ { C1: 1, C2: alphabet}, { C1: 2, C2: anticipation}, @@ -178,7 +178,7 @@ test_block: ] - - query: select * from C WHERE C2 LIKE 'a%' - - explain: "COVERING(C2 <,> -> [C1: KEY:[2], C2: KEY:[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | FETCH" + - explain: "COVERING(C2 <,> -> [C1: KEY:[2], C2: KEY:[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | MAP (_.C1 AS C1, _.C2 AS C2)" - result: [ { C1: 1, C2: alphabet}, { C1: 2, C2: anticipation}, @@ -190,7 +190,7 @@ test_block: ] - - query: select * from C WHERE C2 LIKE 'ap%' - - explain: "COVERING(C2 <,> -> [C1: KEY:[2], C2: KEY:[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | FETCH" + - explain: "COVERING(C2 <,> -> [C1: KEY:[2], C2: KEY:[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | MAP (_.C1 AS C1, _.C2 AS C2)" - result: [ { C1: 3, C2: aplomb}, { C1: 4, C2: apple}, @@ -199,7 +199,7 @@ test_block: ] - - query: select * from C WHERE C2 LIKE 'a%l%' - - explain: "COVERING(C2 <,> -> [C1: KEY:[2], C2: KEY:[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | FETCH" + - explain: "COVERING(C2 <,> -> [C1: KEY:[2], C2: KEY:[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | MAP (_.C1 AS C1, _.C2 AS C2)" - result: [ { C1: 1, C2: alphabet}, { C1: 3, C2: aplomb}, @@ -277,7 +277,7 @@ test_block: - - query: select * from C WHERE C2 LIKE 'ca%' # In theory, this could be executed optimally with prefix string scan with the prefix "ca" - - explain: "COVERING(C2 <,> -> [C1: KEY:[2], C2: KEY:[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | FETCH" + - explain: "COVERING(C2 <,> -> [C1: KEY:[2], C2: KEY:[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | MAP (_.C1 AS C1, _.C2 AS C2)" - result: [ { C1: 13, C2: cabal}, { C1: 14, C2: camel}, @@ -290,7 +290,7 @@ test_block: - query: select * from C WHERE C2 LIKE 'ca_al' # In theory, this could be optimized with prefix string scan with the prefix "ca" followed by compensation # to handle filtering out based on the tail - - explain: "COVERING(C2 <,> -> [C1: KEY:[2], C2: KEY:[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | FETCH" + - explain: "COVERING(C2 <,> -> [C1: KEY:[2], C2: KEY:[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | MAP (_.C1 AS C1, _.C2 AS C2)" - result: [ { C1: 13, C2: cabal}, { C1: 15, C2: canal}, @@ -299,7 +299,7 @@ test_block: - query: select * from C WHERE C2 LIKE 'ca%al' # In theory, this could be optimized with prefix string scan with the prefix "ca" followed by compensation # to handle matching the tail - - explain: "COVERING(C2 <,> -> [C1: KEY:[2], C2: KEY:[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | FETCH" + - explain: "COVERING(C2 <,> -> [C1: KEY:[2], C2: KEY:[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | MAP (_.C1 AS C1, _.C2 AS C2)" - result: [ { C1: 13, C2: cabal}, { C1: 15, C2: canal}, @@ -307,7 +307,7 @@ test_block: ] - - query: select * from C WHERE C2 LIKE 'ca_al%' - - explain: "COVERING(C2 <,> -> [C1: KEY:[2], C2: KEY:[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | FETCH" + - explain: "COVERING(C2 <,> -> [C1: KEY:[2], C2: KEY:[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | MAP (_.C1 AS C1, _.C2 AS C2)" - result: [ { C1: 13, C2: cabal}, { C1: 15, C2: canal}, @@ -315,7 +315,7 @@ test_block: ] - - query: select * from C WHERE C2 LIKE 'ca%al%' - - explain: "COVERING(C2 <,> -> [C1: KEY:[2], C2: KEY:[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | FETCH" + - explain: "COVERING(C2 <,> -> [C1: KEY:[2], C2: KEY:[0]]) | FILTER _.C2 LIKE @c8 ESCAPE 'null' | MAP (_.C1 AS C1, _.C2 AS C2)" - result: [ { C1: 13, C2: cabal}, { C1: 15, C2: canal}, diff --git a/yaml-tests/src/test/resources/literal-tests.metrics.binpb b/yaml-tests/src/test/resources/literal-tests.metrics.binpb index 2601df6d13..047fa0b7b3 100644 --- a/yaml-tests/src/test/resources/literal-tests.metrics.binpb +++ b/yaml-tests/src/test/resources/literal-tests.metrics.binpb @@ -1,7 +1,7 @@ î @ unnamed-33EXPLAIN select * from B where 6L = coalesce(5L, 6L)© -£Áç’. ¯Ô¯(0Å£ 8@6SCAN(<,>) | FILTER coalesce_long(@c10, @c6) EQUALS @c6Ó +ÂÄÄ¥2 ÈŠ (0׺8@6SCAN(<,>) | FILTER coalesce_long(@c10, @c6) EQUALS @c6Ó digraph G { fontname=courier; rankdir=BT; @@ -14,7 +14,7 @@ digraph G { }é = unnamed-30EXPLAIN select * from B where 6 = coalesce(5, 6)§ -£ƧÎ. ú©‚(0ÿÉ8@5SCAN(<,>) | FILTER coalesce_int(@c10, @c6) EQUALS @c6Ò +ÂÔ݉2 üñ(0Þ­8@5SCAN(<,>) | FILTER coalesce_int(@c10, @c6) EQUALS @c6Ò digraph G { fontname=courier; rankdir=BT; @@ -27,7 +27,7 @@ digraph G { }î @ unnamed-43EXPLAIN select * from B where 6L = coalesce(5L, 6L)© -£Áç’. ¯Ô¯(0Å£ 8@6SCAN(<,>) | FILTER coalesce_long(@c10, @c6) EQUALS @c6Ó +ÂÄÄ¥2 ÈŠ (0׺8@6SCAN(<,>) | FILTER coalesce_long(@c10, @c6) EQUALS @c6Ó digraph G { fontname=courier; rankdir=BT; @@ -40,8 +40,8 @@ digraph G { } @ unnamed-43EXPLAIN select * from B where 6L = coalesce(5I, 6I)Ë -£æÆù. Ñ’Š(0Òß -8@GSCAN(<,>) | FILTER promote(coalesce_int(@c10, @c12) AS LONG) EQUALS @c6ä +†™2 î¬Ñ(0ð‚ +8@GSCAN(<,>) | FILTER promote(coalesce_int(@c10, @c12) AS LONG) EQUALS @c6ä digraph G { fontname=courier; rankdir=BT; @@ -54,7 +54,7 @@ digraph G { }Ž > unnamed-41EXPLAIN select * from B where 6L = coalesce(5, 6)Ë -£úä·. Ïɯ(0œ 8@GSCAN(<,>) | FILTER promote(coalesce_int(@c10, @c12) AS LONG) EQUALS @c6ä +ÂÈù2 àçÍ(0÷‘ 8@GSCAN(<,>) | FILTER promote(coalesce_int(@c10, @c12) AS LONG) EQUALS @c6ä digraph G { fontname=courier; rankdir=BT; @@ -67,7 +67,7 @@ digraph G { }° > unnamed-41EXPLAIN select * from B where 6 = coalesce(5L, 6)í -£‚®². àÙÖ(0Úÿ8@XSCAN(<,>) | FILTER coalesce_long(@c10, promote(@c6 AS LONG)) EQUALS promote(@c6 AS LONG)õ +ÂÈ‘ž2 ˜˜ý(0µ¯ 8@XSCAN(<,>) | FILTER coalesce_long(@c10, promote(@c6 AS LONG)) EQUALS promote(@c6 AS LONG)õ digraph G { fontname=courier; rankdir=BT; @@ -80,7 +80,7 @@ digraph G { }² @ unnamed-43EXPLAIN select * from B where 6I = coalesce(5L, 6I)í -£‡‰. ¸‹(0Ú‡ 8@XSCAN(<,>) | FILTER coalesce_long(@c10, promote(@c6 AS LONG)) EQUALS promote(@c6 AS LONG)õ +†õÛ2 ÷Ï(0¯ÿ8@XSCAN(<,>) | FILTER coalesce_long(@c10, promote(@c6 AS LONG)) EQUALS promote(@c6 AS LONG)õ digraph G { fontname=courier; rankdir=BT; @@ -93,7 +93,7 @@ digraph G { }² @ unnamed-43EXPLAIN select * from B where 6i = coalesce(5l, 6i)í -£†¦Â. ؤ•(0ý€8@XSCAN(<,>) | FILTER coalesce_long(@c10, promote(@c6 AS LONG)) EQUALS promote(@c6 AS LONG)õ +ÂØá˜2 ùµ(0™Ù 8@XSCAN(<,>) | FILTER coalesce_long(@c10, promote(@c6 AS LONG)) EQUALS promote(@c6 AS LONG)õ digraph G { fontname=courier; rankdir=BT; @@ -106,7 +106,7 @@ digraph G { }é = unnamed-40EXPLAIN select * from B where 6 = coalesce(5, 6)§ -£ƧÎ. ú©‚(0ÿÉ8@5SCAN(<,>) | FILTER coalesce_int(@c10, @c6) EQUALS @c6Ò +ÂÔ݉2 üñ(0Þ­8@5SCAN(<,>) | FILTER coalesce_int(@c10, @c6) EQUALS @c6Ò digraph G { fontname=courier; rankdir=BT; diff --git a/yaml-tests/src/test/resources/literal-tests.metrics.yaml b/yaml-tests/src/test/resources/literal-tests.metrics.yaml index f9d829736f..dbc15c5ebd 100644 --- a/yaml-tests/src/test/resources/literal-tests.metrics.yaml +++ b/yaml-tests/src/test/resources/literal-tests.metrics.yaml @@ -1,95 +1,95 @@ unnamed-3: - query: EXPLAIN select * from B where 6L = coalesce(5L, 6L) explain: SCAN(<,>) | FILTER coalesce_long(@c10, @c6) EQUALS @c6 - task_count: 163 + task_count: 194 task_total_time_ms: 4 - transform_count: 46 + transform_count: 50 transform_time_ms: 2 - transform_yield_count: 14 + transform_yield_count: 16 insert_time_ms: 0 - insert_new_count: 14 - insert_reused_count: 2 + insert_new_count: 17 + insert_reused_count: 1 - query: EXPLAIN select * from B where 6 = coalesce(5, 6) explain: SCAN(<,>) | FILTER coalesce_int(@c10, @c6) EQUALS @c6 - task_count: 163 - task_total_time_ms: 3 - transform_count: 46 + task_count: 194 + task_total_time_ms: 4 + transform_count: 50 transform_time_ms: 2 - transform_yield_count: 14 + transform_yield_count: 16 insert_time_ms: 0 - insert_new_count: 14 - insert_reused_count: 2 + insert_new_count: 17 + insert_reused_count: 1 unnamed-4: - query: EXPLAIN select * from B where 6L = coalesce(5L, 6L) explain: SCAN(<,>) | FILTER coalesce_long(@c10, @c6) EQUALS @c6 - task_count: 163 + task_count: 194 task_total_time_ms: 4 - transform_count: 46 + transform_count: 50 transform_time_ms: 2 - transform_yield_count: 14 + transform_yield_count: 16 insert_time_ms: 0 - insert_new_count: 14 - insert_reused_count: 2 + insert_new_count: 17 + insert_reused_count: 1 - query: EXPLAIN select * from B where 6L = coalesce(5I, 6I) explain: SCAN(<,>) | FILTER promote(coalesce_int(@c10, @c12) AS LONG) EQUALS @c6 - task_count: 163 - task_total_time_ms: 6 - transform_count: 46 - transform_time_ms: 2 - transform_yield_count: 14 + task_count: 194 + task_total_time_ms: 8 + transform_count: 50 + transform_time_ms: 3 + transform_yield_count: 16 insert_time_ms: 0 - insert_new_count: 14 - insert_reused_count: 2 + insert_new_count: 17 + insert_reused_count: 1 - query: EXPLAIN select * from B where 6L = coalesce(5, 6) explain: SCAN(<,>) | FILTER promote(coalesce_int(@c10, @c12) AS LONG) EQUALS @c6 - task_count: 163 - task_total_time_ms: 7 - transform_count: 46 - transform_time_ms: 2 - transform_yield_count: 14 + task_count: 194 + task_total_time_ms: 8 + transform_count: 50 + transform_time_ms: 3 + transform_yield_count: 16 insert_time_ms: 0 - insert_new_count: 14 - insert_reused_count: 2 + insert_new_count: 17 + insert_reused_count: 1 - query: EXPLAIN select * from B where 6 = coalesce(5L, 6) explain: SCAN(<,>) | FILTER coalesce_long(@c10, promote(@c6 AS LONG)) EQUALS promote(@c6 AS LONG) - task_count: 163 - task_total_time_ms: 7 - transform_count: 46 - transform_time_ms: 3 - transform_yield_count: 14 + task_count: 194 + task_total_time_ms: 8 + transform_count: 50 + transform_time_ms: 4 + transform_yield_count: 16 insert_time_ms: 0 - insert_new_count: 14 - insert_reused_count: 2 + insert_new_count: 17 + insert_reused_count: 1 - query: EXPLAIN select * from B where 6I = coalesce(5L, 6I) explain: SCAN(<,>) | FILTER coalesce_long(@c10, promote(@c6 AS LONG)) EQUALS promote(@c6 AS LONG) - task_count: 163 - task_total_time_ms: 6 - transform_count: 46 - transform_time_ms: 2 - transform_yield_count: 14 + task_count: 194 + task_total_time_ms: 9 + transform_count: 50 + transform_time_ms: 3 + transform_yield_count: 16 insert_time_ms: 0 - insert_new_count: 14 - insert_reused_count: 2 + insert_new_count: 17 + insert_reused_count: 1 - query: EXPLAIN select * from B where 6i = coalesce(5l, 6i) explain: SCAN(<,>) | FILTER coalesce_long(@c10, promote(@c6 AS LONG)) EQUALS promote(@c6 AS LONG) - task_count: 163 - task_total_time_ms: 7 - transform_count: 46 + task_count: 194 + task_total_time_ms: 8 + transform_count: 50 transform_time_ms: 2 - transform_yield_count: 14 + transform_yield_count: 16 insert_time_ms: 0 - insert_new_count: 14 - insert_reused_count: 2 + insert_new_count: 17 + insert_reused_count: 1 - query: EXPLAIN select * from B where 6 = coalesce(5, 6) explain: SCAN(<,>) | FILTER coalesce_int(@c10, @c6) EQUALS @c6 - task_count: 163 - task_total_time_ms: 3 - transform_count: 46 + task_count: 194 + task_total_time_ms: 4 + transform_count: 50 transform_time_ms: 2 - transform_yield_count: 14 + transform_yield_count: 16 insert_time_ms: 0 - insert_new_count: 14 - insert_reused_count: 2 + insert_new_count: 17 + insert_reused_count: 1 diff --git a/yaml-tests/src/test/resources/null-extraction-tests.metrics.binpb b/yaml-tests/src/test/resources/null-extraction-tests.metrics.binpb index e4eba6599b..29b068b178 100644 --- a/yaml-tests/src/test/resources/null-extraction-tests.metrics.binpb +++ b/yaml-tests/src/test/resources/null-extraction-tests.metrics.binpb @@ -1,25 +1,25 @@ -– +— Y - unnamed-3LEXPLAIN select * from B where b3 = 4 and b2 = 'b' and (? is null or b1 < 20)¸ -ÇŠø P ¤…( 0ð¬8#@4ISCAN(I1 [EQUALS promote(@c8 AS LONG), EQUALS @c12])ädigraph G { + unnamed-3LEXPLAIN select * from B where b3 = 4 and b2 = 'b' and (? is null or b1 < 20)¹ +†þí¥lY —‡‹K(#0’ü¹8*@4ISCAN(I1 [EQUALS promote(@c8 AS LONG), EQUALS @c12])ädigraph G { fontname=courier; rankdir=BT; splines=polyline; 1 [ label=<
Index Scan
comparisons: [EQUALS promote(@c8 AS LONG), EQUALS @c12]
> 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=<
Index
I1
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; 2 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}‹ +} e -agg-index-tests-countLEXPLAIN select * from B where b3 = 4 and b2 = 'b' and (? is null or b1 < 20)¡ -’ å”òŠ ¨˜è (T0½ƒu8¯@·COVERING(I1 [EQUALS promote(@c8 AS LONG), EQUALS promote(@c12 AS STRING)] -> [B1: KEY[3], B2: KEY[1], B3: KEY[0]]) | FILTER @c15 IS_NULL OR _.B1 LESS_THAN promote(@c21 AS INT) | FETCHÇdigraph G { +agg-index-tests-countLEXPLAIN select * from B where b3 = 4 and b2 = 'b' and (? is null or b1 < 20)¥ +Ð ŸŒÓ;¬ ¾—…(]0·¨¬8Æ@ºCOVERING(I1 [EQUALS promote(@c8 AS LONG), EQUALS promote(@c12 AS STRING)] -> [B1: KEY:[3], B2: KEY:[1], B3: KEY:[0]]) | FILTER @c15 IS_NULL OR _.B1 LESS_THAN promote(@c21 AS INT) | FETCHÇ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(INT AS B1, STRING AS B2, LONG AS B3)" ]; - 2 [ label=<
Predicate Filter
WHERE @c15 IS_NULL OR q193.B1 LESS_THAN promote(@c21 AS INT)
> 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=<
Predicate Filter
WHERE @c15 IS_NULL OR q212.B1 LESS_THAN promote(@c21 AS INT)
> 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=<
Covering Index Scan
comparisons: [EQUALS promote(@c8 AS LONG), EQUALS promote(@c12 AS STRING)]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(INT AS B1, STRING AS B2, LONG AS B3)" ]; 4 [ label=<
Index
I1
> 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 [ label=< q193> label="q193" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 3 -> 2 [ label=< q212> label="q212" 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=< q195> label="q195" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q214> label="q214" 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-extraction-tests.metrics.yaml b/yaml-tests/src/test/resources/null-extraction-tests.metrics.yaml index 079010a663..716e207b17 100644 --- a/yaml-tests/src/test/resources/null-extraction-tests.metrics.yaml +++ b/yaml-tests/src/test/resources/null-extraction-tests.metrics.yaml @@ -2,25 +2,25 @@ unnamed-3: - query: EXPLAIN select * from B where b3 = 4 and b2 = 'b' and (? is null or b1 < 20) explain: ISCAN(I1 [EQUALS promote(@c8 AS LONG), EQUALS @c12]) - task_count: 327 - task_total_time_ms: 17 - transform_count: 80 - transform_time_ms: 6 - transform_yield_count: 32 - insert_time_ms: 0 - insert_new_count: 35 + task_count: 390 + task_total_time_ms: 227 + transform_count: 89 + transform_time_ms: 157 + transform_yield_count: 35 + insert_time_ms: 5 + insert_new_count: 42 insert_reused_count: 4 agg-index-tests-count: - query: EXPLAIN select * from B where b3 = 4 and b2 = 'b' and (? is null or b1 < 20) explain: 'COVERING(I1 [EQUALS promote(@c8 AS LONG), EQUALS promote(@c12 AS STRING)] - -> [B1: KEY[3], B2: KEY[1], B3: KEY[0]]) | FILTER @c15 IS_NULL OR _.B1 LESS_THAN - promote(@c21 AS INT) | FETCH' - task_count: 1426 - task_total_time_ms: 45 - transform_count: 266 - transform_time_ms: 20 - transform_yield_count: 84 - insert_time_ms: 1 - insert_new_count: 175 + -> [B1: KEY:[3], B2: KEY:[1], B3: KEY:[0]]) | FILTER @c15 IS_NULL OR _.B1 + LESS_THAN promote(@c21 AS INT) | FETCH' + task_count: 1616 + task_total_time_ms: 125 + transform_count: 300 + transform_time_ms: 44 + transform_yield_count: 93 + insert_time_ms: 4 + insert_new_count: 198 insert_reused_count: 18 diff --git a/yaml-tests/src/test/resources/null-extraction-tests.yamsql b/yaml-tests/src/test/resources/null-extraction-tests.yamsql index 94190c8e0c..ddeddc4b77 100644 --- a/yaml-tests/src/test/resources/null-extraction-tests.yamsql +++ b/yaml-tests/src/test/resources/null-extraction-tests.yamsql @@ -55,23 +55,23 @@ test_block: # subsequent runs of the same query will reuse the cached plan since the equality constraint # is satisfied when both arguments are `null`. - query: select * from B where !! !n null !! = 42 and !! !n null !! = 43 - - explainContains: "COVERING(I1 <,> -> [B1: KEY:[3], B2: KEY:[1], B3: KEY:[0]])" + - explainContains: "SCAN(<,>)" - result: [] - - query: select * from B where !! !n null !! = 42 and !! 50 !! = 43 - - explainContains: "COVERING(I1 <,> -> [B1: KEY:[3], B2: KEY:[1], B3: KEY:[0]])" + - explainContains: "SCAN(<,>)" - result: [] - - query: select * from B where !! 41 !! = 42 and !! !n null !! = 43 - - explainContains: "COVERING(I1 <,> -> [B1: KEY:[3], B2: KEY:[1], B3: KEY:[0]])" + - explainContains: "SCAN(<,>)" - result: [] - - query: select * from B where !! 46 !! = 42 and !! 47 !! = 43 - - explainContains: "COVERING(I1 <,> -> [B1: KEY:[3], B2: KEY:[1], B3: KEY:[0]])" + - explainContains: "SCAN(<,>)" - result: [] - - query: select * from B where !! 42 !! = 42 and !! 43 !! = 43 and !! 45 !! = 45 - - explainContains: "COVERING(I1 <,> -> [B1: KEY:[3], B2: KEY:[1], B3: KEY:[0]])" + - explainContains: "SCAN(<,>)" - result: [{1, 'a', 2}, {3, 'b', 4}, {5, 'c', 6}] --- test_block: @@ -88,22 +88,22 @@ test_block: - result: [{3, 'b', 4}] - - query: select * from B where !! !n null !! = 42 and !! !n null !! = 43 - - explainContains: "COVERING(I1 <,> -> [B1: KEY:[3], B2: KEY:[1], B3: KEY:[0]])" + - explainContains: "SCAN(<,>)" - result: [] - - query: select * from B where !! !n null !! = 42 and !! 50 !! = 43 - - explainContains: "COVERING(I1 <,> -> [B1: KEY:[3], B2: KEY:[1], B3: KEY:[0]])" + - explainContains: "SCAN(<,>)" - result: [] - - query: select * from B where !! 41 !! = 42 and !! !n null !! = 43 - - explainContains: "COVERING(I1 <,> -> [B1: KEY:[3], B2: KEY:[1], B3: KEY:[0]])" + - explainContains: "SCAN(<,>)" - result: [] - - query: select * from B where !! 46 !! = 42 and !! 47 !! = 43 - - explainContains: "COVERING(I1 <,> -> [B1: KEY:[3], B2: KEY:[1], B3: KEY:[0]])" + - explainContains: "SCAN(<,>)" - result: [] - - query: select * from B where !! 42 !! = 42 and !! 43 !! = 43 and !! 45 !! = 45 - - explainContains: "COVERING(I1 <,> -> [B1: KEY:[3], B2: KEY:[1], B3: KEY:[0]])" + - explainContains: "SCAN(<,>)" - result: [{1, 'a', 2}, {3, 'b', 4}, {5, 'c', 6}] ... diff --git a/yaml-tests/src/test/resources/pseudo-field-clash.metrics.binpb b/yaml-tests/src/test/resources/pseudo-field-clash.metrics.binpb new file mode 100644 index 0000000000..c47f003272 --- /dev/null +++ b/yaml-tests/src/test/resources/pseudo-field-clash.metrics.binpb @@ -0,0 +1,295 @@ +ò +6 +pseudo-field-clash-queriesEXPLAIN SELECT * FROM t1· +»¸Á³+. ïŽØ!(0Áù[8@[SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.__ROW_VERSION AS __ROW_VERSION)¼digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Value Computation
MAP (q2.ID AS ID, q2.COL1 AS COL1, q2.__ROW_VERSION AS __ROW_VERSION)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, BYTES AS __ROW_VERSION)" ]; + 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, STRING AS COL1, BYTES AS __ROW_VERSION)" ]; + 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: [T1, T2]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; + 3 -> 2 [ label=< q19> label="q19" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}˜ +6 +pseudo-field-clash-queriesEXPLAIN SELECT * FROM t2Ý +±§”´ +f ±§è(-0ÚÞ38-@šCOVERING(T2_COL1_VERSION <,> -> [COL1: KEY:[0], ID: KEY:[3], __ROW_VERSION: KEY:[1]]) | MAP (_.ID AS ID, _.COL1 AS COL1, _.__ROW_VERSION AS __ROW_VERSION)¢ digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Value Computation
MAP (q56.ID AS ID, q56.COL1 AS COL1, q56.__ROW_VERSION AS __ROW_VERSION)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS __ROW_VERSION)" ]; + 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, STRING AS __ROW_VERSION)" ]; + 3 [ label=<
Index
T2_COL1_VERSION
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS __ROW_VERSION)" ]; + 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q56> label="q56" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}¹ +6 +pseudo-field-clash-queriesEXPLAIN SELECT * FROM t3þ +¥•âÇ F ©ãÒ(!0³¬H8#@HISCAN(T3_VERSION <,>) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)– digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ 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, STRING AS COL2)" ]; + 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, STRING AS COL2, VERSION AS __ROW_VERSION)" ]; + 3 [ label=<
Index
T3_VERSION
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS COL2, VERSION AS __ROW_VERSION)" ]; + 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" ]; +}Ó +H +pseudo-field-clash-queries*EXPLAIN SELECT ID, "__ROW_VERSION" FROM t1† +Ÿóö”,) ¡ú#( 0¢”w8@KSCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.__ROW_VERSION AS __ROW_VERSION)›digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Value Computation
MAP (q2.ID AS ID, q2.__ROW_VERSION AS __ROW_VERSION)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, BYTES AS __ROW_VERSION)" ]; + 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, STRING AS COL1, BYTES AS __ROW_VERSION)" ]; + 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: [T1, T2]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; + 3 -> 2 [ label=< q19> label="q19" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}á +H +pseudo-field-clash-queries*EXPLAIN SELECT ID, "__ROW_VERSION" FROM t2” +ÝÕ–=N ÛÓ-(%0ŽÖ²8)@vCOVERING(T2_VERSION <,> -> [ID: KEY:[2], __ROW_VERSION: KEY:[0]]) | MAP (_.ID AS ID, _.__ROW_VERSION AS __ROW_VERSION)ý +digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Value Computation
MAP (q58.ID AS ID, q58.__ROW_VERSION AS __ROW_VERSION)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS __ROW_VERSION)" ]; + 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, STRING AS __ROW_VERSION)" ]; + 3 [ label=<
Index
T2_VERSION
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS __ROW_VERSION)" ]; + 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q58> label="q58" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}Ë +H +pseudo-field-clash-queries*EXPLAIN SELECT ID, "__ROW_VERSION" FROM t3þ +¥’ÆàBF Œÿì0(!0´ÍÖ8#@JISCAN(T3_VERSION <,>) | MAP (_.ID AS ID, _.__ROW_VERSION AS __ROW_VERSION)“ digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Value Computation
MAP (q2.ID AS ID, q2.__ROW_VERSION AS __ROW_VERSION)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, 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, LONG AS COL1, STRING AS COL2, VERSION AS __ROW_VERSION)" ]; + 3 [ label=<
Index
T3_VERSION
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS COL2, VERSION AS __ROW_VERSION)" ]; + 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 +pseudo-field-clash-queries6EXPLAIN SELECT * FROM t2 ORDER BY "__ROW_VERSION" DESCØ +ìô‚º5@ ¢¢Ô#(0”·H8@ISCAN(T2_VERSION <,> REVERSE)›digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ 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, STRING AS __ROW_VERSION)" ]; + 2 [ label=<
Index
T2_VERSION
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS __ROW_VERSION)" ]; + 2 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}‘ +T +pseudo-field-clash-queries6EXPLAIN SELECT * FROM t3 ORDER BY "__ROW_VERSION" DESC¸ +¾þûS ñŽÝ(!0”‰)8@PISCAN(T3_VERSION <,> REVERSE) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)È digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Value Computation
MAP (q6.ID AS ID, q6.COL1 AS COL1, q6.COL2 AS COL2)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS COL2)" ]; + 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, STRING AS COL2, VERSION AS __ROW_VERSION)" ]; + 3 [ label=<
Index
T3_VERSION
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS COL2, VERSION AS __ROW_VERSION)" ]; + 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" ]; +}Å +[ +pseudo-field-clash-queries=EXPLAIN SELECT id, col1 FROM t2 ORDER BY "__ROW_VERSION" DESCå +¾…ç S þ¸ï(!0êð"8@@ISCAN(T2_VERSION <,> REVERSE) | MAP (_.ID AS ID, _.COL1 AS COL1)… digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Value Computation
MAP (q6.ID AS ID, q6.COL1 AS COL1)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1)" ]; + 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, STRING AS __ROW_VERSION)" ]; + 3 [ label=<
Index
T2_VERSION
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS __ROW_VERSION)" ]; + 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" ]; +}Õ +[ +pseudo-field-clash-queries=EXPLAIN SELECT id, col1 FROM t3 ORDER BY "__ROW_VERSION" DESCõ +€–ŸÀ>E þý)(0›”‹8@…ISCAN(T3_VERSION <,> REVERSE) | MAP (_.ID AS ID, _.COL1 AS COL1, _.__ROW_VERSION AS __ROW_VERSION) | MAP (_.ID AS ID, _.COL1 AS COL1)Îdigraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Value Computation
MAP (q6.ID AS ID, q6.COL1 AS COL1)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1)" ]; + 2 [ label=<
Value Computation
MAP (q2.ID AS ID, q2.COL1 AS COL1, q2.__ROW_VERSION AS __ROW_VERSION)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, VERSION AS __ROW_VERSION)" ]; + 3 [ 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, STRING AS COL2, VERSION AS __ROW_VERSION)" ]; + 4 [ label=<
Index
T3_VERSION
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS COL2, VERSION AS __ROW_VERSION)" ]; + 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=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}î +V +pseudo-field-clash-queries8EXPLAIN SELECT * FROM t1 WHERE "__ROW_VERSION" > x'0010'“ +ê„ì®9 Ñý¡(0þ–08@—SCAN(<,>) | TFILTER T1 | FILTER _.__ROW_VERSION GREATER_THAN promote(@c8 AS BYTES) | MAP (_.ID AS ID, _.COL1 AS COL1, _.__ROW_VERSION AS __ROW_VERSION)Ûdigraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Value Computation
MAP (q27.ID AS ID, q27.COL1 AS COL1, q27.__ROW_VERSION AS __ROW_VERSION)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, BYTES AS __ROW_VERSION)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.__ROW_VERSION GREATER_THAN promote(@c8 AS BYTES)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, BYTES AS __ROW_VERSION)" ]; + 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, STRING AS COL1, BYTES AS __ROW_VERSION)" ]; + 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: [T1, T2]
> 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=< q20> label="q20" 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=< q27> label="q27" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}¸ +S +pseudo-field-clash-queries5EXPLAIN SELECT * FROM t2 WHERE "__ROW_VERSION" > 'ab'à +绋Â9… ó Õ(40 Ž‚8E@9ISCAN(T2_VERSION [[GREATER_THAN promote(@c8 AS STRING)]])…digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Index Scan
comparisons: [[GREATER_THAN promote(@c8 AS STRING)]]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS __ROW_VERSION)" ]; + 2 [ label=<
Index
T2_VERSION
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS __ROW_VERSION)" ]; + 2 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}  +F +pseudo-field-clash-queries(EXPLAIN SELECT * FROM t2 WHERE col1 = 20Õ +“ÁÔ9s üé!(/0±Þ–8:@4ISCAN(T2_COL1_VERSION [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, LONG AS COL1, STRING AS __ROW_VERSION)" ]; + 2 [ label=<
Index
T2_COL1_VERSION
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS __ROW_VERSION)" ]; + 2 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} +F +pseudo-field-clash-queries(EXPLAIN SELECT * FROM t3 WHERE col1 = 20¶ +¥¡¥ìA‹ ¨ *(+0Åî§8;@gISCAN(T3_COL1_VERSION [EQUALS promote(@c8 AS LONG)]) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)­ digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ 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, STRING 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, STRING AS COL2, VERSION AS __ROW_VERSION)" ]; + 3 [ label=<
Index
T3_COL1_VERSION
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS COL2, VERSION AS __ROW_VERSION)" ]; + 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" ]; +}÷ +d +pseudo-field-clash-queriesFEXPLAIN SELECT * FROM t2 WHERE col1 = 20 ORDER BY "__ROW_VERSION" DESCŽ +®ûãª4N ¼äÍ(("0Û½U8@Index Scancomparisons: [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, STRING AS __ROW_VERSION)" ]; + 2 [ label=<
Index
T2_COL1_VERSION
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS __ROW_VERSION)" ]; + 2 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}× +d +pseudo-field-clash-queriesFEXPLAIN SELECT * FROM t3 WHERE col1 = 20 ORDER BY "__ROW_VERSION" DESCî +†ꦃ6a Ü—Š(%0¢p8%@oISCAN(T3_COL1_VERSION [EQUALS promote(@c8 AS LONG)] REVERSE) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)ß digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Value Computation
MAP (q6.ID AS ID, q6.COL1 AS COL1, q6.COL2 AS COL2)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS COL2)" ]; + 2 [ label=<
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, STRING AS COL2, VERSION AS __ROW_VERSION)" ]; + 3 [ label=<
Index
T3_COL1_VERSION
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS COL2, VERSION AS __ROW_VERSION)" ]; + 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 +pseudo-field-clash-queriesMEXPLAIN SELECT id, col1 FROM t2 WHERE col1 = 20 ORDER BY "__ROW_VERSION" DESCæ +˜Áè€d ϶§(&0µß78'@›COVERING(T2_COL1_VERSION [EQUALS promote(@c10 AS LONG)] REVERSE -> [COL1: KEY:[0], ID: KEY:[3], __ROW_VERSION: KEY:[1]]) | MAP (_.ID AS ID, _.COL1 AS COL1)ª digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Value Computation
MAP (q57.ID AS ID, q57.COL1 AS COL1)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1)" ]; + 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, STRING AS __ROW_VERSION)" ]; + 3 [ label=<
Index
T2_COL1_VERSION
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS __ROW_VERSION)" ]; + 3 -> 2 [ 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" ]; +}œ +k +pseudo-field-clash-queriesMEXPLAIN SELECT id, col1 FROM t3 WHERE col1 = 20 ORDER BY "__ROW_VERSION" DESC¬ +— àÐq ÷ž­(#0…¾C8&@¥ISCAN(T3_COL1_VERSION [EQUALS promote(@c10 AS LONG)] REVERSE) | MAP (_.ID AS ID, _.COL1 AS COL1, _.__ROW_VERSION AS __ROW_VERSION) | MAP (_.ID AS ID, _.COL1 AS COL1)ædigraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Value Computation
MAP (q6.ID AS ID, q6.COL1 AS COL1)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1)" ]; + 2 [ label=<
Value Computation
MAP (q2.ID AS ID, q2.COL1 AS COL1, q2.__ROW_VERSION AS __ROW_VERSION)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, VERSION AS __ROW_VERSION)" ]; + 3 [ label=<
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, STRING AS COL2, VERSION AS __ROW_VERSION)" ]; + 4 [ label=<
Index
T3_COL1_VERSION
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS COL2, VERSION AS __ROW_VERSION)" ]; + 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=< q6> label="q6" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}°. +y +pseudo-field-clash-queries[EXPLAIN SELECT (t1.*), (t2.*), (t3.*) FROM t1, t2, t3 WHERE t2.id = t1.id AND t3.id = t1.id²- +Ñ”çÁÂô ÉâÑ:(Û0ù®å8»@'¦ISCAN(T3_VERSION <,>) | FLATMAP q0 -> { ISCAN(T2_VERSION <,>) | FLATMAP q1 -> { SCAN(<,>) | TFILTER T1 | FILTER q1.ID EQUALS _.ID AND q0.ID EQUALS _.ID AS q2 RETURN (q2 AS _0, q1 AS _1) } AS q3 RETURN ((q3._0.ID AS ID, q3._0.COL1 AS COL1, q3._0.__ROW_VERSION AS __ROW_VERSION) AS _0, (q3._1.ID AS ID, q3._1.COL1 AS COL1, q3._1.__ROW_VERSION AS __ROW_VERSION) AS _1, (q0.ID AS ID, q0.COL1 AS COL1, q0.COL2 AS COL2) AS _2) }æ)digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Nested Loop Join
FLATMAP ((q99._0.ID AS ID, q99._0.COL1 AS COL1, q99._0.__ROW_VERSION AS __ROW_VERSION) AS _0, (q99._1.ID AS ID, q99._1.COL1 AS COL1, q99._1.__ROW_VERSION AS __ROW_VERSION) AS _1, (q10.ID AS ID, q10.COL1 AS COL1, q10.COL2 AS COL2) AS _2)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, BYTES AS __ROW_VERSION AS _0, LONG AS ID, LONG AS COL1, STRING AS __ROW_VERSION AS _1, LONG AS ID, LONG AS COL1, STRING AS COL2 AS _2)" ]; + 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, STRING AS COL2, VERSION AS __ROW_VERSION)" ]; + 3 [ label=<
Index
T3_VERSION
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS COL2, VERSION AS __ROW_VERSION)" ]; + 4 [ label=<
Nested Loop Join
FLATMAP (q2 AS _0, q6 AS _1)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, BYTES AS __ROW_VERSION AS _0, LONG AS ID, LONG AS COL1, STRING AS __ROW_VERSION AS _1)" ]; + 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, STRING AS __ROW_VERSION)" ]; + 6 [ label=<
Predicate Filter
WHERE q6.ID EQUALS q2.ID AND q10.ID EQUALS q2.ID
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, BYTES AS __ROW_VERSION)" ]; + 7 [ label=<
Index
T2_VERSION
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS __ROW_VERSION)" ]; + 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, STRING AS COL1, BYTES AS __ROW_VERSION)" ]; + 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: [T1, T2, T3]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; + 3 -> 2 [ 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" ]; + 5 -> 4 [ label=< q6> label="q6" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 4 [ label=< q2> label="q2" 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" ]; + 8 -> 6 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 9 -> 8 [ label=< q91> label="q91" 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" ]; + 4 -> 1 [ label=< q99> label="q99" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + { + rank=same; + rankDir=LR; + 5 -> 6 [ color="red" style="invis" ]; + } + { + rank=same; + rankDir=LR; + 2 -> 4 [ color="red" style="invis" ]; + } +}”0 +Ý +pseudo-field-clash-queries¾EXPLAIN SELECT (t1.id, t1.col1, t1."__ROW_VERSION"), (t2.id, t2.col1, t2."__ROW_VERSION"), (t3.id, t3.col1, t3.col2, t3."__ROW_VERSION") FROM t1, t2, t3 WHERE t2.id = t1.id AND t3.id = t1.id±. +Ñœãä•ô ¶¥/(Û0½»ø8»@'ÌISCAN(T2_VERSION <,>) | FLATMAP q0 -> { ISCAN(T3_VERSION <,>) | FLATMAP q1 -> { SCAN(<,>) | TFILTER T1 | FILTER q0.ID EQUALS _.ID AND q1.ID EQUALS _.ID AS q2 RETURN (q2 AS _0, q1 AS _1) } AS q3 RETURN ((q3._0.ID AS ID, q3._0.COL1 AS COL1, q3._0.__ROW_VERSION AS __ROW_VERSION) AS _0, (q0.ID AS ID, q0.COL1 AS COL1, q0.__ROW_VERSION AS __ROW_VERSION) AS _1, (q3._1.ID AS ID, q3._1.COL1 AS COL1, q3._1.COL2 AS COL2, q3._1.__ROW_VERSION AS __ROW_VERSION) AS _2) }¿*digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Nested Loop Join
FLATMAP ((q101._0.ID AS ID, q101._0.COL1 AS COL1, q101._0.__ROW_VERSION AS __ROW_VERSION) AS _0, (q6.ID AS ID, q6.COL1 AS COL1, q6.__ROW_VERSION AS __ROW_VERSION) AS _1, (q101._1.ID AS ID, q101._1.COL1 AS COL1, q101._1.COL2 AS COL2, q101._1.__ROW_VERSION AS __ROW_VERSION) AS _2)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, BYTES AS __ROW_VERSION AS _0, LONG AS ID, LONG AS COL1, STRING AS __ROW_VERSION AS _1, LONG AS ID, LONG AS COL1, STRING AS COL2, VERSION AS __ROW_VERSION AS _2)" ]; + 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, STRING AS __ROW_VERSION)" ]; + 3 [ label=<
Index
T2_VERSION
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS __ROW_VERSION)" ]; + 4 [ label=<
Nested Loop Join
FLATMAP (q2 AS _0, q10 AS _1)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, BYTES AS __ROW_VERSION AS _0, LONG AS ID, LONG AS COL1, STRING AS COL2, VERSION AS __ROW_VERSION AS _1)" ]; + 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, STRING AS COL2, VERSION AS __ROW_VERSION)" ]; + 6 [ label=<
Predicate Filter
WHERE q6.ID EQUALS q2.ID AND q10.ID EQUALS q2.ID
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, BYTES AS __ROW_VERSION)" ]; + 7 [ label=<
Index
T3_VERSION
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS COL2, VERSION AS __ROW_VERSION)" ]; + 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, STRING AS COL1, BYTES AS __ROW_VERSION)" ]; + 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: [T1, T2, T3]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; + 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="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q10> label="q10" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 4 [ label=< q2> label="q2" 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" ]; + 8 -> 6 [ label=< q2> label="q2" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 9 -> 8 [ label=< q91> label="q91" 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" ]; + 4 -> 1 [ label=< q101> label="q101" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + { + rank=same; + rankDir=LR; + 2 -> 4 [ color="red" style="invis" ]; + } + { + rank=same; + rankDir=LR; + 5 -> 6 [ color="red" style="invis" ]; + } +} \ No newline at end of file diff --git a/yaml-tests/src/test/resources/pseudo-field-clash.metrics.yaml b/yaml-tests/src/test/resources/pseudo-field-clash.metrics.yaml new file mode 100644 index 0000000000..f4faf35189 --- /dev/null +++ b/yaml-tests/src/test/resources/pseudo-field-clash.metrics.yaml @@ -0,0 +1,229 @@ +pseudo-field-clash-queries: +- query: EXPLAIN SELECT * FROM t1 + explain: SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.__ROW_VERSION + AS __ROW_VERSION) + task_count: 187 + task_total_time_ms: 91 + transform_count: 46 + transform_time_ms: 70 + transform_yield_count: 15 + insert_time_ms: 1 + insert_new_count: 16 + insert_reused_count: 1 +- query: EXPLAIN SELECT * FROM t2 + explain: 'COVERING(T2_COL1_VERSION <,> -> [COL1: KEY:[0], ID: KEY:[3], __ROW_VERSION: + KEY:[1]]) | MAP (_.ID AS ID, _.COL1 AS COL1, _.__ROW_VERSION AS __ROW_VERSION)' + task_count: 433 + task_total_time_ms: 21 + transform_count: 102 + transform_time_ms: 8 + transform_yield_count: 45 + insert_time_ms: 0 + insert_new_count: 45 + insert_reused_count: 5 +- query: EXPLAIN SELECT * FROM t3 + explain: ISCAN(T3_VERSION <,>) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) + task_count: 293 + task_total_time_ms: 24 + transform_count: 70 + transform_time_ms: 11 + transform_yield_count: 33 + insert_time_ms: 1 + insert_new_count: 35 + insert_reused_count: 6 +- query: EXPLAIN SELECT ID, "__ROW_VERSION" FROM t1 + explain: SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.__ROW_VERSION AS __ROW_VERSION) + task_count: 159 + task_total_time_ms: 92 + transform_count: 41 + transform_time_ms: 73 + transform_yield_count: 13 + insert_time_ms: 1 + insert_new_count: 15 + insert_reused_count: 2 +- query: EXPLAIN SELECT ID, "__ROW_VERSION" FROM t2 + explain: 'COVERING(T2_VERSION <,> -> [ID: KEY:[2], __ROW_VERSION: KEY:[0]]) | + MAP (_.ID AS ID, _.__ROW_VERSION AS __ROW_VERSION)' + task_count: 349 + task_total_time_ms: 127 + transform_count: 78 + transform_time_ms: 95 + transform_yield_count: 37 + insert_time_ms: 2 + insert_new_count: 41 + insert_reused_count: 6 +- query: EXPLAIN SELECT ID, "__ROW_VERSION" FROM t3 + explain: ISCAN(T3_VERSION <,>) | MAP (_.ID AS ID, _.__ROW_VERSION AS __ROW_VERSION) + task_count: 293 + task_total_time_ms: 139 + transform_count: 70 + transform_time_ms: 102 + transform_yield_count: 33 + insert_time_ms: 3 + insert_new_count: 35 + insert_reused_count: 6 +- query: EXPLAIN SELECT * FROM t2 ORDER BY "__ROW_VERSION" DESC + explain: ISCAN(T2_VERSION <,> REVERSE) + task_count: 236 + task_total_time_ms: 112 + transform_count: 64 + transform_time_ms: 74 + transform_yield_count: 30 + insert_time_ms: 1 + insert_new_count: 20 + insert_reused_count: 2 +- query: EXPLAIN SELECT * FROM t3 ORDER BY "__ROW_VERSION" DESC + explain: ISCAN(T3_VERSION <,> REVERSE) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 + AS COL2) + task_count: 318 + task_total_time_ms: 29 + transform_count: 83 + transform_time_ms: 12 + transform_yield_count: 33 + insert_time_ms: 0 + insert_new_count: 27 + insert_reused_count: 2 +- query: EXPLAIN SELECT id, col1 FROM t2 ORDER BY "__ROW_VERSION" DESC + explain: ISCAN(T2_VERSION <,> REVERSE) | MAP (_.ID AS ID, _.COL1 AS COL1) + task_count: 318 + task_total_time_ms: 23 + transform_count: 83 + transform_time_ms: 8 + transform_yield_count: 33 + insert_time_ms: 0 + insert_new_count: 27 + insert_reused_count: 2 +- query: EXPLAIN SELECT id, col1 FROM t3 ORDER BY "__ROW_VERSION" DESC + explain: ISCAN(T3_VERSION <,> REVERSE) | MAP (_.ID AS ID, _.COL1 AS COL1, _.__ROW_VERSION + AS __ROW_VERSION) | MAP (_.ID AS ID, _.COL1 AS COL1) + task_count: 256 + task_total_time_ms: 131 + transform_count: 69 + transform_time_ms: 88 + transform_yield_count: 28 + insert_time_ms: 2 + insert_new_count: 21 + insert_reused_count: 2 +- query: EXPLAIN SELECT * FROM t1 WHERE "__ROW_VERSION" > x'0010' + explain: SCAN(<,>) | TFILTER T1 | FILTER _.__ROW_VERSION GREATER_THAN promote(@c8 + AS BYTES) | MAP (_.ID AS ID, _.COL1 AS COL1, _.__ROW_VERSION AS __ROW_VERSION) + task_count: 234 + task_total_time_ms: 17 + transform_count: 57 + transform_time_ms: 6 + transform_yield_count: 18 + insert_time_ms: 0 + insert_new_count: 24 + insert_reused_count: 1 +- query: EXPLAIN SELECT * FROM t2 WHERE "__ROW_VERSION" > 'ab' + explain: ISCAN(T2_VERSION [[GREATER_THAN promote(@c8 AS STRING)]]) + task_count: 615 + task_total_time_ms: 120 + transform_count: 133 + transform_time_ms: 64 + transform_yield_count: 52 + insert_time_ms: 6 + insert_new_count: 69 + insert_reused_count: 5 +- query: EXPLAIN SELECT * FROM t2 WHERE col1 = 20 + explain: ISCAN(T2_COL1_VERSION [EQUALS promote(@c8 AS LONG)]) + task_count: 531 + task_total_time_ms: 120 + transform_count: 115 + transform_time_ms: 69 + transform_yield_count: 47 + insert_time_ms: 17 + insert_new_count: 58 + insert_reused_count: 5 +- query: EXPLAIN SELECT * FROM t3 WHERE col1 = 20 + explain: ISCAN(T3_COL1_VERSION [EQUALS promote(@c8 AS LONG)]) | MAP (_.ID AS ID, + _.COL1 AS COL1, _.COL2 AS COL2) + task_count: 549 + task_total_time_ms: 138 + transform_count: 139 + transform_time_ms: 88 + transform_yield_count: 43 + insert_time_ms: 6 + insert_new_count: 59 + insert_reused_count: 5 +- query: EXPLAIN SELECT * FROM t2 WHERE col1 = 20 ORDER BY "__ROW_VERSION" DESC + explain: ISCAN(T2_COL1_VERSION [EQUALS promote(@c8 AS LONG)] REVERSE) + task_count: 302 + task_total_time_ms: 109 + transform_count: 78 + transform_time_ms: 85 + transform_yield_count: 34 + insert_time_ms: 1 + insert_new_count: 29 + insert_reused_count: 2 +- query: EXPLAIN SELECT * FROM t3 WHERE col1 = 20 ORDER BY "__ROW_VERSION" DESC + explain: ISCAN(T3_COL1_VERSION [EQUALS promote(@c8 AS LONG)] REVERSE) | MAP (_.ID + AS ID, _.COL1 AS COL1, _.COL2 AS COL2) + task_count: 390 + task_total_time_ms: 113 + transform_count: 97 + transform_time_ms: 65 + transform_yield_count: 37 + insert_time_ms: 1 + insert_new_count: 37 + insert_reused_count: 2 +- query: EXPLAIN SELECT id, col1 FROM t2 WHERE col1 = 20 ORDER BY "__ROW_VERSION" + DESC + explain: 'COVERING(T2_COL1_VERSION [EQUALS promote(@c10 AS LONG)] REVERSE -> [COL1: + KEY:[0], ID: KEY:[3], __ROW_VERSION: KEY:[1]]) | MAP (_.ID AS ID, _.COL1 AS + COL1)' + task_count: 408 + task_total_time_ms: 37 + transform_count: 100 + transform_time_ms: 13 + transform_yield_count: 38 + insert_time_ms: 0 + insert_new_count: 39 + insert_reused_count: 2 +- query: EXPLAIN SELECT id, col1 FROM t3 WHERE col1 = 20 ORDER BY "__ROW_VERSION" + DESC + explain: ISCAN(T3_COL1_VERSION [EQUALS promote(@c10 AS LONG)] REVERSE) | MAP (_.ID + AS ID, _.COL1 AS COL1, _.__ROW_VERSION AS __ROW_VERSION) | MAP (_.ID AS ID, + _.COL1 AS COL1) + task_count: 407 + task_total_time_ms: 30 + transform_count: 113 + transform_time_ms: 11 + transform_yield_count: 35 + insert_time_ms: 1 + insert_new_count: 38 + insert_reused_count: 2 +- query: EXPLAIN SELECT (t1.*), (t2.*), (t3.*) FROM t1, t2, t3 WHERE t2.id = t1.id + AND t3.id = t1.id + explain: ISCAN(T3_VERSION <,>) | FLATMAP q0 -> { ISCAN(T2_VERSION <,>) | FLATMAP + q1 -> { SCAN(<,>) | TFILTER T1 | FILTER q1.ID EQUALS _.ID AND q0.ID EQUALS + _.ID AS q2 RETURN (q2 AS _0, q1 AS _1) } AS q3 RETURN ((q3._0.ID AS ID, q3._0.COL1 + AS COL1, q3._0.__ROW_VERSION AS __ROW_VERSION) AS _0, (q3._1.ID AS ID, q3._1.COL1 + AS COL1, q3._1.__ROW_VERSION AS __ROW_VERSION) AS _1, (q0.ID AS ID, q0.COL1 + AS COL1, q0.COL2 AS COL2) AS _2) } + task_count: 3409 + task_total_time_ms: 407 + transform_count: 1012 + transform_time_ms: 122 + transform_yield_count: 219 + insert_time_ms: 31 + insert_new_count: 571 + insert_reused_count: 39 +- query: EXPLAIN SELECT (t1.id, t1.col1, t1."__ROW_VERSION"), (t2.id, t2.col1, t2."__ROW_VERSION"), + (t3.id, t3.col1, t3.col2, t3."__ROW_VERSION") FROM t1, t2, t3 WHERE t2.id + = t1.id AND t3.id = t1.id + explain: ISCAN(T2_VERSION <,>) | FLATMAP q0 -> { ISCAN(T3_VERSION <,>) | FLATMAP + q1 -> { SCAN(<,>) | TFILTER T1 | FILTER q0.ID EQUALS _.ID AND q1.ID EQUALS + _.ID AS q2 RETURN (q2 AS _0, q1 AS _1) } AS q3 RETURN ((q3._0.ID AS ID, q3._0.COL1 + AS COL1, q3._0.__ROW_VERSION AS __ROW_VERSION) AS _0, (q0.ID AS ID, q0.COL1 + AS COL1, q0.__ROW_VERSION AS __ROW_VERSION) AS _1, (q3._1.ID AS ID, q3._1.COL1 + AS COL1, q3._1.COL2 AS COL2, q3._1.__ROW_VERSION AS __ROW_VERSION) AS _2) + } + task_count: 3409 + task_total_time_ms: 314 + transform_count: 1012 + transform_time_ms: 99 + transform_yield_count: 219 + insert_time_ms: 18 + insert_new_count: 571 + insert_reused_count: 39 diff --git a/yaml-tests/src/test/resources/pseudo-field-clash.yamsql b/yaml-tests/src/test/resources/pseudo-field-clash.yamsql new file mode 100644 index 0000000000..d3b5923f01 --- /dev/null +++ b/yaml-tests/src/test/resources/pseudo-field-clash.yamsql @@ -0,0 +1,271 @@ +# +# pseudo-field-clash.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. + +--- +schema_template: + create table t1(id bigint, col1 string, "__ROW_VERSION" bytes, primary key (id)) + + create table t2(id bigint, col1 bigint, "__ROW_VERSION" string, primary key (id)) + + create index t2_version as select "__ROW_VERSION" from t2 + create index t2_col1_version as select col1, "__ROW_VERSION" from t2 order by col1, "__ROW_VERSION" + + create table t3(id bigint, col1 bigint, col2 string, primary key (id)) + create index t3_version as select "__ROW_VERSION" from t3 + create index t3_col1_version as select col1, "__ROW_VERSION" from t3 order by col1, "__ROW_VERSION" + + with options (store_row_versions=true) +--- +setup: + steps: + # Insert the odd values first, and then the even values. This will ensure that the order by the explicit "__ROW_VERSION" + # does not match the order by the underlying version + - query: INSERT INTO T1 VALUES + (1, 'a', x'0000'), + (3, 'c', x'0010'), + (5, 'b', x'0100') + - query: INSERT INTO T2 VALUES + (1, 10, 'aa'), + (3, 10, 'ac'), + (5, 10, 'ae') + - query: INSERT INTO T3 VALUES + (1, 10, 'aa'), + (3, 10, 'ac'), + (5, 10, 'ae') + - query: INSERT INTO T1 VALUES + (2, 'b', x'0001'), + (4, 'a', x'0011'), + (6, 'c', x'0101') + - query: INSERT INTO T2 VALUES + (2, 20, 'ab'), + (4, 20, 'ad'), + (6, 20, 'af') + - query: INSERT INTO T3 VALUES + (2, 20, 'ab'), + (4, 20, 'ad'), + (6, 20, 'af') +--- +test_block: + name: pseudo-field-clash-queries + tests: + - + - query: SELECT * FROM t1 + - explain: "SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.__ROW_VERSION AS __ROW_VERSION)" + - unorderedResult: [ + { ID: 1, COL1: "a", '__ROW_VERSION': x'0000' }, + { ID: 2, COL1: "b", '__ROW_VERSION': x'0001' }, + { ID: 3, COL1: "c", '__ROW_VERSION': x'0010' }, + { ID: 4, COL1: "a", '__ROW_VERSION': x'0011' }, + { ID: 5, COL1: "b", '__ROW_VERSION': x'0100' }, + { ID: 6, COL1: "c", '__ROW_VERSION': x'0101' }, + ] + - + - query: SELECT * FROM t2 + - explain: "COVERING(T2_COL1_VERSION <,> -> [COL1: KEY:[0], ID: KEY:[3], __ROW_VERSION: KEY:[1]]) | MAP (_.ID AS ID, _.COL1 AS COL1, _.__ROW_VERSION AS __ROW_VERSION)" + - unorderedResult: [ + { ID: 1, COL1: 10, '__ROW_VERSION': "aa" }, + { ID: 2, COL1: 20, '__ROW_VERSION': "ab" }, + { ID: 3, COL1: 10, '__ROW_VERSION': "ac" }, + { ID: 4, COL1: 20, '__ROW_VERSION': "ad" }, + { ID: 5, COL1: 10, '__ROW_VERSION': "ae" }, + { ID: 6, COL1: 20, '__ROW_VERSION': "af" }, + ] + - + - query: SELECT * FROM t3 + - explain: "ISCAN(T3_VERSION <,>) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)" + - unorderedResult: [ + { ID: 1, COL1: 10, COL2: "aa" }, + { ID: 2, COL1: 20, COL2: "ab" }, + { ID: 3, COL1: 10, COL2: "ac" }, + { ID: 4, COL1: 20, COL2: "ad" }, + { ID: 5, COL1: 10, COL2: "ae" }, + { ID: 6, COL1: 20, COL2: "af" }, + ] + - + - query: SELECT ID, "__ROW_VERSION" FROM t1 + - explain: "SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.__ROW_VERSION AS __ROW_VERSION)" + - unorderedResult: [ + { ID: 1, '__ROW_VERSION': x'0000' }, + { ID: 2, '__ROW_VERSION': x'0001' }, + { ID: 3, '__ROW_VERSION': x'0010' }, + { ID: 4, '__ROW_VERSION': x'0011' }, + { ID: 5, '__ROW_VERSION': x'0100' }, + { ID: 6, '__ROW_VERSION': x'0101' }, + ] + - + - query: SELECT ID, "__ROW_VERSION" FROM t2 + - explain: "COVERING(T2_VERSION <,> -> [ID: KEY:[2], __ROW_VERSION: KEY:[0]]) | MAP (_.ID AS ID, _.__ROW_VERSION AS __ROW_VERSION)" + - unorderedResult: [ + { ID: 1, '__ROW_VERSION': "aa" }, + { ID: 2, '__ROW_VERSION': "ab" }, + { ID: 3, '__ROW_VERSION': "ac" }, + { ID: 4, '__ROW_VERSION': "ad" }, + { ID: 5, '__ROW_VERSION': "ae" }, + { ID: 6, '__ROW_VERSION': "af" }, + ] + - + - query: SELECT ID, "__ROW_VERSION" FROM t3 + - explain: "ISCAN(T3_VERSION <,>) | MAP (_.ID AS ID, _.__ROW_VERSION AS __ROW_VERSION)" + - unorderedResult: [ + { ID: 1, '__ROW_VERSION': !not_null _ }, + { ID: 2, '__ROW_VERSION': !not_null _ }, + { ID: 3, '__ROW_VERSION': !not_null _ }, + { ID: 4, '__ROW_VERSION': !not_null _ }, + { ID: 5, '__ROW_VERSION': !not_null _ }, + { ID: 6, '__ROW_VERSION': !not_null _ }, + ] + - + - query: SELECT * FROM t2 ORDER BY "__ROW_VERSION" DESC + - explain: "ISCAN(T2_VERSION <,> REVERSE)" + - result: [ + { ID: 6, COL1: 20, '__ROW_VERSION': "af" }, + { ID: 5, COL1: 10, '__ROW_VERSION': "ae" }, + { ID: 4, COL1: 20, '__ROW_VERSION': "ad" }, + { ID: 3, COL1: 10, '__ROW_VERSION': "ac" }, + { ID: 2, COL1: 20, '__ROW_VERSION': "ab" }, + { ID: 1, COL1: 10, '__ROW_VERSION': "aa" }, + ] + - + - query: SELECT * FROM t3 ORDER BY "__ROW_VERSION" DESC + - explain: "ISCAN(T3_VERSION <,> REVERSE) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)" + - result: [ + { ID: 6, COL1: 20, COL2: "af" }, + { ID: 4, COL1: 20, COL2: "ad" }, + { ID: 2, COL1: 20, COL2: "ab" }, + { ID: 5, COL1: 10, COL2: "ae" }, + { ID: 3, COL1: 10, COL2: "ac" }, + { ID: 1, COL1: 10, COL2: "aa" }, + ] + - + - query: SELECT id, col1 FROM t2 ORDER BY "__ROW_VERSION" DESC + - explain: "ISCAN(T2_VERSION <,> REVERSE) | MAP (_.ID AS ID, _.COL1 AS COL1)" + - result: [ + { ID: 6, COL1: 20 }, + { ID: 5, COL1: 10 }, + { ID: 4, COL1: 20 }, + { ID: 3, COL1: 10 }, + { ID: 2, COL1: 20 }, + { ID: 1, COL1: 10 }, + ] + - + - query: SELECT id, col1 FROM t3 ORDER BY "__ROW_VERSION" DESC + - explain: "ISCAN(T3_VERSION <,> REVERSE) | MAP (_.ID AS ID, _.COL1 AS COL1, _.__ROW_VERSION AS __ROW_VERSION) | MAP (_.ID AS ID, _.COL1 AS COL1)" + - result: [ + { ID: 6, COL1: 20 }, + { ID: 4, COL1: 20 }, + { ID: 2, COL1: 20 }, + { ID: 5, COL1: 10 }, + { ID: 3, COL1: 10 }, + { ID: 1, COL1: 10 }, + ] + - + - query: SELECT * FROM t1 WHERE "__ROW_VERSION" > x'0010' + - explain: "SCAN(<,>) | TFILTER T1 | FILTER _.__ROW_VERSION GREATER_THAN promote(@c8 AS BYTES) | MAP (_.ID AS ID, _.COL1 AS COL1, _.__ROW_VERSION AS __ROW_VERSION)" + - unorderedResult: [ + { ID: 4, COL1: "a", '__ROW_VERSION': x'0011' }, + { ID: 5, COL1: "b", '__ROW_VERSION': x'0100' }, + { ID: 6, COL1: "c", '__ROW_VERSION': x'0101' }, + ] + - + - query: SELECT * FROM t2 WHERE "__ROW_VERSION" > 'ab' + - explain: "ISCAN(T2_VERSION [[GREATER_THAN promote(@c8 AS STRING)]])" + - unorderedResult: [ + { ID: 3, COL1: 10, '__ROW_VERSION': "ac" }, + { ID: 4, COL1: 20, '__ROW_VERSION': "ad" }, + { ID: 5, COL1: 10, '__ROW_VERSION': "ae" }, + { ID: 6, COL1: 20, '__ROW_VERSION': "af" }, + ] + - + - query: SELECT * FROM t2 WHERE col1 = 20 + - explain: "ISCAN(T2_COL1_VERSION [EQUALS promote(@c8 AS LONG)])" + - unorderedResult: [ + { ID: 2, COL1: 20, '__ROW_VERSION': "ab" }, + { ID: 4, COL1: 20, '__ROW_VERSION': "ad" }, + { ID: 6, COL1: 20, '__ROW_VERSION': "af" }, + ] + - + - query: SELECT * FROM t3 WHERE col1 = 20 + - explain: "ISCAN(T3_COL1_VERSION [EQUALS promote(@c8 AS LONG)]) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)" + - unorderedResult: [ + { ID: 2, COL1: 20, COL2: "ab" }, + { ID: 4, COL1: 20, COL2: "ad" }, + { ID: 6, COL1: 20, COL2: "af" }, + ] + - + - query: SELECT * FROM t2 WHERE col1 = 20 ORDER BY "__ROW_VERSION" DESC + - explain: "ISCAN(T2_COL1_VERSION [EQUALS promote(@c8 AS LONG)] REVERSE)" + - result: [ + { ID: 6, COL1: 20, '__ROW_VERSION': "af" }, + { ID: 4, COL1: 20, '__ROW_VERSION': "ad" }, + { ID: 2, COL1: 20, '__ROW_VERSION': "ab" }, + ] + - + - query: SELECT * FROM t3 WHERE col1 = 20 ORDER BY "__ROW_VERSION" DESC + - explain: "ISCAN(T3_COL1_VERSION [EQUALS promote(@c8 AS LONG)] REVERSE) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)" + - unorderedResult: [ + { ID: 6, COL1: 20, COL2: "af" }, + { ID: 4, COL1: 20, COL2: "ad" }, + { ID: 2, COL1: 20, COL2: "ab" }, + ] + - + - query: SELECT id, col1 FROM t2 WHERE col1 = 20 ORDER BY "__ROW_VERSION" DESC + - explain: "COVERING(T2_COL1_VERSION [EQUALS promote(@c10 AS LONG)] REVERSE -> [COL1: KEY:[0], ID: KEY:[3], __ROW_VERSION: KEY:[1]]) | MAP (_.ID AS ID, _.COL1 AS COL1)" + - result: [ + { ID: 6, COL1: 20 }, + { ID: 4, COL1: 20 }, + { ID: 2, COL1: 20 }, + ] + - + - query: SELECT id, col1 FROM t3 WHERE col1 = 20 ORDER BY "__ROW_VERSION" DESC + - explain: "ISCAN(T3_COL1_VERSION [EQUALS promote(@c10 AS LONG)] REVERSE) | MAP (_.ID AS ID, _.COL1 AS COL1, _.__ROW_VERSION AS __ROW_VERSION) | MAP (_.ID AS ID, _.COL1 AS COL1)" + - result: [ + { ID: 6, COL1: 20 }, + { ID: 4, COL1: 20 }, + { ID: 2, COL1: 20 }, + ] + - + - query: SELECT (t1.*), (t2.*), (t3.*) + FROM t1, t2, t3 + WHERE t2.id = t1.id AND t3.id = t1.id + - explain: "ISCAN(T3_VERSION <,>) | FLATMAP q0 -> { ISCAN(T2_VERSION <,>) | FLATMAP q1 -> { SCAN(<,>) | TFILTER T1 | FILTER q1.ID EQUALS _.ID AND q0.ID EQUALS _.ID AS q2 RETURN (q2 AS _0, q1 AS _1) } AS q3 RETURN ((q3._0.ID AS ID, q3._0.COL1 AS COL1, q3._0.__ROW_VERSION AS __ROW_VERSION) AS _0, (q3._1.ID AS ID, q3._1.COL1 AS COL1, q3._1.__ROW_VERSION AS __ROW_VERSION) AS _1, (q0.ID AS ID, q0.COL1 AS COL1, q0.COL2 AS COL2) AS _2) }" + - unorderedResult: [ + { { ID: 1, COL1: "a", '__ROW_VERSION': x'0000' }, { ID: 1, COL1: 10, '__ROW_VERSION': "aa" }, { ID: 1, COL1: 10, COL2: "aa" } }, + { { ID: 2, COL1: "b", '__ROW_VERSION': x'0001' }, { ID: 2, COL1: 20, '__ROW_VERSION': "ab" }, { ID: 2, COL1: 20, COL2: "ab" } }, + { { ID: 3, COL1: "c", '__ROW_VERSION': x'0010' }, { ID: 3, COL1: 10, '__ROW_VERSION': "ac" }, { ID: 3, COL1: 10, COL2: "ac" } }, + { { ID: 4, COL1: "a", '__ROW_VERSION': x'0011' }, { ID: 4, COL1: 20, '__ROW_VERSION': "ad" }, { ID: 4, COL1: 20, COL2: "ad" } }, + { { ID: 5, COL1: "b", '__ROW_VERSION': x'0100' }, { ID: 5, COL1: 10, '__ROW_VERSION': "ae" }, { ID: 5, COL1: 10, COL2: "ae" } }, + { { ID: 6, COL1: "c", '__ROW_VERSION': x'0101' }, { ID: 6, COL1: 20, '__ROW_VERSION': "af" }, { ID: 6, COL1: 20, COL2: "af" } }, + ] + - + - query: SELECT (t1.id, t1.col1, t1."__ROW_VERSION"), (t2.id, t2.col1, t2."__ROW_VERSION"), (t3.id, t3.col1, t3.col2, t3."__ROW_VERSION") + FROM t1, t2, t3 + WHERE t2.id = t1.id AND t3.id = t1.id + - explain: "ISCAN(T2_VERSION <,>) | FLATMAP q0 -> { ISCAN(T3_VERSION <,>) | FLATMAP q1 -> { SCAN(<,>) | TFILTER T1 | FILTER q0.ID EQUALS _.ID AND q1.ID EQUALS _.ID AS q2 RETURN (q2 AS _0, q1 AS _1) } AS q3 RETURN ((q3._0.ID AS ID, q3._0.COL1 AS COL1, q3._0.__ROW_VERSION AS __ROW_VERSION) AS _0, (q0.ID AS ID, q0.COL1 AS COL1, q0.__ROW_VERSION AS __ROW_VERSION) AS _1, (q3._1.ID AS ID, q3._1.COL1 AS COL1, q3._1.COL2 AS COL2, q3._1.__ROW_VERSION AS __ROW_VERSION) AS _2) }" + - initialVersionLessThan: !current_version + - error: 'XXXXX' + - initialVersionAtLeast: !current_version + - unorderedResult: [ + { { ID: 1, COL1: "a", '__ROW_VERSION': x'0000' }, { ID: 1, COL1: 10, '__ROW_VERSION': "aa" }, { ID: 1, COL1: 10, COL2: "aa", '__ROW_VERSION': !not_null _ } }, + { { ID: 2, COL1: "b", '__ROW_VERSION': x'0001' }, { ID: 2, COL1: 20, '__ROW_VERSION': "ab" }, { ID: 2, COL1: 20, COL2: "ab", '__ROW_VERSION': !not_null _ } }, + { { ID: 3, COL1: "c", '__ROW_VERSION': x'0010' }, { ID: 3, COL1: 10, '__ROW_VERSION': "ac" }, { ID: 3, COL1: 10, COL2: "ac", '__ROW_VERSION': !not_null _ } }, + { { ID: 4, COL1: "a", '__ROW_VERSION': x'0011' }, { ID: 4, COL1: 20, '__ROW_VERSION': "ad" }, { ID: 4, COL1: 20, COL2: "ad", '__ROW_VERSION': !not_null _ } }, + { { ID: 5, COL1: "b", '__ROW_VERSION': x'0100' }, { ID: 5, COL1: 10, '__ROW_VERSION': "ae" }, { ID: 5, COL1: 10, COL2: "ae", '__ROW_VERSION': !not_null _ } }, + { { ID: 6, COL1: "c", '__ROW_VERSION': x'0101' }, { ID: 6, COL1: 20, '__ROW_VERSION': "af" }, { ID: 6, COL1: 20, COL2: "af", '__ROW_VERSION': !not_null _ } }, + ] +... diff --git a/yaml-tests/src/test/resources/select-a-star.yamsql b/yaml-tests/src/test/resources/select-a-star.yamsql index 23bd9ee899..0ea5d20784 100644 --- a/yaml-tests/src/test/resources/select-a-star.yamsql +++ b/yaml-tests/src/test/resources/select-a-star.yamsql @@ -83,7 +83,7 @@ test_block: - result: [{1}, {2}, {3}] - - query: select B.* from B where exists (select A.*, B.* from A group by A1,A2,A3); - - explain: "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 }" + - explain: "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.B1 AS B1, q0.B2 AS B2, q0.B3 AS B3) }" - result: [{1, 20, {4, 40}}, {2, 20, {5, 50}}, {3, 20, {6, 60}}] diff --git a/yaml-tests/src/test/resources/showcasing-tests.metrics.binpb b/yaml-tests/src/test/resources/showcasing-tests.metrics.binpb index 748cdb15ad..43bcf383a1 100644 --- a/yaml-tests/src/test/resources/showcasing-tests.metrics.binpb +++ b/yaml-tests/src/test/resources/showcasing-tests.metrics.binpb @@ -1,15 +1,17 @@ -— +© ; -showcasing-tests'EXPLAIN select * from t1 where id > 15;× -»ŽÁ|0 †èL(0ÎŽ8@FSCAN(<,>) | TFILTER T1 | FILTER _.ID GREATER_THAN promote(@c8 AS LONG)ó digraph G { +showcasing-tests'EXPLAIN select * from t1 where id > 15;é +Úǧ—4 µŸL(0êË8@iSCAN(<,>) | TFILTER T1 | FILTER _.ID GREATER_THAN promote(@c8 AS LONG) | MAP (_.ID AS ID, _.COL1 AS COL1)ádigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.ID GREATER_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)" ]; - 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)" ]; - 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: [T1, T2, T3]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q19> label="q19" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 1 [ label=<
Value Computation
MAP (q26.ID AS ID, q26.COL1 AS COL1)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.ID GREATER_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)" ]; + 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)" ]; + 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: [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=< q19> label="q19" 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=< q26> label="q26" 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/showcasing-tests.metrics.yaml b/yaml-tests/src/test/resources/showcasing-tests.metrics.yaml index 8e2433310a..1fdfe91b80 100644 --- a/yaml-tests/src/test/resources/showcasing-tests.metrics.yaml +++ b/yaml-tests/src/test/resources/showcasing-tests.metrics.yaml @@ -1,11 +1,12 @@ showcasing-tests: - query: EXPLAIN select * from t1 where id > 15; explain: SCAN(<,>) | TFILTER T1 | FILTER _.ID GREATER_THAN promote(@c8 AS LONG) - task_count: 187 + | MAP (_.ID AS ID, _.COL1 AS COL1) + task_count: 218 task_total_time_ms: 2 - transform_count: 48 + transform_count: 52 transform_time_ms: 1 - transform_yield_count: 14 + transform_yield_count: 16 insert_time_ms: 0 - insert_new_count: 17 - insert_reused_count: 2 + insert_new_count: 20 + insert_reused_count: 1 diff --git a/yaml-tests/src/test/resources/showcasing-tests.yamsql b/yaml-tests/src/test/resources/showcasing-tests.yamsql index f672c58e57..65a336f105 100644 --- a/yaml-tests/src/test/resources/showcasing-tests.yamsql +++ b/yaml-tests/src/test/resources/showcasing-tests.yamsql @@ -107,7 +107,7 @@ test_block: # number as Long instead of Integer so we can do proper matching. - query: select * from t1 where id > 15; # You can check the plan of a query. This configuration has to precede any result configurations - - explain: "SCAN(<,>) | TFILTER T1 | FILTER _.ID GREATER_THAN promote(@c8 AS LONG)" + - explain: "SCAN(<,>) | TFILTER T1 | FILTER _.ID GREATER_THAN promote(@c8 AS LONG) | MAP (_.ID AS ID, _.COL1 AS COL1)" # You can use the debugger option to bring up the planner repl debugger # - debugger: repl - result: [{!l 30, !ignore dc}, {!l 50, !ignore dc}] diff --git a/yaml-tests/src/test/resources/sql-functions.yamsql b/yaml-tests/src/test/resources/sql-functions.yamsql index 55ca1e9658..6e006c08d1 100644 --- a/yaml-tests/src/test/resources/sql-functions.yamsql +++ b/yaml-tests/src/test/resources/sql-functions.yamsql @@ -108,11 +108,11 @@ test_block: - result: [{101, 'b'}, {102, 'b'}] - - query: 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 }" + - 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.X AS X, q0.Y AS Y, q0.Z AS Z) }" - result: [{10, 14, 1}, {11, 16, 1}] - - query: select * from t2 where exists (select * from f2(k => 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 }" + - 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.X AS X, q0.Y AS Y, q0.Z AS Z) }" - result: [{10, 14, 1}, {11, 16, 1}] - - query: select * from f3(103, 'b', 4) diff --git a/yaml-tests/src/test/resources/standard-tests.metrics.binpb b/yaml-tests/src/test/resources/standard-tests.metrics.binpb index 262e4db92f..0842fee302 100644 --- a/yaml-tests/src/test/resources/standard-tests.metrics.binpb +++ b/yaml-tests/src/test/resources/standard-tests.metrics.binpb @@ -22,57 +22,61 @@ w 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¥ -·èÚAK ôª•,(0´‰‡8@'ISCAN(I1 [EQUALS promote(@c8 AS LONG)])Ýdigraph G { +standard-tests(EXPLAIN select * from T1 where COL1 = 20¤ +×ëœÇ Q ³þµ(0âº'8"@'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, 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" ]; -}» +}÷ I -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 | FETCHùdigraph G { +standard-tests7EXPLAIN select * from T1 where COL1 >= 10 OR COL1 <= 20© +Ý +¸Ñà$ž ©ö¬ (R0ÁíÎ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 | FETCH | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)‚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, 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: [[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)" ]; + 1 [ 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)" ]; + 2 [ 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)" ]; + 3 [ 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)" ]; + 4 [ 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)" ]; 5 [ 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)" ]; - 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)" ]; + 6 [ 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)" ]; 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=< q119> label="q119" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 3 [ label=< q117> label="q117" 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" ]; + 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=< q147> label="q147" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 3 [ label=< q145> label="q145" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q125> label="q125" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 4 [ label=< q127> label="q127" color="gray20" style="bold" 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=< q139> label="q139" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}Î + 8 -> 6 [ 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 * 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¯ +’ ü™ìú ‡ïÍ(B0ýì»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) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)º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, 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)" ]; + 1 [ 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)" ]; + 2 [ 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)" ]; + 3 [ 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)" ]; 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=< 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=< q130> label="q130" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 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=< q134> label="q134" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 2 [ label=< q136> label="q136" 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=< q2> label="q2" 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Æœ+8@fISCAN(I1 [[GREATER_THAN_OR_EQUALS promote(@c9 AS LONG) && LESS_THAN_OR_EQUALS promote(@c14 AS LONG)]])¤digraph G { +×±Ò— S ½ïø(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; @@ -82,17 +86,17 @@ J }‡ X standard-testsFEXPLAIN select * from T1 where COL1 >= 10 AND COL1 <= 20 ORDER BY COL1ª -‡œ³þ=A óÁ”*(0ÞŽ|8@fISCAN(I1 [[GREATER_THAN_OR_EQUALS promote(@c9 AS LONG) && LESS_THAN_OR_EQUALS promote(@c14 AS LONG)]])¤digraph G { +ˆÝНD ªú¼(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, 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¥ -ÇѵÄAP õàâ*( 0¥×Š8#@'ISCAN(I1 [EQUALS promote(@c8 AS LONG)])Ýdigraph G { +standard-tests5EXPLAIN select * from T1 where COL1 = 20 OR COL1 = 20¤ +箽ºV ÐúÞ(!0–18&@'ISCAN(I1 [EQUALS promote(@c8 AS LONG)])Ýdigraph G { fontname=courier; rankdir=BT; splines=polyline; @@ -102,64 +106,70 @@ G }þ U standard-testsCEXPLAIN select * from T1 where COL1 = 20 OR COL1 = 20 ORDER BY COL1¤ -—êæ›F 檌(0–Ç"8@'ISCAN(I1 [EQUALS promote(@c8 AS LONG)])Ýdigraph G { +˜Žä„ I ÇŽô(0æ,8@'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, 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¥ -·½ç³AK Âè¦+(0ã¡Ö8@'ISCAN(I1 [EQUALS promote(@c8 AS LONG)])Ýdigraph G { +standard-tests6EXPLAIN select * from T1 where COL1 = 20 AND COL1 = 20¤ +×›Øß +Q Ôù(0…æQ8"@'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, 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" ]; -}— +}Ò f -standard-testsTEXPLAIN select * from T1 where (COL1 = 20 OR COL1 = 10) AND (COL1 = 20 OR COL1 = 10)¬ -¬ûî¢eÓ ð‰ (0£Ú½ -8»@,¯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Ødigraph G { +standard-testsTEXPLAIN select * from T1 where (COL1 = 20 OR COL1 = 10) AND (COL1 = 20 OR COL1 = 10)ç + Ðͼ"¨ ®Ö¯ +(W0¼”Ì8²@â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 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)á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, 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: [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: [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)" ]; - 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)" ]; + 1 [ 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)" ]; + 2 [ 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)" ]; + 3 [ 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)" ]; + 4 [ 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)" ]; + 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, LONG AS COL1, LONG AS COL2)" ]; + 6 [ 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, 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=< q296> label="q296" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 4 -> 3 [ label=< q276> label="q276" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; - 5 -> 3 [ label=< q278> label="q278" 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" ]; + 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=< q148> label="q148" 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=< q126> label="q126" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 4 [ label=< q128> label="q128" color="gray20" style="bold" 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=< q298> label="q298" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}© + 8 -> 6 [ 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 -standard-testsbEXPLAIN select * from T1 where (COL1 = 20 OR COL1 = 10) AND (COL1 = 20 OR COL1 = 10) ORDER BY COL1° -ªÓþ€J¢ †„í(i0úÙõ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í +‚ +øÍÏ‹ “¾ (D0þ—é8@°ISCAN(I1 [EQUALS promote(@c9 AS LONG)]) ∪ ISCAN(I1 [EQUALS promote(@c13 AS LONG)]) COMPARE BY (_.COL1, recordType(_), _.ID) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)™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, 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)" ]; + 1 [ 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)" ]; + 2 [ 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)" ]; + 3 [ 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)" ]; + 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=<
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=< q283> label="q283" 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=< q285> label="q285" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 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=< q137> label="q137" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 2 [ label=< q135> label="q135" 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=< q2> label="q2" 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)¬ -ÇÃþ Q ©œ( 0©©O8#@gISCAN(I1 [[GREATER_THAN_OR_EQUALS promote(@c10 AS LONG) && LESS_THAN_OR_EQUALS promote(@c15 AS LONG)]])¥digraph G { +ç™´ÃX ÊÐÚ(!0ûî48&@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; @@ -169,8 +179,7 @@ k }ª y standard-testsgEXPLAIN select * from T1 where (COL1 >= 10 AND COL1 <= 20) OR (COL1 >= 10 AND COL1 <= 20) ORDER BY COL1¬ -—”ý„ -F Ÿ„(0«è#8@gISCAN(I1 [[GREATER_THAN_OR_EQUALS promote(@c10 AS LONG) && LESS_THAN_OR_EQUALS promote(@c15 AS LONG)]])¥digraph G { +˜áºûI íËä(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; diff --git a/yaml-tests/src/test/resources/standard-tests.metrics.yaml b/yaml-tests/src/test/resources/standard-tests.metrics.yaml index 4e54152a8c..76080b6c9b 100644 --- a/yaml-tests/src/test/resources/standard-tests.metrics.yaml +++ b/yaml-tests/src/test/resources/standard-tests.metrics.yaml @@ -25,136 +25,138 @@ standard-tests: 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: 136 - transform_count: 75 - transform_time_ms: 92 - transform_yield_count: 30 - insert_time_ms: 2 - insert_new_count: 31 - insert_reused_count: 4 + task_count: 343 + task_total_time_ms: 26 + transform_count: 81 + transform_time_ms: 11 + transform_yield_count: 31 + insert_time_ms: 0 + insert_new_count: 34 + insert_reused_count: 3 - 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: 94 - transform_count: 260 - transform_time_ms: 26 - transform_yield_count: 79 - insert_time_ms: 6 - insert_new_count: 159 - insert_reused_count: 23 + -> [COL1: KEY[0], ID: KEY[2]]) | DISTINCT BY PK | FETCH | MAP (_.ID AS ID, + _.COL1 AS COL1, _.COL2 AS COL2)' + task_count: 1373 + task_total_time_ms: 77 + transform_count: 286 + transform_time_ms: 23 + transform_yield_count: 82 + insert_time_ms: 3 + insert_new_count: 170 + insert_reused_count: 19 - query: EXPLAIN select * from T1 where COL1 >= 10 OR COL1 <= 20 ORDER BY COL1 explain: 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) - task_count: 1080 - task_total_time_ms: 84 - transform_count: 224 - transform_time_ms: 34 - transform_yield_count: 62 - insert_time_ms: 4 - insert_new_count: 125 - insert_reused_count: 14 + _.ID) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) + task_count: 1170 + task_total_time_ms: 56 + transform_count: 250 + transform_time_ms: 18 + transform_yield_count: 66 + insert_time_ms: 3 + insert_new_count: 137 + insert_reused_count: 12 - 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: 14 - transform_count: 76 - transform_time_ms: 9 - transform_yield_count: 30 + task_count: 343 + task_total_time_ms: 23 + transform_count: 83 + transform_time_ms: 10 + transform_yield_count: 31 insert_time_ms: 0 - insert_new_count: 31 - insert_reused_count: 4 + insert_new_count: 34 + insert_reused_count: 3 - 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: 129 - transform_count: 65 - transform_time_ms: 88 - transform_yield_count: 26 - insert_time_ms: 2 + task_count: 264 + task_total_time_ms: 13 + transform_count: 68 + transform_time_ms: 5 + transform_yield_count: 25 + 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: 327 - task_total_time_ms: 137 - transform_count: 80 - transform_time_ms: 89 - transform_yield_count: 32 - insert_time_ms: 2 - insert_new_count: 35 - insert_reused_count: 4 + task_count: 359 + task_total_time_ms: 30 + transform_count: 86 + transform_time_ms: 14 + transform_yield_count: 33 + insert_time_ms: 0 + insert_new_count: 38 + 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: 279 - task_total_time_ms: 17 - transform_count: 70 - transform_time_ms: 6 - transform_yield_count: 28 + task_count: 280 + task_total_time_ms: 25 + transform_count: 73 + transform_time_ms: 12 + transform_yield_count: 27 insert_time_ms: 0 insert_new_count: 28 insert_reused_count: 2 - 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: 137 - transform_count: 75 - transform_time_ms: 90 - transform_yield_count: 30 - insert_time_ms: 3 - insert_new_count: 31 - insert_reused_count: 4 + task_count: 343 + task_total_time_ms: 22 + transform_count: 81 + transform_time_ms: 8 + transform_yield_count: 31 + insert_time_ms: 1 + insert_new_count: 34 + insert_reused_count: 3 - 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: 2476 - task_total_time_ms: 212 - transform_count: 467 - transform_time_ms: 67 - transform_yield_count: 143 - insert_time_ms: 21 - insert_new_count: 315 - insert_reused_count: 44 + | DISTINCT BY PK | FETCH | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)' + task_count: 1421 + task_total_time_ms: 72 + transform_count: 296 + transform_time_ms: 21 + transform_yield_count: 87 + insert_time_ms: 3 + insert_new_count: 178 + insert_reused_count: 20 - 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: 2218 - task_total_time_ms: 155 - transform_count: 418 - transform_time_ms: 50 - transform_yield_count: 105 - insert_time_ms: 12 - insert_new_count: 247 - insert_reused_count: 42 + AS LONG)]) COMPARE BY (_.COL1, recordType(_), _.ID) | MAP (_.ID AS ID, _.COL1 + AS COL1, _.COL2 AS COL2) + task_count: 1282 + task_total_time_ms: 62 + transform_count: 267 + transform_time_ms: 19 + transform_yield_count: 68 + insert_time_ms: 3 + insert_new_count: 144 + insert_reused_count: 19 - query: EXPLAIN select * from T1 where (COL1 >= 10 AND COL1 <= 20) OR (COL1 >= 10 AND COL1 <= 20) explain: ISCAN(I1 [[GREATER_THAN_OR_EQUALS promote(@c10 AS LONG) && LESS_THAN_OR_EQUALS promote(@c15 AS LONG)]]) - task_count: 327 - task_total_time_ms: 27 - transform_count: 81 - transform_time_ms: 13 - transform_yield_count: 32 - insert_time_ms: 1 - insert_new_count: 35 - insert_reused_count: 4 + task_count: 359 + task_total_time_ms: 30 + transform_count: 88 + transform_time_ms: 14 + transform_yield_count: 33 + insert_time_ms: 0 + insert_new_count: 38 + insert_reused_count: 3 - query: EXPLAIN select * from T1 where (COL1 >= 10 AND COL1 <= 20) OR (COL1 >= 10 AND COL1 <= 20) ORDER BY COL1 explain: ISCAN(I1 [[GREATER_THAN_OR_EQUALS promote(@c10 AS LONG) && LESS_THAN_OR_EQUALS promote(@c15 AS LONG)]]) - task_count: 279 - task_total_time_ms: 21 - transform_count: 70 - transform_time_ms: 8 - transform_yield_count: 28 + task_count: 280 + task_total_time_ms: 14 + transform_count: 73 + transform_time_ms: 5 + transform_yield_count: 27 insert_time_ms: 0 insert_new_count: 28 insert_reused_count: 2 diff --git a/yaml-tests/src/test/resources/standard-tests.yamsql b/yaml-tests/src/test/resources/standard-tests.yamsql index 6526dc7755..eb4316d64e 100644 --- a/yaml-tests/src/test/resources/standard-tests.yamsql +++ b/yaml-tests/src/test/resources/standard-tests.yamsql @@ -94,7 +94,7 @@ test_block: ] - - query: 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" + - 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 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)" - maxRows: 0 # Force continuations mode fails here. This is because we get duplicate results when we resume from a continuation - unorderedResult: [ {ID: 1, COL1: 10, COL2: 1}, @@ -113,7 +113,7 @@ test_block: ] - - query: select * from T1 where COL1 >= 10 OR COL1 <= 20 ORDER BY COL1 - - explain: "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)" + - explain: "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) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)" - result: [ {ID: 1, COL1: 10, COL2: 1}, {ID: 2, COL1: 10, COL2: 2}, @@ -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: "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 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)" - 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 @@ -228,7 +228,7 @@ test_block: ] - - query: 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)" + - explain: "ISCAN(I1 [EQUALS promote(@c9 AS LONG)]) ∪ ISCAN(I1 [EQUALS promote(@c13 AS LONG)]) COMPARE BY (_.COL1, recordType(_), _.ID) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)" - 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/table-functions.metrics.binpb b/yaml-tests/src/test/resources/table-functions.metrics.binpb index 21f4211a37..30eb2beb58 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 4f8ca0caa1..1d77d1449f 100644 --- a/yaml-tests/src/test/resources/table-functions.metrics.yaml +++ b/yaml-tests/src/test/resources/table-functions.metrics.yaml @@ -3,14 +3,14 @@ table-functions: 'bar')) as A(B, C, W(X, Y, Z)) explain: EXPLODE array((@c6 AS B, @c8 AS C, (@c11 AS X, promote(@c13 AS DOUBLE) AS Y, @c15 AS Z) AS W), (@c20 AS B, @c22 AS C, (@c25 AS X, @c27 AS Y, @c29 - AS Z) AS W)) - task_count: 110 + AS Z) AS W)) | MAP (_.B AS B, _.C AS C, _.W AS W) + task_count: 116 task_total_time_ms: 0 - transform_count: 29 + transform_count: 27 transform_time_ms: 0 transform_yield_count: 6 insert_time_ms: 0 - insert_new_count: 8 + insert_new_count: 9 insert_reused_count: 0 - query: EXPLAIN select B, C, W from values (1, 2.0, (3, 4, 'foo')), (10, 90.2, (5, 6.0, 'bar')) as A(B, C, W(X, Y, Z)) @@ -81,25 +81,25 @@ table-functions: insert_reused_count: 1 - query: EXPLAIN select * from range(0, 11, 5) explain: TF range(promote(@c6 AS LONG), promote(@c8 AS LONG), STEP promote(@c10 - AS LONG)) - task_count: 110 + AS LONG)) | MAP (_.ID AS ID) + task_count: 116 task_total_time_ms: 0 - transform_count: 29 + transform_count: 27 transform_time_ms: 0 transform_yield_count: 6 insert_time_ms: 0 - insert_new_count: 8 + insert_new_count: 9 insert_reused_count: 0 - query: EXPLAIN select * from range(6 - 6, 14 + 6 + 1, 20 - 10) explain: TF range(promote(@c6 - @c6 AS LONG), promote(@c10 + @c6 + @c14 AS LONG), - STEP promote(@c16 - @c18 AS LONG)) - task_count: 110 - task_total_time_ms: 0 - transform_count: 29 + STEP promote(@c16 - @c18 AS LONG)) | MAP (_.ID AS ID) + task_count: 116 + task_total_time_ms: 1 + transform_count: 27 transform_time_ms: 0 transform_yield_count: 6 insert_time_ms: 0 - insert_new_count: 8 + insert_new_count: 9 insert_reused_count: 0 - 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) diff --git a/yaml-tests/src/test/resources/table-functions.yamsql b/yaml-tests/src/test/resources/table-functions.yamsql index 993f6580a9..26ed2f3650 100644 --- a/yaml-tests/src/test/resources/table-functions.yamsql +++ b/yaml-tests/src/test/resources/table-functions.yamsql @@ -39,7 +39,7 @@ test_block: - result: [{42}] - - query: select * from values (1, 2.0, (3, 4, 'foo')), (10, 90.2, (5, 6.0, 'bar')) as A(B, C, W(X, Y, Z)) - - explain: "EXPLODE array((@c6 AS B, @c8 AS C, (@c11 AS X, promote(@c13 AS DOUBLE) AS Y, @c15 AS Z) AS W), (@c20 AS B, @c22 AS C, (@c25 AS X, @c27 AS Y, @c29 AS Z) AS W))" + - explain: "EXPLODE array((@c6 AS B, @c8 AS C, (@c11 AS X, promote(@c13 AS DOUBLE) AS Y, @c15 AS Z) AS W), (@c20 AS B, @c22 AS C, (@c25 AS X, @c27 AS Y, @c29 AS Z) AS W)) | MAP (_.B AS B, _.C AS C, _.W AS W)" - result: [{B: 1, C: 2.0, W: {X: 3, Y: 4.0, Z: 'foo'}}, {B: 10, C: 90.2, W: {X: 5, Y: 6.0, Z: 'bar'}}] - @@ -94,11 +94,11 @@ test_block: - result: [{ID: 0}, {ID: 5}, {ID: 10}] - - query: select * from range(0, 11, 5) - - explain: "TF range(promote(@c6 AS LONG), promote(@c8 AS LONG), STEP promote(@c10 AS LONG))" + - explain: "TF range(promote(@c6 AS LONG), promote(@c8 AS LONG), STEP promote(@c10 AS LONG)) | MAP (_.ID AS ID)" - result: [{ID: 0}, {ID: 5}, {ID: 10}] - - query: select * from range(6 - 6, 14 + 6 + 1, 20 - 10) - - explain: "TF range(promote(@c6 - @c6 AS LONG), promote(@c10 + @c6 + @c14 AS LONG), STEP promote(@c16 - @c18 AS LONG))" + - explain: "TF range(promote(@c6 - @c6 AS LONG), promote(@c10 + @c6 + @c14 AS LONG), STEP promote(@c16 - @c18 AS LONG)) | MAP (_.ID AS ID)" - result: [{ID: 0}, {ID: 10}, {ID: 20}] - - query: select ID as X from range(3) as Y 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 56a8d810f8..a0d4d5a9c7 100644 --- a/yaml-tests/src/test/resources/union-empty-tables.metrics.binpb +++ b/yaml-tests/src/test/resources/union-empty-tables.metrics.binpb @@ -86,52 +86,58 @@ R 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=< 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; -Ãò¦­Q ±®×(0’8@1SCAN(<,>) | TFILTER T1 ⊎ SCAN(<,>) | TFILTER T1°digraph G { + unnamed-14EXPLAIN select * from t1 union all select * from t1;ú! +ûþû÷[ ÄÝ©(0µ•8%@—SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) ⊎ 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, 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, 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=< 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=< 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=< q55> label="q55" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 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=<
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)" ]; + 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=< q44> label="q44" 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=< q55> label="q55" 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=< 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=< q57> label="q57" 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;½ -ßþ¼ŸV ¼ÿà(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;ú! +ûçÓ´[ š±˜(0›—8%@—SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) ⊎ 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, 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, 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=< 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=< 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=< 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=< q56> label="q56" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} + 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=<
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)" ]; + 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=< q44> label="q44" 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=< q55> label="q55" 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=< 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=< q57> label="q57" 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;½ -ߑ̿V àÌ(0Ù•8!@dSCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) ⊎ SCAN(<,>) | TFILTER T1¹digraph G { + unnamed-1AEXPLAIN select id, col1, col2 from t1 union all select * from t1;ú! +ûò ¢[ ‹ðâ(0Ƚ8%@—SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) digraph G { fontname=courier; rankdir=BT; splines=polyline; @@ -140,20 +146,22 @@ N 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, 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)" ]; + 6 [ 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)" ]; + 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=< q43> label="q43" 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 [ color="gray20" style="solid" 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=< q56> label="q56" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}à& + 2 -> 1 [ label=< q55> label="q55" 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=< 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=< q57> label="q57" 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;þ% -¿ÌÙèq —³«(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-1PEXPLAIN select id as W, col1 as X, col2 as Y from t1 union all select * from t1;½* +ë•ÚÈ x ‰ÖØ( 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) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)´(digraph G { fontname=courier; rankdir=BT; splines=polyline; @@ -164,22 +172,24 @@ N 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, 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)" ]; + 8 [ 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)" ]; + 9 [ 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)" ]; + 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=< q50> label="q50" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q52> label="q52" 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=< q63> label="q63" 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" ]; 8 -> 7 [ label=< q12> label="q12" 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=< q65> label="q65" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}â& + 9 -> 8 [ label=< q8> label="q8" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 10 -> 9 [ label=< q37> label="q37" 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=< q67> label="q67" 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;þ% -¿†¬ˆq ú¬“(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;¼* +ë ‹x ö‹q( 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) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)´(digraph G { fontname=courier; rankdir=BT; splines=polyline; @@ -190,22 +200,24 @@ _ 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, 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)" ]; + 8 [ 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)" ]; + 9 [ 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)" ]; + 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=< q50> label="q50" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q52> label="q52" 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=< q63> label="q63" 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" ]; 8 -> 7 [ label=< q12> label="q12" 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=< q65> label="q65" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}â& + 9 -> 8 [ label=< q8> label="q8" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 10 -> 9 [ label=< q37> label="q37" 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=< q67> label="q67" 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);þ% -¿ð‡q ŠÏ´(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);¼* +ëú·—x â©w( 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) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)´(digraph G { fontname=courier; rankdir=BT; splines=polyline; @@ -216,22 +228,24 @@ _ 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, 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)" ]; + 8 [ 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)" ]; + 9 [ 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)" ]; + 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=< q50> label="q50" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q52> label="q52" 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=< q63> label="q63" 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" ]; 8 -> 7 [ label=< q12> label="q12" 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=< q65> label="q65" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}ã& + 9 -> 8 [ label=< q8> label="q8" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 10 -> 9 [ label=< q37> label="q37" 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=< q67> label="q67" 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));ý% -¿ä˽q ©ñS(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));½* +ë½Ùù x ÚÄè( 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) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)´(digraph G { fontname=courier; rankdir=BT; splines=polyline; @@ -242,22 +256,24 @@ a 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, 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)" ]; + 8 [ 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)" ]; + 9 [ 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)" ]; + 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=< q50> label="q50" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q52> label="q52" 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=< q63> label="q63" 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" ]; 8 -> 7 [ label=< q12> label="q12" 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=< q65> label="q65" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}ä& + 9 -> 8 [ label=< q8> label="q8" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 10 -> 9 [ label=< q37> label="q37" 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=< q67> label="q67" 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);þ% -¿ü­Ñq €„®(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);½* +ëóÏ÷ x Å‚ì( 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) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)´(digraph G { fontname=courier; rankdir=BT; splines=polyline; @@ -268,18 +284,20 @@ a 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, 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)" ]; + 8 [ 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)" ]; + 9 [ 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)" ]; + 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=< q50> label="q50" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q52> label="q52" 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=< q63> label="q63" 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" ]; 8 -> 7 [ label=< q12> label="q12" 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=< q65> label="q65" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 9 -> 8 [ label=< q8> label="q8" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 10 -> 9 [ label=< q37> label="q37" 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=< q67> label="q67" 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µ) 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 88dd628556..51c5e96b35 100644 --- a/yaml-tests/src/test/resources/union-empty-tables.metrics.yaml +++ b/yaml-tests/src/test/resources/union-empty-tables.metrics.yaml @@ -40,102 +40,108 @@ unnamed-1: insert_new_count: 33 insert_reused_count: 4 - query: EXPLAIN select * from t1 union all select * from t1; - explain: SCAN(<,>) | TFILTER T1 ⊎ SCAN(<,>) | TFILTER T1 - task_count: 323 - task_total_time_ms: 13 - transform_count: 81 - transform_time_ms: 3 - transform_yield_count: 25 + explain: SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) + ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) + task_count: 379 + task_total_time_ms: 12 + transform_count: 91 + transform_time_ms: 2 + transform_yield_count: 29 insert_time_ms: 0 - insert_new_count: 29 - insert_reused_count: 4 + insert_new_count: 37 + insert_reused_count: 2 - query: EXPLAIN select * from t1 union all select id, col1, col2 from t1; - explain: SCAN(<,>) | TFILTER T1 ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 - AS COL1, _.COL2 AS COL2) - task_count: 351 - task_total_time_ms: 15 - transform_count: 86 - transform_time_ms: 3 - transform_yield_count: 27 + explain: SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) + ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) + task_count: 379 + task_total_time_ms: 11 + transform_count: 91 + transform_time_ms: 2 + transform_yield_count: 29 insert_time_ms: 0 - insert_new_count: 33 - insert_reused_count: 3 + insert_new_count: 37 + insert_reused_count: 2 - query: EXPLAIN select id, col1, col2 from t1 union all select * from t1; explain: SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) - ⊎ SCAN(<,>) | TFILTER T1 - task_count: 351 - task_total_time_ms: 17 - transform_count: 86 - transform_time_ms: 6 - transform_yield_count: 27 + ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) + task_count: 379 + task_total_time_ms: 15 + transform_count: 91 + transform_time_ms: 3 + transform_yield_count: 29 insert_time_ms: 0 - insert_new_count: 33 - insert_reused_count: 3 + insert_new_count: 37 + insert_reused_count: 2 - query: EXPLAIN select id as W, col1 as X, col2 as Y from t1 union all select * from t1; explain: 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) - task_count: 447 - task_total_time_ms: 16 - transform_count: 113 - transform_time_ms: 2 - transform_yield_count: 29 + ID, _.COL1 AS COL1, _.COL2 AS COL2) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 + AS COL2) + task_count: 491 + task_total_time_ms: 20 + transform_count: 120 + transform_time_ms: 3 + transform_yield_count: 32 insert_time_ms: 0 - insert_new_count: 39 - insert_reused_count: 4 + insert_new_count: 45 + insert_reused_count: 3 - query: EXPLAIN (select id as W, col1 as X, col2 as Y from t1) union all select * from t1; explain: 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) - task_count: 447 - task_total_time_ms: 12 - transform_count: 113 - transform_time_ms: 2 - transform_yield_count: 29 + ID, _.COL1 AS COL1, _.COL2 AS COL2) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 + AS COL2) + task_count: 491 + task_total_time_ms: 6 + transform_count: 120 + transform_time_ms: 1 + transform_yield_count: 32 insert_time_ms: 0 - insert_new_count: 39 - insert_reused_count: 4 + insert_new_count: 45 + insert_reused_count: 3 - query: EXPLAIN select id as W, col1 as X, col2 as Y from t1 union all (select * from t1); explain: 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) - task_count: 447 - task_total_time_ms: 17 - transform_count: 113 - transform_time_ms: 2 - transform_yield_count: 29 + ID, _.COL1 AS COL1, _.COL2 AS COL2) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 + AS COL2) + task_count: 491 + task_total_time_ms: 8 + transform_count: 120 + transform_time_ms: 1 + transform_yield_count: 32 insert_time_ms: 0 - insert_new_count: 39 - insert_reused_count: 4 + insert_new_count: 45 + insert_reused_count: 3 - query: EXPLAIN (select id as W, col1 as X, col2 as Y from t1 union all (select * from t1)); explain: 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) - task_count: 447 - task_total_time_ms: 5 - transform_count: 113 - transform_time_ms: 1 - transform_yield_count: 29 + ID, _.COL1 AS COL1, _.COL2 AS COL2) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 + AS COL2) + task_count: 491 + task_total_time_ms: 20 + transform_count: 120 + transform_time_ms: 3 + transform_yield_count: 32 insert_time_ms: 0 - insert_new_count: 39 - insert_reused_count: 4 + insert_new_count: 45 + insert_reused_count: 3 - query: EXPLAIN ((select id as W, col1 as X, col2 as Y from t1) union all select * from t1); explain: 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) - task_count: 447 - task_total_time_ms: 16 - transform_count: 113 - transform_time_ms: 2 - transform_yield_count: 29 + ID, _.COL1 AS COL1, _.COL2 AS COL2) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 + AS COL2) + task_count: 491 + task_total_time_ms: 20 + transform_count: 120 + transform_time_ms: 3 + transform_yield_count: 32 insert_time_ms: 0 - insert_new_count: 39 - insert_reused_count: 4 + insert_new_count: 45 + insert_reused_count: 3 - query: EXPLAIN select a, b from t3 union all select a, b from t4 explain: 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 diff --git a/yaml-tests/src/test/resources/union-empty-tables.yamsql b/yaml-tests/src/test/resources/union-empty-tables.yamsql index a9eb1748ee..5778a73e9b 100644 --- a/yaml-tests/src/test/resources/union-empty-tables.yamsql +++ b/yaml-tests/src/test/resources/union-empty-tables.yamsql @@ -42,35 +42,35 @@ test_block: - unorderedResult: [] - - query: select * from t1 union all select * from t1; - - explain: "SCAN(<,>) | TFILTER T1 ⊎ SCAN(<,>) | TFILTER T1" + - explain: "SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)" - unorderedResult: [] - - query: select * from t1 union all select id, col1, col2 from t1; - - explain: "SCAN(<,>) | TFILTER T1 ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)" + - explain: "SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)" - unorderedResult: [] - - query: select id, col1, col2 from t1 union all select * from t1; - - explain: "SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) ⊎ SCAN(<,>) | TFILTER T1" + - explain: "SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) ⊎ SCAN(<,>) | TFILTER T1 | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)" - unorderedResult: [] - - query: select id as W, col1 as X, col2 as Y from t1 union all select * from t1; - - explain: "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)" + - explain: "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) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)" - unorderedResult: [] - - query: (select id as W, col1 as X, col2 as Y from t1) union all select * from t1; - - explain: "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)" + - explain: "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) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)" - unorderedResult: [] - - query: select id as W, col1 as X, col2 as Y from t1 union all (select * from t1); - - explain: "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)" + - explain: "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) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)" - unorderedResult: [] - - query: (select id as W, col1 as X, col2 as Y from t1 union all (select * from t1)); - - explain: "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)" + - explain: "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) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)" - unorderedResult: [] - - query: ((select id as W, col1 as X, col2 as Y from t1) union all select * from t1); - - explain: "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)" + - explain: "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) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)" - unorderedResult: [] - - query: select a, b from t3 union all select a, b from t4 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 130545e674..ecdb8fec4f 100644 --- a/yaml-tests/src/test/resources/update-delete-returning.metrics.binpb +++ b/yaml-tests/src/test/resources/update-delete-returning.metrics.binpb @@ -1,21 +1,21 @@ -› +œ e - unnamed-1XEXPLAIN update A set A2 = 42, A3 = 44 where A1 <= 2 returning "new".A3 OPTIONS(DRY RUN);± - º»~G ¬¥9(0Â’8@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);² +еÄÇL à‹S(0ê´8@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, 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)" ]; + 3 [ label=<
Predicate Filter
WHERE q42.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" ]; + 5 -> 3 [ label=< q42> label="q42" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q40> label="q40" 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" ]; { @@ -23,49 +23,49 @@ e rankDir=LR; 3 -> 4 [ color="red" style="invis" ]; } -}Š +}‹ T - unnamed-1GEXPLAIN update A set A2 = 42, A3 = 44 where A1 <= 2 returning "new".A3;± - º»~G ¬¥9(0Â’8@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;² +еÄÇL à‹S(0ê´8@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, 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)" ]; + 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 q42.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="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" ]; + 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=< q42> label="q42" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q40> label="q40" 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);È - ‚ßsG ã¿3(0έ8@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);É +ÐĨÀL °¢L(0ÝÔ8@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, 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)" ]; + 3 [ label=<
Predicate Filter
WHERE q42.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" ]; + 5 -> 3 [ label=< q42> label="q42" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q40> label="q40" 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,24 +73,24 @@ 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;È - ‚ßsG ã¿3(0έ8@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;É +ÐĨÀL °¢L(0ÝÔ8@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, 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)" ]; + 3 [ label=<
Predicate Filter
WHERE q42.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" ]; + 5 -> 3 [ label=< q42> label="q42" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q40> label="q40" 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" ]; { @@ -98,21 +98,21 @@ _ rankDir=LR; 3 -> 4 [ color="red" style="invis" ]; } -}Œ +}‹ H - unnamed-1;EXPLAIN update A set A2 = 52 where A1 > 2 OPTIONS(DRY RUN);¿ -á¢ôâ7 ÒŸª(0®¨8@VSCAN(<,>) | DISTINCT BY PK | FILTER _.A1 GREATER_THAN promote(@c10 AS LONG) | UPDATE AÉdigraph G { + unnamed-1;EXPLAIN update A set A2 = 52 where A1 > 2 OPTIONS(DRY RUN);¾ +”õ¬= ©ìG(0Ó 8@VSCAN(<,>) | DISTINCT BY PK | FILTER _.A1 GREATER_THAN promote(@c10 AS LONG) | UPDATE AÉdigraph 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, 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)" ]; + 2 [ label=<
Predicate Filter
WHERE q39.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" ]; + 3 -> 2 [ label=< q39> label="q39" 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 [ 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 ÒŸª(0®¨8@VSCAN(<,>) | DISTINCT BY PK | FILTER _.A1 GREATER_THAN promote(@c10 AS LONG) | UPDATE AÉdigraph G { + unnamed-1*EXPLAIN update A set A2 = 52 where A1 > 2;¾ +”õ¬= ©ìG(0Ó 8@VSCAN(<,>) | DISTINCT BY PK | FILTER _.A1 GREATER_THAN promote(@c10 AS LONG) | UPDATE AÉdigraph 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, 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)" ]; + 2 [ label=<
Predicate Filter
WHERE q39.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" ]; + 3 -> 2 [ label=< q39> label="q39" 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 [ 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 510d953bb4..e53f48a55e 100644 --- a/yaml-tests/src/test/resources/update-delete-returning.metrics.yaml +++ b/yaml-tests/src/test/resources/update-delete-returning.metrics.yaml @@ -3,68 +3,68 @@ unnamed-1: OPTIONS(DRY RUN); explain: SCAN(<,>) | DISTINCT BY PK | FILTER _.A1 LESS_THAN_OR_EQUALS promote(@c15 AS LONG) | UPDATE A | MAP (_.new.A3 AS A3) - task_count: 288 - task_total_time_ms: 2 - transform_count: 71 - transform_time_ms: 0 - transform_yield_count: 19 + task_count: 336 + task_total_time_ms: 3 + transform_count: 76 + transform_time_ms: 1 + transform_yield_count: 21 insert_time_ms: 0 - insert_new_count: 25 - insert_reused_count: 2 + insert_new_count: 31 + insert_reused_count: 1 - query: EXPLAIN update A set A2 = 42, A3 = 44 where A1 <= 2 returning "new".A3; explain: SCAN(<,>) | DISTINCT BY PK | FILTER _.A1 LESS_THAN_OR_EQUALS promote(@c15 AS LONG) | UPDATE A | MAP (_.new.A3 AS A3) - task_count: 288 - task_total_time_ms: 2 - transform_count: 71 - transform_time_ms: 0 - transform_yield_count: 19 + task_count: 336 + task_total_time_ms: 3 + transform_count: 76 + transform_time_ms: 1 + transform_yield_count: 21 insert_time_ms: 0 - insert_new_count: 25 - insert_reused_count: 2 + insert_new_count: 31 + insert_reused_count: 1 - query: EXPLAIN update A set A2 = 42, A3 = 44 where A1 <= 2 returning "new".A3 + "new".A3 OPTIONS(DRY RUN); 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: 1 - transform_count: 71 - transform_time_ms: 0 - transform_yield_count: 19 + task_count: 336 + task_total_time_ms: 3 + transform_count: 76 + transform_time_ms: 1 + transform_yield_count: 21 insert_time_ms: 0 - insert_new_count: 25 - insert_reused_count: 2 + insert_new_count: 31 + insert_reused_count: 1 - query: EXPLAIN update A set A2 = 42, A3 = 44 where A1 <= 2 returning "new".A3 + "new".A3; 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: 1 - transform_count: 71 - transform_time_ms: 0 - transform_yield_count: 19 + task_count: 336 + task_total_time_ms: 3 + transform_count: 76 + transform_time_ms: 1 + transform_yield_count: 21 insert_time_ms: 0 - insert_new_count: 25 - insert_reused_count: 2 + insert_new_count: 31 + insert_reused_count: 1 - query: EXPLAIN update A set A2 = 52 where A1 > 2 OPTIONS(DRY RUN); explain: SCAN(<,>) | DISTINCT BY PK | FILTER _.A1 GREATER_THAN promote(@c10 AS LONG) | UPDATE A - task_count: 225 - task_total_time_ms: 3 - transform_count: 55 - transform_time_ms: 2 - transform_yield_count: 17 + task_count: 276 + task_total_time_ms: 2 + transform_count: 61 + transform_time_ms: 1 + transform_yield_count: 20 insert_time_ms: 0 - insert_new_count: 21 - insert_reused_count: 2 + insert_new_count: 27 + insert_reused_count: 1 - query: EXPLAIN update A set A2 = 52 where A1 > 2; explain: SCAN(<,>) | DISTINCT BY PK | FILTER _.A1 GREATER_THAN promote(@c10 AS LONG) | UPDATE A - task_count: 225 - task_total_time_ms: 3 - transform_count: 55 - transform_time_ms: 2 - transform_yield_count: 17 + task_count: 276 + task_total_time_ms: 2 + transform_count: 61 + transform_time_ms: 1 + transform_yield_count: 20 insert_time_ms: 0 - insert_new_count: 21 - insert_reused_count: 2 + insert_new_count: 27 + insert_reused_count: 1 diff --git a/yaml-tests/src/test/resources/uuid.metrics.binpb b/yaml-tests/src/test/resources/uuid.metrics.binpb index 0277e16a8f..a9471f46a8 100644 --- a/yaml-tests/src/test/resources/uuid.metrics.binpb +++ b/yaml-tests/src/test/resources/uuid.metrics.binpb @@ -1,372 +1,423 @@ -î - +ç 1 -uuid-as-a-field-testsEXPLAIN select * from ta¸ - -Ÿ˜ãÁ) œ§Q( 0¡ù8 @SCAN(<,>) | TFILTER TAƒ -digraph G { - fontname=courier; - rankdir=BT; - splines=polyline; - 1 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 2 [ label=<
Scan
range: <-∞, ∞>
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 [ label=<
Primary Storage
record types: [TD, TE, TA, TB, TC]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}½ -b -uuid-as-a-field-testsIEXPLAIN select * from ta where b > '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'Ö -»ºÚ´0 úÏ(0üŒ -8@ESCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN promote(@c8 AS UUID)ò digraph G { +uuid-as-a-field-testsEXPLAIN select * from ta± +»Ƽ. èŸ^(0‡è8@1SCAN(<,>) | TFILTER TA | MAP (_.A AS A, _.B AS B)á digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.B GREATER_THAN promote(@c8 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 1 [ 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(LONG AS A, UUID AS B)" ]; 2 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; 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: [TD, TE, TA, TB, TC]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q19> label="q19" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}™ +}º +b +uuid-as-a-field-testsIEXPLAIN select * from ta where b > '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'Ó +Úèö4 Ïþx(0Ë•8@`SCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN promote(@c8 AS UUID) | MAP (_.A AS A, _.B AS B)Ôdigraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Value Computation
MAP (q26.A AS A, q26.B AS B)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.B GREATER_THAN promote(@c8 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 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: [TD, TE, TA, TB, TC]
> 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=< q19> label="q19" 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=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}• = -uuid-as-a-field-tests$EXPLAIN select * from ta where b > ?× -Ë®²„5 £ˆ©(0­Ì8@ESCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN promote(@c8 AS UUID)ò digraph G { +uuid-as-a-field-tests$EXPLAIN select * from ta where b > ?Ó +ê½³Ú9 éŸg(0‚£ 8@`SCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN promote(@c8 AS UUID) | MAP (_.A AS A, _.B AS B)Ôdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.B GREATER_THAN promote(@c8 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 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: [TD, TE, TA, TB, TC]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q20> label="q20" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}¶ + 1 [ label=<
Value Computation
MAP (q27.A AS A, q27.B AS B)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.B GREATER_THAN promote(@c8 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 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: [TD, TE, TA, TB, TC]
> 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=< q20> label="q20" 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=< q27> label="q27" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}´ b -uuid-as-a-field-testsIEXPLAIN select * from ta where b < '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'Ï -»Ðða0 èÃ1(0ú®8@BSCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN promote(@c8 AS UUID)ï digraph G { +uuid-as-a-field-testsIEXPLAIN select * from ta where b < '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'Í +Ú¶ôò4 ¾øx(0ú¼8@]SCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN promote(@c8 AS UUID) | MAP (_.A AS A, _.B AS B)Ñdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.B LESS_THAN promote(@c8 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 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: [TD, TE, TA, TB, TC]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q19> label="q19" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}‘ + 1 [ label=<
Value Computation
MAP (q26.A AS A, q26.B AS B)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.B LESS_THAN promote(@c8 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 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: [TD, TE, TA, TB, TC]
> 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=< q19> label="q19" 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=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +} = -uuid-as-a-field-tests$EXPLAIN select * from ta where b < ?Ï -Ëÿ¢z5 ìä=(0þ 8@BSCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN promote(@c8 AS UUID)ï digraph G { +uuid-as-a-field-tests$EXPLAIN select * from ta where b < ?Í +ꯨ¢9 „Ç|(0¦° 8@]SCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN promote(@c8 AS UUID) | MAP (_.A AS A, _.B AS B)Ñdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.B LESS_THAN promote(@c8 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 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: [TD, TE, TA, TB, TC]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q20> label="q20" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}Ò + 1 [ label=<
Value Computation
MAP (q27.A AS A, q27.B AS B)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.B LESS_THAN promote(@c8 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 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: [TD, TE, TA, TB, TC]
> 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=< q20> label="q20" 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=< q27> label="q27" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}Ï c -uuid-as-a-field-testsJEXPLAIN select * from ta where b >= '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'ê -»±Æ­0 ÷úz(0Àå -8@OSCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN_OR_EQUALS promote(@c9 AS UUID)ü digraph G { +uuid-as-a-field-testsJEXPLAIN select * from ta where b >= '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'ç +ÚÞß4 ¢ƒ}(0¥ 8@jSCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN_OR_EQUALS promote(@c9 AS UUID) | MAP (_.A AS A, _.B AS B)Þdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.B GREATER_THAN_OR_EQUALS promote(@c9 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 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: [TD, TE, TA, TB, TC]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q19> label="q19" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}­ + 1 [ label=<
Value Computation
MAP (q26.A AS A, q26.B AS B)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.B GREATER_THAN_OR_EQUALS promote(@c9 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 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: [TD, TE, TA, TB, TC]
> 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=< q19> label="q19" 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=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}ª > -uuid-as-a-field-tests%EXPLAIN select * from ta where b >= ?ê -Ëô¢ä5 Âh(0ù¹8@OSCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN_OR_EQUALS promote(@c9 AS UUID)ü digraph G { +uuid-as-a-field-tests%EXPLAIN select * from ta where b >= ?ç +ê±ÜÓ9 ®ÎP(0Áå +8@jSCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN_OR_EQUALS promote(@c9 AS UUID) | MAP (_.A AS A, _.B AS B)Þdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.B GREATER_THAN_OR_EQUALS promote(@c9 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 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: [TD, TE, TA, TB, TC]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q20> label="q20" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}Ì + 1 [ label=<
Value Computation
MAP (q27.A AS A, q27.B AS B)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.B GREATER_THAN_OR_EQUALS promote(@c9 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 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: [TD, TE, TA, TB, TC]
> 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=< q20> label="q20" 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=< q27> label="q27" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}Ê c -uuid-as-a-field-testsJEXPLAIN select * from ta where b <= '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'ä -»¢á°0 Š‹}(0÷¬ 8@LSCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN_OR_EQUALS promote(@c9 AS UUID)ù digraph G { +uuid-as-a-field-testsJEXPLAIN select * from ta where b <= '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'â +Úþ™š4 ùð‚(0ÙÄ 8@gSCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN_OR_EQUALS promote(@c9 AS UUID) | MAP (_.A AS A, _.B AS B)Ûdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.B LESS_THAN_OR_EQUALS promote(@c9 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 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: [TD, TE, TA, TB, TC]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q19> label="q19" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}§ + 1 [ label=<
Value Computation
MAP (q26.A AS A, q26.B AS B)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.B LESS_THAN_OR_EQUALS promote(@c9 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 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: [TD, TE, TA, TB, TC]
> 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=< q19> label="q19" 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=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}¤ > -uuid-as-a-field-tests%EXPLAIN select * from ta where b <= ?ä -ËŸüÀ5 οm(0Œó 8@LSCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN_OR_EQUALS promote(@c9 AS UUID)ù digraph G { +uuid-as-a-field-tests%EXPLAIN select * from ta where b <= ?á +ê²›„9 ü«s(0÷÷ 8@gSCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN_OR_EQUALS promote(@c9 AS UUID) | MAP (_.A AS A, _.B AS B)Ûdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.B LESS_THAN_OR_EQUALS promote(@c9 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 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: [TD, TE, TA, TB, TC]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q20> label="q20" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}± + 1 [ label=<
Value Computation
MAP (q27.A AS A, q27.B AS B)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.B LESS_THAN_OR_EQUALS promote(@c9 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 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: [TD, TE, TA, TB, TC]
> 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=< q20> label="q20" 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=< q27> label="q27" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}¯ b -uuid-as-a-field-testsIEXPLAIN select * from ta where b = '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'Ê -»œæŸ0 â³f(0Š™ 8@?SCAN(<,>) | TFILTER TA | FILTER _.B EQUALS promote(@c8 AS UUID)ì digraph G { +uuid-as-a-field-testsIEXPLAIN select * from ta where b = '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'È +Ú•¡Ý4 ©Ú›(0ÕÞ +8@ZSCAN(<,>) | TFILTER TA | FILTER _.B EQUALS promote(@c8 AS UUID) | MAP (_.A AS A, _.B AS B)Îdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.B EQUALS promote(@c8 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 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: [TD, TE, TA, TB, TC]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q19> label="q19" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}Œ + 1 [ label=<
Value Computation
MAP (q26.A AS A, q26.B AS B)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.B EQUALS promote(@c8 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 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: [TD, TE, TA, TB, TC]
> 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=< q19> label="q19" 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=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}‰ = -uuid-as-a-field-tests$EXPLAIN select * from ta where b = ?Ê -˰â5 ¬˜z(0‡Ð8@?SCAN(<,>) | TFILTER TA | FILTER _.B EQUALS promote(@c8 AS UUID)ì digraph G { +uuid-as-a-field-tests$EXPLAIN select * from ta where b = ?Ç +긖Î9 „Òa(0ßá8@ZSCAN(<,>) | TFILTER TA | FILTER _.B EQUALS promote(@c8 AS UUID) | MAP (_.A AS A, _.B AS B)Îdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.B EQUALS promote(@c8 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 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: [TD, TE, TA, TB, TC]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q20> label="q20" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}º + 1 [ label=<
Value Computation
MAP (q27.A AS A, q27.B AS B)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.B EQUALS promote(@c8 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 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: [TD, TE, TA, TB, TC]
> 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=< q20> label="q20" 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=< q27> label="q27" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}¸ c -uuid-as-a-field-testsJEXPLAIN select * from ta where b != '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'Ò -»¸õÒ0 ã©n(0¯› 8@CSCAN(<,>) | TFILTER TA | FILTER _.B NOT_EQUALS promote(@c9 AS UUID)ð digraph G { +uuid-as-a-field-testsJEXPLAIN select * from ta where b != '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'Ð +Ú¤þ£4 ¨‰ƒ(0¡‚ +8@^SCAN(<,>) | TFILTER TA | FILTER _.B NOT_EQUALS promote(@c9 AS UUID) | MAP (_.A AS A, _.B AS B)Òdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.B NOT_EQUALS promote(@c9 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 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: [TD, TE, TA, TB, TC]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q19> label="q19" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}• + 1 [ label=<
Value Computation
MAP (q26.A AS A, q26.B AS B)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.B NOT_EQUALS promote(@c9 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 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: [TD, TE, TA, TB, TC]
> 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=< q19> label="q19" 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=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}’ > -uuid-as-a-field-tests%EXPLAIN select * from ta where b != ?Ò -˱§»5 íÔ^(0µ¨ 8@CSCAN(<,>) | TFILTER TA | FILTER _.B NOT_EQUALS promote(@c9 AS UUID)ð digraph G { +uuid-as-a-field-tests%EXPLAIN select * from ta where b != ?Ï +Ꞧ9 É­O(0Ï 8@^SCAN(<,>) | TFILTER TA | FILTER _.B NOT_EQUALS promote(@c9 AS UUID) | MAP (_.A AS A, _.B AS B)Òdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.B NOT_EQUALS promote(@c9 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 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: [TD, TE, TA, TB, TC]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q20> label="q20" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}è + 1 [ label=<
Value Computation
MAP (q27.A AS A, q27.B AS B)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.B NOT_EQUALS promote(@c9 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 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: [TD, TE, TA, TB, TC]
> 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=< q20> label="q20" 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=< q27> label="q27" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}å A -uuid-as-a-field-tests(EXPLAIN select * from ta where b is null¢ -»‰¯³0 ¡ê:(0 ˜8@+SCAN(<,>) | TFILTER TA | FILTER _.B IS_NULLØ digraph G { +uuid-as-a-field-tests(EXPLAIN select * from ta where b is nullŸ +Ú¡ª•4 ·{(0ÐÇ 8@FSCAN(<,>) | TFILTER TA | FILTER _.B IS_NULL | MAP (_.A AS A, _.B AS B)ºdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.B IS_NULL
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 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: [TD, TE, TA, TB, TC]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q19> label="q19" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}Ö + 1 [ label=<
Value Computation
MAP (q26.A AS A, q26.B AS B)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.B IS_NULL
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 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: [TD, TE, TA, TB, TC]
> 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=< q19> label="q19" 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=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}Ó { -.uuid-as-a-field-tests_uuid_parameter_as_stringIEXPLAIN select * from ta where b > '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'Ö -»ºÚ´0 úÏ(0üŒ -8@ESCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN promote(@c8 AS UUID)ò digraph G { +.uuid-as-a-field-tests_uuid_parameter_as_stringIEXPLAIN select * from ta where b > '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'Ó +Úèö4 Ïþx(0Ë•8@`SCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN promote(@c8 AS UUID) | MAP (_.A AS A, _.B AS B)Ôdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.B GREATER_THAN promote(@c8 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 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: [TD, TE, TA, TB, TC]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q19> label="q19" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}² + 1 [ label=<
Value Computation
MAP (q26.A AS A, q26.B AS B)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.B GREATER_THAN promote(@c8 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 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: [TD, TE, TA, TB, TC]
> 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=< q19> label="q19" 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=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}® V -.uuid-as-a-field-tests_uuid_parameter_as_string$EXPLAIN select * from ta where b > ?× -Ë®²„5 £ˆ©(0­Ì8@ESCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN promote(@c8 AS UUID)ò digraph G { +.uuid-as-a-field-tests_uuid_parameter_as_string$EXPLAIN select * from ta where b > ?Ó +ê½³Ú9 éŸg(0‚£ 8@`SCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN promote(@c8 AS UUID) | MAP (_.A AS A, _.B AS B)Ôdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.B GREATER_THAN promote(@c8 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 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: [TD, TE, TA, TB, TC]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q20> label="q20" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}Ï + 1 [ label=<
Value Computation
MAP (q27.A AS A, q27.B AS B)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.B GREATER_THAN promote(@c8 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 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: [TD, TE, TA, TB, TC]
> 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=< q20> label="q20" 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=< q27> label="q27" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}Í { -.uuid-as-a-field-tests_uuid_parameter_as_stringIEXPLAIN select * from ta where b < '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'Ï -»Ðða0 èÃ1(0ú®8@BSCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN promote(@c8 AS UUID)ï digraph G { +.uuid-as-a-field-tests_uuid_parameter_as_stringIEXPLAIN select * from ta where b < '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'Í +Ú¶ôò4 ¾øx(0ú¼8@]SCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN promote(@c8 AS UUID) | MAP (_.A AS A, _.B AS B)Ñdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.B LESS_THAN promote(@c8 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 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: [TD, TE, TA, TB, TC]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q19> label="q19" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}ª + 1 [ label=<
Value Computation
MAP (q26.A AS A, q26.B AS B)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.B LESS_THAN promote(@c8 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 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: [TD, TE, TA, TB, TC]
> 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=< q19> label="q19" 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=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}¨ V -.uuid-as-a-field-tests_uuid_parameter_as_string$EXPLAIN select * from ta where b < ?Ï -Ëÿ¢z5 ìä=(0þ 8@BSCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN promote(@c8 AS UUID)ï digraph G { +.uuid-as-a-field-tests_uuid_parameter_as_string$EXPLAIN select * from ta where b < ?Í +ꯨ¢9 „Ç|(0¦° 8@]SCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN promote(@c8 AS UUID) | MAP (_.A AS A, _.B AS B)Ñdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.B LESS_THAN promote(@c8 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 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: [TD, TE, TA, TB, TC]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q20> label="q20" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}ë + 1 [ label=<
Value Computation
MAP (q27.A AS A, q27.B AS B)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.B LESS_THAN promote(@c8 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 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: [TD, TE, TA, TB, TC]
> 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=< q20> label="q20" 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=< q27> label="q27" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}è | -.uuid-as-a-field-tests_uuid_parameter_as_stringJEXPLAIN select * from ta where b >= '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'ê -»±Æ­0 ÷úz(0Àå -8@OSCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN_OR_EQUALS promote(@c9 AS UUID)ü digraph G { +.uuid-as-a-field-tests_uuid_parameter_as_stringJEXPLAIN select * from ta where b >= '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'ç +ÚÞß4 ¢ƒ}(0¥ 8@jSCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN_OR_EQUALS promote(@c9 AS UUID) | MAP (_.A AS A, _.B AS B)Þdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.B GREATER_THAN_OR_EQUALS promote(@c9 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 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: [TD, TE, TA, TB, TC]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q19> label="q19" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}Æ + 1 [ label=<
Value Computation
MAP (q26.A AS A, q26.B AS B)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.B GREATER_THAN_OR_EQUALS promote(@c9 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 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: [TD, TE, TA, TB, TC]
> 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=< q19> label="q19" 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=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}à W -.uuid-as-a-field-tests_uuid_parameter_as_string%EXPLAIN select * from ta where b >= ?ê -Ëô¢ä5 Âh(0ù¹8@OSCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN_OR_EQUALS promote(@c9 AS UUID)ü digraph G { +.uuid-as-a-field-tests_uuid_parameter_as_string%EXPLAIN select * from ta where b >= ?ç +ê±ÜÓ9 ®ÎP(0Áå +8@jSCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN_OR_EQUALS promote(@c9 AS UUID) | MAP (_.A AS A, _.B AS B)Þdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.B GREATER_THAN_OR_EQUALS promote(@c9 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 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: [TD, TE, TA, TB, TC]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q20> label="q20" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}å + 1 [ label=<
Value Computation
MAP (q27.A AS A, q27.B AS B)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.B GREATER_THAN_OR_EQUALS promote(@c9 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 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: [TD, TE, TA, TB, TC]
> 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=< q20> label="q20" 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=< q27> label="q27" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}ã | -.uuid-as-a-field-tests_uuid_parameter_as_stringJEXPLAIN select * from ta where b <= '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'ä -»¢á°0 Š‹}(0÷¬ 8@LSCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN_OR_EQUALS promote(@c9 AS UUID)ù digraph G { +.uuid-as-a-field-tests_uuid_parameter_as_stringJEXPLAIN select * from ta where b <= '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'â +Úþ™š4 ùð‚(0ÙÄ 8@gSCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN_OR_EQUALS promote(@c9 AS UUID) | MAP (_.A AS A, _.B AS B)Ûdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.B LESS_THAN_OR_EQUALS promote(@c9 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 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: [TD, TE, TA, TB, TC]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q19> label="q19" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}À + 1 [ label=<
Value Computation
MAP (q26.A AS A, q26.B AS B)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.B LESS_THAN_OR_EQUALS promote(@c9 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 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: [TD, TE, TA, TB, TC]
> 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=< q19> label="q19" 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=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}½ W -.uuid-as-a-field-tests_uuid_parameter_as_string%EXPLAIN select * from ta where b <= ?ä -ËŸüÀ5 οm(0Œó 8@LSCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN_OR_EQUALS promote(@c9 AS UUID)ù digraph G { +.uuid-as-a-field-tests_uuid_parameter_as_string%EXPLAIN select * from ta where b <= ?á +ê²›„9 ü«s(0÷÷ 8@gSCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN_OR_EQUALS promote(@c9 AS UUID) | MAP (_.A AS A, _.B AS B)Ûdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.B LESS_THAN_OR_EQUALS promote(@c9 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 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: [TD, TE, TA, TB, TC]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q20> label="q20" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}Ê + 1 [ label=<
Value Computation
MAP (q27.A AS A, q27.B AS B)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.B LESS_THAN_OR_EQUALS promote(@c9 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 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: [TD, TE, TA, TB, TC]
> 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=< q20> label="q20" 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=< q27> label="q27" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}È { -.uuid-as-a-field-tests_uuid_parameter_as_stringIEXPLAIN select * from ta where b = '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'Ê -»œæŸ0 â³f(0Š™ 8@?SCAN(<,>) | TFILTER TA | FILTER _.B EQUALS promote(@c8 AS UUID)ì digraph G { +.uuid-as-a-field-tests_uuid_parameter_as_stringIEXPLAIN select * from ta where b = '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'È +Ú•¡Ý4 ©Ú›(0ÕÞ +8@ZSCAN(<,>) | TFILTER TA | FILTER _.B EQUALS promote(@c8 AS UUID) | MAP (_.A AS A, _.B AS B)Îdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.B EQUALS promote(@c8 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 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: [TD, TE, TA, TB, TC]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q19> label="q19" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}¥ + 1 [ label=<
Value Computation
MAP (q26.A AS A, q26.B AS B)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.B EQUALS promote(@c8 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 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: [TD, TE, TA, TB, TC]
> 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=< q19> label="q19" 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=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}¢ V -.uuid-as-a-field-tests_uuid_parameter_as_string$EXPLAIN select * from ta where b = ?Ê -˰â5 ¬˜z(0‡Ð8@?SCAN(<,>) | TFILTER TA | FILTER _.B EQUALS promote(@c8 AS UUID)ì digraph G { +.uuid-as-a-field-tests_uuid_parameter_as_string$EXPLAIN select * from ta where b = ?Ç +긖Î9 „Òa(0ßá8@ZSCAN(<,>) | TFILTER TA | FILTER _.B EQUALS promote(@c8 AS UUID) | MAP (_.A AS A, _.B AS B)Îdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.B EQUALS promote(@c8 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 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: [TD, TE, TA, TB, TC]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q20> label="q20" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}Ó + 1 [ label=<
Value Computation
MAP (q27.A AS A, q27.B AS B)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.B EQUALS promote(@c8 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 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: [TD, TE, TA, TB, TC]
> 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=< q20> label="q20" 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=< q27> label="q27" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}Ñ | -.uuid-as-a-field-tests_uuid_parameter_as_stringJEXPLAIN select * from ta where b != '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'Ò -»¸õÒ0 ã©n(0¯› 8@CSCAN(<,>) | TFILTER TA | FILTER _.B NOT_EQUALS promote(@c9 AS UUID)ð digraph G { +.uuid-as-a-field-tests_uuid_parameter_as_stringJEXPLAIN select * from ta where b != '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'Ð +Ú¤þ£4 ¨‰ƒ(0¡‚ +8@^SCAN(<,>) | TFILTER TA | FILTER _.B NOT_EQUALS promote(@c9 AS UUID) | MAP (_.A AS A, _.B AS B)Òdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.B NOT_EQUALS promote(@c9 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 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: [TD, TE, TA, TB, TC]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q19> label="q19" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}® + 1 [ label=<
Value Computation
MAP (q26.A AS A, q26.B AS B)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.B NOT_EQUALS promote(@c9 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 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: [TD, TE, TA, TB, TC]
> 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=< q19> label="q19" 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=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}« W -.uuid-as-a-field-tests_uuid_parameter_as_string%EXPLAIN select * from ta where b != ?Ò -˱§»5 íÔ^(0µ¨ 8@CSCAN(<,>) | TFILTER TA | FILTER _.B NOT_EQUALS promote(@c9 AS UUID)ð digraph G { +.uuid-as-a-field-tests_uuid_parameter_as_string%EXPLAIN select * from ta where b != ?Ï +Ꞧ9 É­O(0Ï 8@^SCAN(<,>) | TFILTER TA | FILTER _.B NOT_EQUALS promote(@c9 AS UUID) | MAP (_.A AS A, _.B AS B)Òdigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.B NOT_EQUALS promote(@c9 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 2 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; - 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: [TD, TE, TA, TB, TC]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q20> label="q20" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 1 [ label=<
Value Computation
MAP (q27.A AS A, q27.B AS B)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.B NOT_EQUALS promote(@c9 AS UUID)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 3 [ label=<
Type Filter
WHERE record IS [TA]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B)" ]; + 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: [TD, TE, TA, TB, TC]
> 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=< q20> label="q20" 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=< q27> label="q27" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; }ê 4 uuid-as-a-primary-keyEXPLAIN select B, A from TB± @@ -603,21 +654,23 @@ digraph G { 3 [ label=<
Index
TC1
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B, LONG AS C)" ]; 3 -> 2 [ 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" ]; -}° +} ? -uuid-in-index-definition#EXPLAIN select * from tc order by bì -•ïÓµJ «Ö¾("0Úú8@ISCAN(TC1 <,>)¾digraph G { +uuid-in-index-definition#EXPLAIN select * from tc order by b½ +…®€¨^ Öø±(*0ŒÍ8'@]COVERING(TC1 <,> -> [A: KEY[2], B: KEY[0], C: VALUE[0]]) | MAP (_.A AS A, _.B AS B, _.C AS C)À +digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Index Scan
range: <-∞, ∞>
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B, LONG AS C)" ]; - 2 [ label=<
Index
TC1
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B, LONG AS C)" ]; - 2 -> 1 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 1 [ label=<
Value Computation
MAP (q47.A AS A, q47.B AS B, q47.C AS C)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B, 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, UUID AS B, LONG AS C)" ]; + 3 [ label=<
Index
TC1
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B, LONG AS C)" ]; + 3 -> 2 [ 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" ]; } p uuid-in-index-definitionTEXPLAIN select * from tc where b > 'a8708750-d70f-4800-8c3b-13700d5b369f' order by b¨ -›¬¯  -_ ¿ãô(*0°ý 8)@0ISCAN(TC1 [[GREATER_THAN promote(@c8 AS UUID)]])Ødigraph G { +Ûðµâ k Ê·Õ(,0ð€+81@0ISCAN(TC1 [[GREATER_THAN promote(@c8 AS UUID)]])Ødigraph G { fontname=courier; rankdir=BT; splines=polyline; @@ -627,7 +680,7 @@ p }Ö u uuid-in-index-definitionYEXPLAIN select * from tc where b < 'a8708750-d70f-4800-8c3b-13700d5b369f' order by b descÜ -›’©û _ íò°(*0ž•8)@5ISCAN(TC1 [[LESS_THAN promote(@c8 AS UUID)]] REVERSE)‡digraph G { +ÛåÏâ k ÷í¹(,0ÇÖ*81@5ISCAN(TC1 [[LESS_THAN promote(@c8 AS UUID)]] REVERSE)‡digraph G { fontname=courier; rankdir=BT; splines=polyline; @@ -637,16 +690,15 @@ u }ù  uuid-in-index-definitioncEXPLAIN select * from tc where b < 'a8708750-d70f-4800-8c3b-13700d5b369f' and c > 4 order by b descõ -ƒæàó -m «ˆí(.0’ú-87@—COVERING(TC1 [[LESS_THAN promote(@c8 AS UUID)]] REVERSE -> [A: KEY[2], B: KEY[0], C: VALUE[0]]) | FILTER _.C GREATER_THAN promote(@c12 AS LONG) | FETCH½digraph G { +æã y ”Ý(00¶ó08?@—COVERING(TC1 [[LESS_THAN promote(@c8 AS UUID)]] REVERSE -> [A: KEY[2], B: KEY[0], C: VALUE[0]]) | FILTER _.C GREATER_THAN promote(@c12 AS LONG) | FETCH½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 A, UUID AS B, LONG AS C)" ]; - 2 [ label=<
Predicate Filter
WHERE q66.C GREATER_THAN promote(@c12 AS LONG)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B, LONG AS C)" ]; + 2 [ label=<
Predicate Filter
WHERE q74.C GREATER_THAN promote(@c12 AS LONG)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B, LONG AS C)" ]; 3 [ label=<
Covering Index Scan
comparisons: [[LESS_THAN promote(@c8 AS UUID)]]
direction: reversed
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B, LONG AS C)" ]; 4 [ label=<
Index
TC1
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS A, UUID AS B, LONG AS C)" ]; - 3 -> 2 [ label=< q66> label="q66" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 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=< q68> label="q68" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q76> label="q76" 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/uuid.metrics.yaml b/yaml-tests/src/test/resources/uuid.metrics.yaml index fbdb17c77c..c56c2625b1 100644 --- a/yaml-tests/src/test/resources/uuid.metrics.yaml +++ b/yaml-tests/src/test/resources/uuid.metrics.yaml @@ -1,273 +1,289 @@ uuid-as-a-field-tests: - query: EXPLAIN select * from ta - explain: SCAN(<,>) | TFILTER TA - task_count: 159 - task_total_time_ms: 5 - transform_count: 41 + explain: SCAN(<,>) | TFILTER TA | MAP (_.A AS A, _.B AS B) + task_count: 187 + task_total_time_ms: 7 + transform_count: 46 transform_time_ms: 1 - transform_yield_count: 13 + transform_yield_count: 15 insert_time_ms: 0 - insert_new_count: 13 - insert_reused_count: 2 + insert_new_count: 16 + insert_reused_count: 1 - query: EXPLAIN select * from ta where b > '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6' explain: SCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN promote(@c8 AS UUID) - task_count: 187 - task_total_time_ms: 7 - transform_count: 48 - transform_time_ms: 2 - transform_yield_count: 14 + | MAP (_.A AS A, _.B AS B) + task_count: 218 + task_total_time_ms: 8 + transform_count: 52 + transform_time_ms: 1 + transform_yield_count: 16 insert_time_ms: 0 - insert_new_count: 17 - insert_reused_count: 2 + insert_new_count: 20 + insert_reused_count: 1 - query: EXPLAIN select * from ta where b > ? explain: SCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN promote(@c8 AS UUID) - task_count: 203 - task_total_time_ms: 8 - transform_count: 53 - transform_time_ms: 2 - transform_yield_count: 16 + | MAP (_.A AS A, _.B AS B) + task_count: 234 + task_total_time_ms: 5 + transform_count: 57 + transform_time_ms: 1 + transform_yield_count: 18 insert_time_ms: 0 - insert_new_count: 21 - insert_reused_count: 2 + insert_new_count: 24 + insert_reused_count: 1 - query: EXPLAIN select * from ta where b < '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6' - explain: SCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN promote(@c8 AS UUID) - task_count: 187 - task_total_time_ms: 1 - transform_count: 48 - transform_time_ms: 0 - transform_yield_count: 14 - insert_time_ms: 0 - insert_new_count: 17 - insert_reused_count: 2 -- query: EXPLAIN select * from ta where b < ? - explain: SCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN promote(@c8 AS UUID) - task_count: 203 - task_total_time_ms: 2 - transform_count: 53 + explain: SCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN promote(@c8 AS UUID) | + MAP (_.A AS A, _.B AS B) + task_count: 218 + task_total_time_ms: 8 + transform_count: 52 transform_time_ms: 1 transform_yield_count: 16 insert_time_ms: 0 - insert_new_count: 21 - insert_reused_count: 2 + insert_new_count: 20 + insert_reused_count: 1 +- query: EXPLAIN select * from ta where b < ? + explain: SCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN promote(@c8 AS UUID) | + MAP (_.A AS A, _.B AS B) + task_count: 234 + task_total_time_ms: 6 + transform_count: 57 + transform_time_ms: 2 + transform_yield_count: 18 + insert_time_ms: 0 + insert_new_count: 24 + insert_reused_count: 1 - query: EXPLAIN select * from ta where b >= '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6' explain: SCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN_OR_EQUALS promote(@c9 - AS UUID) - task_count: 187 - task_total_time_ms: 7 - transform_count: 48 + AS UUID) | MAP (_.A AS A, _.B AS B) + task_count: 218 + task_total_time_ms: 8 + transform_count: 52 transform_time_ms: 2 - transform_yield_count: 14 + transform_yield_count: 16 insert_time_ms: 0 - insert_new_count: 17 - insert_reused_count: 2 + insert_new_count: 20 + insert_reused_count: 1 - query: EXPLAIN select * from ta where b >= ? explain: SCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN_OR_EQUALS promote(@c9 - AS UUID) - task_count: 203 - task_total_time_ms: 5 - transform_count: 53 + AS UUID) | MAP (_.A AS A, _.B AS B) + task_count: 234 + task_total_time_ms: 3 + transform_count: 57 transform_time_ms: 1 - transform_yield_count: 16 + transform_yield_count: 18 insert_time_ms: 0 - insert_new_count: 21 - insert_reused_count: 2 + insert_new_count: 24 + insert_reused_count: 1 - query: EXPLAIN select * from ta where b <= '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6' explain: SCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN_OR_EQUALS promote(@c9 AS - UUID) - task_count: 187 - task_total_time_ms: 7 - transform_count: 48 + UUID) | MAP (_.A AS A, _.B AS B) + task_count: 218 + task_total_time_ms: 8 + transform_count: 52 transform_time_ms: 2 - transform_yield_count: 14 + transform_yield_count: 16 insert_time_ms: 0 - insert_new_count: 17 - insert_reused_count: 2 + insert_new_count: 20 + insert_reused_count: 1 - query: EXPLAIN select * from ta where b <= ? explain: SCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN_OR_EQUALS promote(@c9 AS - UUID) - task_count: 203 - task_total_time_ms: 5 - transform_count: 53 + UUID) | MAP (_.A AS A, _.B AS B) + task_count: 234 + task_total_time_ms: 6 + transform_count: 57 transform_time_ms: 1 - transform_yield_count: 16 + transform_yield_count: 18 insert_time_ms: 0 - insert_new_count: 21 - insert_reused_count: 2 + insert_new_count: 24 + insert_reused_count: 1 - query: EXPLAIN select * from ta where b = '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6' - explain: SCAN(<,>) | TFILTER TA | FILTER _.B EQUALS promote(@c8 AS UUID) - task_count: 187 - task_total_time_ms: 4 - transform_count: 48 - transform_time_ms: 1 - transform_yield_count: 14 - insert_time_ms: 0 - insert_new_count: 17 - insert_reused_count: 2 -- query: EXPLAIN select * from ta where b = ? - explain: SCAN(<,>) | TFILTER TA | FILTER _.B EQUALS promote(@c8 AS UUID) - task_count: 203 + explain: SCAN(<,>) | TFILTER TA | FILTER _.B EQUALS promote(@c8 AS UUID) | MAP + (_.A AS A, _.B AS B) + task_count: 218 task_total_time_ms: 7 - transform_count: 53 + transform_count: 52 transform_time_ms: 2 transform_yield_count: 16 insert_time_ms: 0 - insert_new_count: 21 - insert_reused_count: 2 -- query: EXPLAIN select * from ta where b != '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6' - explain: SCAN(<,>) | TFILTER TA | FILTER _.B NOT_EQUALS promote(@c9 AS UUID) - task_count: 187 - task_total_time_ms: 5 - transform_count: 48 + insert_new_count: 20 + insert_reused_count: 1 +- query: EXPLAIN select * from ta where b = ? + explain: SCAN(<,>) | TFILTER TA | FILTER _.B EQUALS promote(@c8 AS UUID) | MAP + (_.A AS A, _.B AS B) + task_count: 234 + task_total_time_ms: 7 + transform_count: 57 transform_time_ms: 1 - transform_yield_count: 14 + transform_yield_count: 18 insert_time_ms: 0 - insert_new_count: 17 - insert_reused_count: 2 + insert_new_count: 24 + insert_reused_count: 1 +- query: EXPLAIN select * from ta where b != '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6' + explain: SCAN(<,>) | TFILTER TA | FILTER _.B NOT_EQUALS promote(@c9 AS UUID) | + MAP (_.A AS A, _.B AS B) + task_count: 218 + task_total_time_ms: 8 + transform_count: 52 + transform_time_ms: 2 + transform_yield_count: 16 + insert_time_ms: 0 + insert_new_count: 20 + insert_reused_count: 1 - query: EXPLAIN select * from ta where b != ? - explain: SCAN(<,>) | TFILTER TA | FILTER _.B NOT_EQUALS promote(@c9 AS UUID) - task_count: 203 - task_total_time_ms: 5 - transform_count: 53 + explain: SCAN(<,>) | TFILTER TA | FILTER _.B NOT_EQUALS promote(@c9 AS UUID) | + MAP (_.A AS A, _.B AS B) + task_count: 234 + task_total_time_ms: 2 + transform_count: 57 transform_time_ms: 1 - transform_yield_count: 16 + transform_yield_count: 18 insert_time_ms: 0 - insert_new_count: 21 - insert_reused_count: 2 + insert_new_count: 24 + insert_reused_count: 1 - query: EXPLAIN select * from ta where b is null - explain: SCAN(<,>) | TFILTER TA | FILTER _.B IS_NULL - task_count: 187 - task_total_time_ms: 2 - transform_count: 48 - transform_time_ms: 0 - transform_yield_count: 14 + explain: SCAN(<,>) | TFILTER TA | FILTER _.B IS_NULL | MAP (_.A AS A, _.B AS B) + task_count: 218 + task_total_time_ms: 8 + transform_count: 52 + transform_time_ms: 2 + transform_yield_count: 16 insert_time_ms: 0 - insert_new_count: 17 - insert_reused_count: 2 + insert_new_count: 20 + insert_reused_count: 1 uuid-as-a-field-tests_uuid_parameter_as_string: - query: EXPLAIN select * from ta where b > '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6' explain: SCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN promote(@c8 AS UUID) - task_count: 187 - task_total_time_ms: 7 - transform_count: 48 - transform_time_ms: 2 - transform_yield_count: 14 + | MAP (_.A AS A, _.B AS B) + task_count: 218 + task_total_time_ms: 8 + transform_count: 52 + transform_time_ms: 1 + transform_yield_count: 16 insert_time_ms: 0 - insert_new_count: 17 - insert_reused_count: 2 + insert_new_count: 20 + insert_reused_count: 1 - query: EXPLAIN select * from ta where b > ? explain: SCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN promote(@c8 AS UUID) - task_count: 203 - task_total_time_ms: 8 - transform_count: 53 - transform_time_ms: 2 - transform_yield_count: 16 + | MAP (_.A AS A, _.B AS B) + task_count: 234 + task_total_time_ms: 5 + transform_count: 57 + transform_time_ms: 1 + transform_yield_count: 18 insert_time_ms: 0 - insert_new_count: 21 - insert_reused_count: 2 + insert_new_count: 24 + insert_reused_count: 1 - query: EXPLAIN select * from ta where b < '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6' - explain: SCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN promote(@c8 AS UUID) - task_count: 187 - task_total_time_ms: 1 - transform_count: 48 - transform_time_ms: 0 - transform_yield_count: 14 - insert_time_ms: 0 - insert_new_count: 17 - insert_reused_count: 2 -- query: EXPLAIN select * from ta where b < ? - explain: SCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN promote(@c8 AS UUID) - task_count: 203 - task_total_time_ms: 2 - transform_count: 53 + explain: SCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN promote(@c8 AS UUID) | + MAP (_.A AS A, _.B AS B) + task_count: 218 + task_total_time_ms: 8 + transform_count: 52 transform_time_ms: 1 transform_yield_count: 16 insert_time_ms: 0 - insert_new_count: 21 - insert_reused_count: 2 + insert_new_count: 20 + insert_reused_count: 1 +- query: EXPLAIN select * from ta where b < ? + explain: SCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN promote(@c8 AS UUID) | + MAP (_.A AS A, _.B AS B) + task_count: 234 + task_total_time_ms: 6 + transform_count: 57 + transform_time_ms: 2 + transform_yield_count: 18 + insert_time_ms: 0 + insert_new_count: 24 + insert_reused_count: 1 - query: EXPLAIN select * from ta where b >= '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6' explain: SCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN_OR_EQUALS promote(@c9 - AS UUID) - task_count: 187 - task_total_time_ms: 7 - transform_count: 48 + AS UUID) | MAP (_.A AS A, _.B AS B) + task_count: 218 + task_total_time_ms: 8 + transform_count: 52 transform_time_ms: 2 - transform_yield_count: 14 + transform_yield_count: 16 insert_time_ms: 0 - insert_new_count: 17 - insert_reused_count: 2 + insert_new_count: 20 + insert_reused_count: 1 - query: EXPLAIN select * from ta where b >= ? explain: SCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN_OR_EQUALS promote(@c9 - AS UUID) - task_count: 203 - task_total_time_ms: 5 - transform_count: 53 + AS UUID) | MAP (_.A AS A, _.B AS B) + task_count: 234 + task_total_time_ms: 3 + transform_count: 57 transform_time_ms: 1 - transform_yield_count: 16 + transform_yield_count: 18 insert_time_ms: 0 - insert_new_count: 21 - insert_reused_count: 2 + insert_new_count: 24 + insert_reused_count: 1 - query: EXPLAIN select * from ta where b <= '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6' explain: SCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN_OR_EQUALS promote(@c9 AS - UUID) - task_count: 187 - task_total_time_ms: 7 - transform_count: 48 + UUID) | MAP (_.A AS A, _.B AS B) + task_count: 218 + task_total_time_ms: 8 + transform_count: 52 transform_time_ms: 2 - transform_yield_count: 14 + transform_yield_count: 16 insert_time_ms: 0 - insert_new_count: 17 - insert_reused_count: 2 + insert_new_count: 20 + insert_reused_count: 1 - query: EXPLAIN select * from ta where b <= ? explain: SCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN_OR_EQUALS promote(@c9 AS - UUID) - task_count: 203 - task_total_time_ms: 5 - transform_count: 53 + UUID) | MAP (_.A AS A, _.B AS B) + task_count: 234 + task_total_time_ms: 6 + transform_count: 57 transform_time_ms: 1 - transform_yield_count: 16 + transform_yield_count: 18 insert_time_ms: 0 - insert_new_count: 21 - insert_reused_count: 2 + insert_new_count: 24 + insert_reused_count: 1 - query: EXPLAIN select * from ta where b = '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6' - explain: SCAN(<,>) | TFILTER TA | FILTER _.B EQUALS promote(@c8 AS UUID) - task_count: 187 - task_total_time_ms: 4 - transform_count: 48 - transform_time_ms: 1 - transform_yield_count: 14 - insert_time_ms: 0 - insert_new_count: 17 - insert_reused_count: 2 -- query: EXPLAIN select * from ta where b = ? - explain: SCAN(<,>) | TFILTER TA | FILTER _.B EQUALS promote(@c8 AS UUID) - task_count: 203 + explain: SCAN(<,>) | TFILTER TA | FILTER _.B EQUALS promote(@c8 AS UUID) | MAP + (_.A AS A, _.B AS B) + task_count: 218 task_total_time_ms: 7 - transform_count: 53 + transform_count: 52 transform_time_ms: 2 transform_yield_count: 16 insert_time_ms: 0 - insert_new_count: 21 - insert_reused_count: 2 -- query: EXPLAIN select * from ta where b != '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6' - explain: SCAN(<,>) | TFILTER TA | FILTER _.B NOT_EQUALS promote(@c9 AS UUID) - task_count: 187 - task_total_time_ms: 5 - transform_count: 48 + insert_new_count: 20 + insert_reused_count: 1 +- query: EXPLAIN select * from ta where b = ? + explain: SCAN(<,>) | TFILTER TA | FILTER _.B EQUALS promote(@c8 AS UUID) | MAP + (_.A AS A, _.B AS B) + task_count: 234 + task_total_time_ms: 7 + transform_count: 57 transform_time_ms: 1 - transform_yield_count: 14 + transform_yield_count: 18 insert_time_ms: 0 - insert_new_count: 17 - insert_reused_count: 2 + insert_new_count: 24 + insert_reused_count: 1 +- query: EXPLAIN select * from ta where b != '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6' + explain: SCAN(<,>) | TFILTER TA | FILTER _.B NOT_EQUALS promote(@c9 AS UUID) | + MAP (_.A AS A, _.B AS B) + task_count: 218 + task_total_time_ms: 8 + transform_count: 52 + transform_time_ms: 2 + transform_yield_count: 16 + insert_time_ms: 0 + insert_new_count: 20 + insert_reused_count: 1 - query: EXPLAIN select * from ta where b != ? - explain: SCAN(<,>) | TFILTER TA | FILTER _.B NOT_EQUALS promote(@c9 AS UUID) - task_count: 203 - task_total_time_ms: 5 - transform_count: 53 + explain: SCAN(<,>) | TFILTER TA | FILTER _.B NOT_EQUALS promote(@c9 AS UUID) | + MAP (_.A AS A, _.B AS B) + task_count: 234 + task_total_time_ms: 2 + transform_count: 57 transform_time_ms: 1 - transform_yield_count: 16 + transform_yield_count: 18 insert_time_ms: 0 - insert_new_count: 21 - insert_reused_count: 2 + insert_new_count: 24 + insert_reused_count: 1 uuid-as-a-primary-key: - query: EXPLAIN select B, A from TB explain: SCAN(<,>) | TFILTER TB | MAP (_.B AS B, _.A AS A) @@ -435,47 +451,48 @@ uuid-in-index-definition: insert_new_count: 33 insert_reused_count: 4 - query: EXPLAIN select * from tc order by b - explain: ISCAN(TC1 <,>) - task_count: 277 - task_total_time_ms: 13 - transform_count: 74 - transform_time_ms: 5 - transform_yield_count: 34 + explain: 'COVERING(TC1 <,> -> [A: KEY[2], B: KEY[0], C: VALUE[0]]) | MAP (_.A + AS A, _.B AS B, _.C AS C)' + task_count: 389 + task_total_time_ms: 11 + transform_count: 94 + transform_time_ms: 2 + transform_yield_count: 42 insert_time_ms: 0 - insert_new_count: 25 - insert_reused_count: 8 + insert_new_count: 39 + insert_reused_count: 4 - query: EXPLAIN select * from tc where b > 'a8708750-d70f-4800-8c3b-13700d5b369f' order by b explain: ISCAN(TC1 [[GREATER_THAN promote(@c8 AS UUID)]]) - task_count: 411 - task_total_time_ms: 21 - transform_count: 95 - transform_time_ms: 6 - transform_yield_count: 42 + task_count: 475 + task_total_time_ms: 26 + transform_count: 107 + transform_time_ms: 7 + transform_yield_count: 44 insert_time_ms: 0 - insert_new_count: 41 - insert_reused_count: 4 + insert_new_count: 49 + insert_reused_count: 6 - query: EXPLAIN select * from tc where b < 'a8708750-d70f-4800-8c3b-13700d5b369f' order by b desc explain: ISCAN(TC1 [[LESS_THAN promote(@c8 AS UUID)]] REVERSE) - task_count: 411 - task_total_time_ms: 20 - transform_count: 95 + task_count: 475 + task_total_time_ms: 26 + transform_count: 107 transform_time_ms: 7 - transform_yield_count: 42 + transform_yield_count: 44 insert_time_ms: 0 - insert_new_count: 41 - insert_reused_count: 4 + insert_new_count: 49 + insert_reused_count: 6 - query: EXPLAIN select * from tc where b < 'a8708750-d70f-4800-8c3b-13700d5b369f' and c > 4 order by b desc explain: 'COVERING(TC1 [[LESS_THAN promote(@c8 AS UUID)]] REVERSE -> [A: KEY[2], B: KEY[0], C: VALUE[0]]) | FILTER _.C GREATER_THAN promote(@c12 AS LONG) | FETCH' - task_count: 515 - task_total_time_ms: 22 - transform_count: 109 + task_count: 579 + task_total_time_ms: 27 + transform_count: 121 transform_time_ms: 8 - transform_yield_count: 46 + transform_yield_count: 48 insert_time_ms: 0 - insert_new_count: 55 - insert_reused_count: 2 + insert_new_count: 63 + insert_reused_count: 4 diff --git a/yaml-tests/src/test/resources/uuid.yamsql b/yaml-tests/src/test/resources/uuid.yamsql index 725cfb4025..92b5a00c15 100644 --- a/yaml-tests/src/test/resources/uuid.yamsql +++ b/yaml-tests/src/test/resources/uuid.yamsql @@ -75,7 +75,7 @@ test_block: tests: - - query: select * from ta - - explain: "SCAN(<,>) | TFILTER TA" + - explain: "SCAN(<,>) | TFILTER TA | MAP (_.A AS A, _.B AS B)" - unorderedResult: [{1, !uuid '0920df1c-be81-4ec1-8a06-2180226f051d'}, {2, !uuid '64120112-4e39-40c3-94b9-2cc88a52e8df'}, {3, !uuid 'c35ba01f-f8fc-47d7-bb00-f077e8a75682'}, @@ -86,35 +86,35 @@ test_block: {8, !null _}] - - query: select * from ta where b > !! !uuid '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6' !! - - explain: "SCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN promote(@c8 AS UUID)" + - explain: "SCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN promote(@c8 AS UUID) | MAP (_.A AS A, _.B AS B)" - unorderedResult: [{3, !uuid 'c35ba01f-f8fc-47d7-bb00-f077e8a75682'}, {5, !uuid 'a8708750-d70f-4800-8c3b-13700d5b369f'}] - - query: select * from ta where b < !! !uuid '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6' !! - - explain: "SCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN promote(@c8 AS UUID)" + - explain: "SCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN promote(@c8 AS UUID) | MAP (_.A AS A, _.B AS B)" - unorderedResult: [{1, !uuid '0920df1c-be81-4ec1-8a06-2180226f051d'}, {2, !uuid '64120112-4e39-40c3-94b9-2cc88a52e8df'}, {4, !uuid '5394a912-aa8e-40fc-a4bb-ddf3f89ac45b'}] - - query: select * from ta where b >= !! !uuid '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6' !! - - explain: "SCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN_OR_EQUALS promote(@c9 AS UUID)" + - explain: "SCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN_OR_EQUALS promote(@c9 AS UUID) | MAP (_.A AS A, _.B AS B)" - unorderedResult: [{3, !uuid 'c35ba01f-f8fc-47d7-bb00-f077e8a75682'}, {5, !uuid 'a8708750-d70f-4800-8c3b-13700d5b369f'}, {6, !uuid '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'}] - - query: select * from ta where b <= !! !uuid '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6' !! - - explain: "SCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN_OR_EQUALS promote(@c9 AS UUID)" + - explain: "SCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN_OR_EQUALS promote(@c9 AS UUID) | MAP (_.A AS A, _.B AS B)" - unorderedResult: [{1, !uuid '0920df1c-be81-4ec1-8a06-2180226f051d'}, {2, !uuid '64120112-4e39-40c3-94b9-2cc88a52e8df'}, {4, !uuid '5394a912-aa8e-40fc-a4bb-ddf3f89ac45b'}, {6, !uuid '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'}] - - query: select * from ta where b = !! !uuid '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6' !! - - explain: "SCAN(<,>) | TFILTER TA | FILTER _.B EQUALS promote(@c8 AS UUID)" + - explain: "SCAN(<,>) | TFILTER TA | FILTER _.B EQUALS promote(@c8 AS UUID) | MAP (_.A AS A, _.B AS B)" - unorderedResult: [{6, !uuid '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'}] - - query: select * from ta where b != !! !uuid '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6' !! - - explain: "SCAN(<,>) | TFILTER TA | FILTER _.B NOT_EQUALS promote(@c9 AS UUID)" + - explain: "SCAN(<,>) | TFILTER TA | FILTER _.B NOT_EQUALS promote(@c9 AS UUID) | MAP (_.A AS A, _.B AS B)" - unorderedResult: [{1, !uuid '0920df1c-be81-4ec1-8a06-2180226f051d'}, {2, !uuid '64120112-4e39-40c3-94b9-2cc88a52e8df'}, {3, !uuid 'c35ba01f-f8fc-47d7-bb00-f077e8a75682'}, @@ -122,7 +122,7 @@ test_block: {5, !uuid 'a8708750-d70f-4800-8c3b-13700d5b369f'}] - - query: select * from ta where b is null - - explain: "SCAN(<,>) | TFILTER TA | FILTER _.B IS_NULL" + - explain: "SCAN(<,>) | TFILTER TA | FILTER _.B IS_NULL | MAP (_.A AS A, _.B AS B)" - unorderedResult: [{7, !null _}, {8, !null _}] - @@ -134,35 +134,35 @@ test_block: tests: - - query: select * from ta where b > !! '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6' !! - - explain: "SCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN promote(@c8 AS UUID)" + - explain: "SCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN promote(@c8 AS UUID) | MAP (_.A AS A, _.B AS B)" - unorderedResult: [{3, !uuid 'c35ba01f-f8fc-47d7-bb00-f077e8a75682'}, {5, !uuid 'a8708750-d70f-4800-8c3b-13700d5b369f'}] - - query: select * from ta where b < !! '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6' !! - - explain: "SCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN promote(@c8 AS UUID)" + - explain: "SCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN promote(@c8 AS UUID) | MAP (_.A AS A, _.B AS B)" - unorderedResult: [{1, !uuid '0920df1c-be81-4ec1-8a06-2180226f051d'}, {2, !uuid '64120112-4e39-40c3-94b9-2cc88a52e8df'}, {4, !uuid '5394a912-aa8e-40fc-a4bb-ddf3f89ac45b'}] - - query: select * from ta where b >= !! '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6' !! - - explain: "SCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN_OR_EQUALS promote(@c9 AS UUID)" + - explain: "SCAN(<,>) | TFILTER TA | FILTER _.B GREATER_THAN_OR_EQUALS promote(@c9 AS UUID) | MAP (_.A AS A, _.B AS B)" - unorderedResult: [{3, !uuid 'c35ba01f-f8fc-47d7-bb00-f077e8a75682'}, {5, !uuid 'a8708750-d70f-4800-8c3b-13700d5b369f'}, {6, !uuid '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'}] - - query: select * from ta where b <= !! '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6' !! - - explain: "SCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN_OR_EQUALS promote(@c9 AS UUID)" + - explain: "SCAN(<,>) | TFILTER TA | FILTER _.B LESS_THAN_OR_EQUALS promote(@c9 AS UUID) | MAP (_.A AS A, _.B AS B)" - unorderedResult: [{1, !uuid '0920df1c-be81-4ec1-8a06-2180226f051d'}, {2, !uuid '64120112-4e39-40c3-94b9-2cc88a52e8df'}, {4, !uuid '5394a912-aa8e-40fc-a4bb-ddf3f89ac45b'}, {6, !uuid '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'}] - - query: select * from ta where b = !! '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6' !! - - explain: "SCAN(<,>) | TFILTER TA | FILTER _.B EQUALS promote(@c8 AS UUID)" + - explain: "SCAN(<,>) | TFILTER TA | FILTER _.B EQUALS promote(@c8 AS UUID) | MAP (_.A AS A, _.B AS B)" - unorderedResult: [{6, !uuid '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6'}] - - query: select * from ta where b != !! '99e8e8b1-ac34-4f4d-9f01-1f4a7debf4d6' !! - - explain: "SCAN(<,>) | TFILTER TA | FILTER _.B NOT_EQUALS promote(@c9 AS UUID)" + - explain: "SCAN(<,>) | TFILTER TA | FILTER _.B NOT_EQUALS promote(@c9 AS UUID) | MAP (_.A AS A, _.B AS B)" - unorderedResult: [{1, !uuid '0920df1c-be81-4ec1-8a06-2180226f051d'}, {2, !uuid '64120112-4e39-40c3-94b9-2cc88a52e8df'}, {3, !uuid 'c35ba01f-f8fc-47d7-bb00-f077e8a75682'}, @@ -241,7 +241,7 @@ test_block: {!uuid 'c35ba01f-f8fc-47d7-bb00-f077e8a75682', 4}] - - query: select * from tc order by b - - explain: "ISCAN(TC1 <,>)" + - explain: "COVERING(TC1 <,> -> [A: KEY:[2], B: KEY:[0], C: VALUE:[0]]) | MAP (_.A AS A, _.B AS B, _.C AS C)" - result: [{1, !uuid '0920df1c-be81-4ec1-8a06-2180226f051d', 6}, {4, !uuid '5394a912-aa8e-40fc-a4bb-ddf3f89ac45b', 3}, {2, !uuid '64120112-4e39-40c3-94b9-2cc88a52e8df', 5}, diff --git a/yaml-tests/src/test/resources/valid-identifiers.metrics.binpb b/yaml-tests/src/test/resources/valid-identifiers.metrics.binpb index 5716e92ad2..82d0ad08b2 100644 --- a/yaml-tests/src/test/resources/valid-identifiers.metrics.binpb +++ b/yaml-tests/src/test/resources/valid-identifiers.metrics.binpb @@ -439,18 +439,18 @@ n 3 [ label=<
Index
foo.tableA.idx
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS foo.tableA.A1, LONG AS foo.tableA.A2, LONG AS foo.tableA.A3)" ]; 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; 2 -> 1 [ label=< q66> label="q66" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}³ +}å K - all-tests>EXPLAIN select struct "x$$" ("foo.tableA".*) from "foo.tableA"ã -­¨‘ÅK ÛÙ“(%0™ß8#@*ISCAN(foo.tableA.idx3 <,>) | MAP (_ AS _0)™ digraph G { + all-tests>EXPLAIN select struct "x$$" ("foo.tableA".*) from "foo.tableA"• +‹ûÀêŠ ¦ìä(20²Æ86@æCOVERING(foo.tableA.idx <,> -> [foo__2tableA__2A1: KEY[0], foo__2tableA__2A2: KEY[1], foo__2tableA__2A3: KEY[2]]) | MAP ((_.foo.tableA.A1 AS foo.tableA.A1, _.foo.tableA.A2 AS foo.tableA.A2, _.foo.tableA.A3 AS foo.tableA.A3) AS _0) digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Value Computation
MAP (q2 AS _0)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS foo.tableA.A1, LONG AS foo.tableA.A2, LONG AS foo.tableA.A3 AS _0)" ]; - 2 [ label=<
Index Scan
range: <-∞, ∞>
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS foo.tableA.A1, LONG AS foo.tableA.A2, LONG AS foo.tableA.A3)" ]; - 3 [ label=<
Index
foo.tableA.idx3
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS foo.tableA.A1, LONG AS foo.tableA.A2, LONG AS foo.tableA.A3)" ]; + 1 [ label=<
Value Computation
MAP ((q66.foo.tableA.A1 AS foo.tableA.A1, q66.foo.tableA.A2 AS foo.tableA.A2, q66.foo.tableA.A3 AS foo.tableA.A3) AS _0)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS foo.tableA.A1, LONG AS foo.tableA.A2, LONG AS foo.tableA.A3 AS _0)" ]; + 2 [ label=<
Covering Index Scan
range: <-∞, ∞>
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS foo.tableA.A1, LONG AS foo.tableA.A2, LONG AS foo.tableA.A3)" ]; + 3 [ label=<
Index
foo.tableA.idx
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS foo.tableA.A1, LONG AS foo.tableA.A2, LONG AS foo.tableA.A3)" ]; 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" ]; + 2 -> 1 [ label=< q66> label="q66" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; }ö j all-tests]EXPLAIN select struct "x$$" ("foo.tableA.A2" + "foo.tableA.A1" as "__$$__") from "foo.tableA"‡ @@ -872,36 +872,38 @@ unnamed-12&EXPLAIN SELECT "___hidden"."a" FROM T4 3 -> 2 [ label=< q19> label="q19" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -} +}° 1 -unnamed-12#EXPLAIN SELECT * FROM T5__UNESCAPEDŒ -Ÿý×Î) ›Œv( 0à -8 @!SCAN(<,>) | TFILTER T5__UNESCAPEDÌ -digraph G { - fontname=courier; - rankdir=BT; - splines=polyline; - 1 [ label=<
Type Filter
WHERE record IS [T5__UNESCAPED]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS T5__COL1, LONG AS __T5__COL2)" ]; - 2 [ label=<
Scan
range: <-∞, ∞>
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 [ label=<
Primary Storage
record types: [T4, T5__UNESCAPED, __T3, T1, T2, ___T6__2__UNESCAPED]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}“ -E - -unnamed-127EXPLAIN SELECT * FROM T5__UNESCAPED WHERE T5__COL1 = 10É -»Çê‹0 ¾ë‚(0³Ý/8@QSCAN(<,>) | TFILTER T5__UNESCAPED | FILTER _.T5__COL1 EQUALS promote(@c8 AS LONG)Ødigraph G { +unnamed-12#EXPLAIN SELECT * FROM T5__UNESCAPEDú +»Áð±. Ù d(0ÆÍ8@hSCAN(<,>) | TFILTER T5__UNESCAPED | MAP (_.ID AS ID, _.T5__COL1 AS T5__COL1, _.__T5__COL2 AS __T5__COL2)ódigraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.T5__COL1 EQUALS promote(@c8 AS LONG)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS T5__COL1, LONG AS __T5__COL2)" ]; + 1 [ label=<
Value Computation
MAP (q2.ID AS ID, q2.T5__COL1 AS T5__COL1, q2.__T5__COL2 AS __T5__COL2)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS T5__COL1, LONG AS __T5__COL2)" ]; 2 [ label=<
Type Filter
WHERE record IS [T5__UNESCAPED]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS T5__COL1, LONG AS __T5__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__UNESCAPED, __T3, T1, T2, ___T6__2__UNESCAPED]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; 3 -> 2 [ label=< q19> label="q19" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; +}† +E + +unnamed-127EXPLAIN SELECT * FROM T5__UNESCAPED WHERE T5__COL1 = 10¼ +Ú“°Ë4 âçp(0÷¡8@˜SCAN(<,>) | TFILTER T5__UNESCAPED | FILTER _.T5__COL1 EQUALS promote(@c8 AS LONG) | MAP (_.ID AS ID, _.T5__COL1 AS T5__COL1, _.__T5__COL2 AS __T5__COL2)„digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Value Computation
MAP (q26.ID AS ID, q26.T5__COL1 AS T5__COL1, q26.__T5__COL2 AS __T5__COL2)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS T5__COL1, LONG AS __T5__COL2)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.T5__COL1 EQUALS promote(@c8 AS LONG)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS T5__COL1, LONG AS __T5__COL2)" ]; + 3 [ label=<
Type Filter
WHERE record IS [T5__UNESCAPED]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS T5__COL1, LONG AS __T5__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__UNESCAPED, __T3, T1, T2, ___T6__2__UNESCAPED]
> 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=< q19> label="q19" 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=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; }Ô T @@ -919,21 +921,24 @@ unnamed-12FEXPLAIN SELECT ID, "__T5__COL2" FROM T5__UNESCAPED WHERE T5__COL1 = 4 -> 3 [ label=< q19> label="q19" 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=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; -}¡ +}• I -unnamed-12;EXPLAIN SELECT * FROM T5__UNESCAPED WHERE "__T5__COL2" < 10Ó -»ÆÜø0 ‡Äì(0äÆ8@VSCAN(<,>) | TFILTER T5__UNESCAPED | FILTER _.__T5__COL2 LESS_THAN promote(@c8 AS LONG)Ýdigraph G { +unnamed-12;EXPLAIN SELECT * FROM T5__UNESCAPED WHERE "__T5__COL2" < 10Ç +Ú—Õú4 ›˜©(0®Ñ +8@SCAN(<,>) | TFILTER T5__UNESCAPED | FILTER _.__T5__COL2 LESS_THAN promote(@c8 AS LONG) | MAP (_.ID AS ID, _.T5__COL1 AS T5__COL1, _.__T5__COL2 AS __T5__COL2)‰digraph G { fontname=courier; rankdir=BT; splines=polyline; - 1 [ label=<
Predicate Filter
WHERE q2.__T5__COL2 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 T5__COL1, LONG AS __T5__COL2)" ]; - 2 [ label=<
Type Filter
WHERE record IS [T5__UNESCAPED]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS T5__COL1, LONG AS __T5__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__UNESCAPED, __T3, T1, T2, ___T6__2__UNESCAPED]
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(RECORD)" ]; - 3 -> 2 [ label=< q19> label="q19" 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="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 1 [ label=<
Value Computation
MAP (q26.ID AS ID, q26.T5__COL1 AS T5__COL1, q26.__T5__COL2 AS __T5__COL2)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS T5__COL1, LONG AS __T5__COL2)" ]; + 2 [ label=<
Predicate Filter
WHERE q2.__T5__COL2 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 T5__COL1, LONG AS __T5__COL2)" ]; + 3 [ label=<
Type Filter
WHERE record IS [T5__UNESCAPED]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS T5__COL1, LONG AS __T5__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__UNESCAPED, __T3, T1, T2, ___T6__2__UNESCAPED]
> 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=< q19> label="q19" 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=< q26> label="q26" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; }â X diff --git a/yaml-tests/src/test/resources/valid-identifiers.metrics.yaml b/yaml-tests/src/test/resources/valid-identifiers.metrics.yaml index 0d327ab246..7bb2b1cd75 100644 --- a/yaml-tests/src/test/resources/valid-identifiers.metrics.yaml +++ b/yaml-tests/src/test/resources/valid-identifiers.metrics.yaml @@ -365,15 +365,17 @@ all-tests: insert_new_count: 54 insert_reused_count: 3 - query: EXPLAIN select struct "x$$" ("foo.tableA".*) from "foo.tableA" - explain: ISCAN(foo.tableA.idx3 <,>) | MAP (_ AS _0) - task_count: 301 - task_total_time_ms: 7 - transform_count: 75 - transform_time_ms: 4 - transform_yield_count: 37 + explain: 'COVERING(foo.tableA.idx <,> -> [foo__2tableA__2A1: KEY[0], foo__2tableA__2A2: + KEY[1], foo__2tableA__2A3: KEY[2]]) | MAP ((_.foo.tableA.A1 AS foo.tableA.A1, + _.foo.tableA.A2 AS foo.tableA.A2, _.foo.tableA.A3 AS foo.tableA.A3) AS _0)' + task_count: 523 + task_total_time_ms: 12 + transform_count: 138 + transform_time_ms: 3 + transform_yield_count: 50 insert_time_ms: 0 - insert_new_count: 35 - insert_reused_count: 6 + insert_new_count: 54 + insert_reused_count: 3 - query: EXPLAIN select struct "x$$" ("foo.tableA.A2" + "foo.tableA.A1" as "__$$__") from "foo.tableA" explain: ISCAN(foo.tableA.idx3 <,>) | MAP ((_.foo.tableA.A2 + _.foo.tableA.A1 @@ -679,26 +681,27 @@ unnamed-12: insert_new_count: 15 insert_reused_count: 2 - query: EXPLAIN SELECT * FROM T5__UNESCAPED - explain: SCAN(<,>) | TFILTER T5__UNESCAPED - task_count: 159 + explain: SCAN(<,>) | TFILTER T5__UNESCAPED | MAP (_.ID AS ID, _.T5__COL1 AS T5__COL1, + _.__T5__COL2 AS __T5__COL2) + task_count: 187 task_total_time_ms: 7 - transform_count: 41 + transform_count: 46 transform_time_ms: 1 - transform_yield_count: 13 + transform_yield_count: 15 insert_time_ms: 0 - insert_new_count: 13 - insert_reused_count: 2 + insert_new_count: 16 + insert_reused_count: 1 - query: EXPLAIN SELECT * FROM T5__UNESCAPED WHERE T5__COL1 = 10 explain: SCAN(<,>) | TFILTER T5__UNESCAPED | FILTER _.T5__COL1 EQUALS promote(@c8 - AS LONG) - task_count: 187 - task_total_time_ms: 10 - transform_count: 48 - transform_time_ms: 4 - transform_yield_count: 14 + AS LONG) | MAP (_.ID AS ID, _.T5__COL1 AS T5__COL1, _.__T5__COL2 AS __T5__COL2) + task_count: 218 + task_total_time_ms: 7 + transform_count: 52 + transform_time_ms: 1 + transform_yield_count: 16 insert_time_ms: 0 - insert_new_count: 17 - insert_reused_count: 2 + insert_new_count: 20 + insert_reused_count: 1 - query: EXPLAIN SELECT ID, "__T5__COL2" FROM T5__UNESCAPED WHERE T5__COL1 = 10 explain: SCAN(<,>) | TFILTER T5__UNESCAPED | FILTER _.T5__COL1 EQUALS promote(@c10 AS LONG) | MAP (_.ID AS ID, _.__T5__COL2 AS __T5__COL2) @@ -712,15 +715,15 @@ unnamed-12: insert_reused_count: 2 - query: EXPLAIN SELECT * FROM T5__UNESCAPED WHERE "__T5__COL2" < 10 explain: SCAN(<,>) | TFILTER T5__UNESCAPED | FILTER _.__T5__COL2 LESS_THAN promote(@c8 - AS LONG) - task_count: 187 - task_total_time_ms: 10 - transform_count: 48 - transform_time_ms: 3 - transform_yield_count: 14 + AS LONG) | MAP (_.ID AS ID, _.T5__COL1 AS T5__COL1, _.__T5__COL2 AS __T5__COL2) + task_count: 218 + task_total_time_ms: 8 + transform_count: 52 + transform_time_ms: 2 + transform_yield_count: 16 insert_time_ms: 0 - insert_new_count: 17 - insert_reused_count: 2 + insert_new_count: 20 + insert_reused_count: 1 - query: EXPLAIN SELECT ID, "__T5__COL2" FROM T5__UNESCAPED WHERE "__T5__COL2" < 10 explain: SCAN(<,>) | TFILTER T5__UNESCAPED | FILTER _.__T5__COL2 LESS_THAN promote(@c10 diff --git a/yaml-tests/src/test/resources/valid-identifiers.yamsql b/yaml-tests/src/test/resources/valid-identifiers.yamsql index e554760f20..1d1f673345 100644 --- a/yaml-tests/src/test/resources/valid-identifiers.yamsql +++ b/yaml-tests/src/test/resources/valid-identifiers.yamsql @@ -395,7 +395,7 @@ test_block: - # named record construction with uid star - query: select struct "x$$" ("foo.tableA".*) from "foo.tableA" - - explain: "ISCAN(foo.tableA.idx3 <,>) | MAP (_ AS _0)" + - explain: "COVERING(foo.tableA.idx <,> -> [foo__2tableA__2A1: KEY:[0], foo__2tableA__2A2: KEY:[1], foo__2tableA__2A3: KEY:[2]]) | MAP ((_.foo.tableA.A1 AS foo.tableA.A1, _.foo.tableA.A2 AS foo.tableA.A2, _.foo.tableA.A3 AS foo.tableA.A3) AS _0)" - result: [{{"foo.tableA.A1": 1 , "foo.tableA.A2": 10, "foo.tableA.A3": 1}}, {{"foo.tableA.A1": 2, "foo.tableA.A2": 10, "foo.tableA.A3": 2}}, {{"foo.tableA.A1": 3, "foo.tableA.A2": 10, "foo.tableA.A3": 3}}] - # named record construction with aliased expressions @@ -433,6 +433,19 @@ test_block: {"enum_type.id": 9, "enum_type.enum__1": "B$C", "enum_type.enum__2": "__G$H"}, {"enum_type.id": 11, "enum_type.enum__1": "B$C", "enum_type.enum__2": !null _}, ] + - + - query: select * from "foo.enum.type" where "enum_type.enum__1" = 'B$C'; + # Same as above, but with force continuations enabled. + # This can be combined with the previous query once we no longer care about backwards compatibility with versions older than !current_version + - supported_version: !current_version + - result: [ + {"enum_type.id": 2, "enum_type.enum__1": "B$C", "enum_type.enum__2": "B$C"}, + {"enum_type.id": 6, "enum_type.enum__1": "B$C", "enum_type.enum__2": "A"}, + {"enum_type.id": 7, "enum_type.enum__1": "B$C", "enum_type.enum__2": "C.D"}, + {"enum_type.id": 8, "enum_type.enum__1": "B$C", "enum_type.enum__2": "E__F"}, + {"enum_type.id": 9, "enum_type.enum__1": "B$C", "enum_type.enum__2": "__G$H"}, + {"enum_type.id": 11, "enum_type.enum__1": "B$C", "enum_type.enum__2": !null _}, + ] - - query: select * from "foo.enum.type" where "enum_type.enum__1" = 'C.D'; - explain: "ISCAN(foo.enum.type$enum__1 [EQUALS promote(@c8 AS ENUM)])" @@ -441,6 +454,14 @@ test_block: - result: [ {"enum_type.id": 3, "enum_type.enum__1": "C.D", "enum_type.enum__2": "B$C"}, ] + - + - query: select * from "foo.enum.type" where "enum_type.enum__1" = 'C.D'; + # Same as above, but with force continuations enabled. + # This can be combined with the previous query once we no longer care about backwards compatibility with versions older than !current_version + - supported_version: !current_version + - result: [ + {"enum_type.id": 3, "enum_type.enum__1": "C.D", "enum_type.enum__2": "B$C"}, + ] - - query: select * from "foo.enum.type" where "enum_type.enum__1" = 'A'; - explain: "ISCAN(foo.enum.type$enum__1 [EQUALS promote(@c8 AS ENUM)])" @@ -449,6 +470,14 @@ test_block: - result: [ {"enum_type.id": 1, "enum_type.enum__1": "A", "enum_type.enum__2": "B$C"}, ] + - + - query: select * from "foo.enum.type" where "enum_type.enum__1" = 'A'; + # Same as above, but with force continuations enabled. + # This can be combined with the previous query once we no longer care about backwards compatibility with versions older than !current_version + - supported_version: !current_version + - result: [ + {"enum_type.id": 1, "enum_type.enum__1": "A", "enum_type.enum__2": "B$C"}, + ] - - query: select * from "foo.enum.type" where "enum_type.enum__2" = 'B$C'; - explain: "ISCAN(foo.enum.type$enum__1 <,>) | FILTER _.enum_type.enum__2 EQUALS promote(@c8 AS ENUM)" @@ -713,7 +742,7 @@ test_block: - result: [{11}, {11}, {11}, {11}, {22}, {22}, {22}, {22} ] - - query: SELECT * FROM T5__UNESCAPED - - explain: "SCAN(<,>) | TFILTER T5__UNESCAPED" + - explain: "SCAN(<,>) | TFILTER T5__UNESCAPED | MAP (_.ID AS ID, _.T5__COL1 AS T5__COL1, _.__T5__COL2 AS __T5__COL2)" - result: [ {"ID": 24, "T5__COL1": 10, "__T5__COL2" : 16}, {"ID": 25, "T5__COL1": 10, "__T5__COL2" : 17}, @@ -726,7 +755,7 @@ test_block: ] - - query: SELECT * FROM T5__UNESCAPED WHERE T5__COL1 = 10 - - explain: "SCAN(<,>) | TFILTER T5__UNESCAPED | FILTER _.T5__COL1 EQUALS promote(@c8 AS LONG)" + - explain: "SCAN(<,>) | TFILTER T5__UNESCAPED | FILTER _.T5__COL1 EQUALS promote(@c8 AS LONG) | MAP (_.ID AS ID, _.T5__COL1 AS T5__COL1, _.__T5__COL2 AS __T5__COL2)" - result: [ {"ID": 24, "T5__COL1": 10, "__T5__COL2" : 16}, {"ID": 25, "T5__COL1": 10, "__T5__COL2" : 17}, @@ -746,7 +775,7 @@ test_block: ] - - query: SELECT * FROM T5__UNESCAPED WHERE "__T5__COL2" < 10 - - explain: "SCAN(<,>) | TFILTER T5__UNESCAPED | FILTER _.__T5__COL2 LESS_THAN promote(@c8 AS LONG)" + - explain: "SCAN(<,>) | TFILTER T5__UNESCAPED | FILTER _.__T5__COL2 LESS_THAN promote(@c8 AS LONG) | MAP (_.ID AS ID, _.T5__COL1 AS T5__COL1, _.__T5__COL2 AS __T5__COL2)" - result: [ {"ID": 29, "T5__COL1": -1, "__T5__COL2" : 5}, {"ID": 30, "T5__COL1": 5, "__T5__COL2" : -1}, @@ -832,6 +861,15 @@ test_block: {"ID": 35, "T6$__COL1__": 10, "__T6.COL2__VALUE" : 19, "T6$__ENUM_1": '__D.__', "T6$__ENUM_2": '__D.__' }, {"ID": 39, "T6$__COL1__": -1, "__T6.COL2__VALUE" : -1, "T6$__ENUM_1": 'A', "T6$__ENUM_2": '__D.__' }, ] + - + - query: SELECT * FROM "___T6.__UNESCAPED" WHERE "T6$__ENUM_2" = '__D.__' + # Same as above, but with force continuations enabled. + # This can be combined with the previous query once we no longer care about backwards compatibility with versions older than !current_version + - supported_version: !current_version + - result: [ + {"ID": 35, "T6$__COL1__": 10, "__T6.COL2__VALUE" : 19, "T6$__ENUM_1": '__D.__', "T6$__ENUM_2": '__D.__' }, + {"ID": 39, "T6$__COL1__": -1, "__T6.COL2__VALUE" : -1, "T6$__ENUM_1": 'A', "T6$__ENUM_2": '__D.__' }, + ] - - query: SELECT ID, "T6$__ENUM_1" FROM "___T6.__UNESCAPED" WHERE "T6$__ENUM_2" = '__D.__' - explain: "ISCAN(T6$ENUM2 [EQUALS promote(@c10 AS ENUM)]) | MAP (_.ID AS ID, _.T6$__ENUM_1 AS T6$__ENUM_1)" @@ -841,6 +879,15 @@ test_block: {"ID": 35, "T6$__ENUM_1": '__D.__' }, {"ID": 39, "T6$__ENUM_1": 'A' }, ] + - + - query: SELECT ID, "T6$__ENUM_1" FROM "___T6.__UNESCAPED" WHERE "T6$__ENUM_2" = '__D.__' + # Same as above, but with force continuations enabled. + # This can be combined with the previous query once we no longer care about backwards compatibility with versions older than !current_version + - supported_version: !current_version + - result: [ + {"ID": 35, "T6$__ENUM_1": '__D.__' }, + {"ID": 39, "T6$__ENUM_1": 'A' }, + ] --- setup: connect: "jdbc:embed:/__SYS?schema=CATALOG" diff --git a/yaml-tests/src/test/resources/versions-tests.metrics.binpb b/yaml-tests/src/test/resources/versions-tests.metrics.binpb index 0dacb4e3c6..b679244b46 100644 --- a/yaml-tests/src/test/resources/versions-tests.metrics.binpb +++ b/yaml-tests/src/test/resources/versions-tests.metrics.binpb @@ -1,7 +1,7 @@ -³ +´ X - unnamed-2KEXPLAIN select "__ROW_VERSION" as version, t1.col2 from t1 where col1 = 10;Ö -»óÿé³ 鞣(:0£‘\8L@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;× +ÓËì µ ÿײ (:0Óß§8O@XISCAN(I1 [EQUALS promote(@c14 AS LONG)]) | MAP (version([_]) AS VERSION, _.COL2 AS COL2)Ý digraph G { fontname=courier; rankdir=BT; @@ -11,20 +11,34 @@ digraph G { 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;§ -»ãÚç ‚ ̽Ù(;0ò°;8?@(ISCAN(I1 [EQUALS promote(@c10 AS LONG)])Þdigraph G { + unnamed-2,EXPLAIN select t1.* from t1 where col1 = 10;˜ +ÓÐÀд çò(:0Øð¹8O@[ISCAN(I1 [EQUALS promote(@c10 AS LONG)]) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)› 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, 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" ]; -}á + 1 [ 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)" ]; + 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, VERSION AS __ROW_VERSION)" ]; + 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, VERSION AS __ROW_VERSION)" ]; + 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" ]; +}÷ +1 + unnamed-2$EXPLAIN select t1_v.* from t1_v(10);Á +ëò¦éÒ ½À† (G0¥§€8m@yISCAN(I1 [EQUALS promote(@c8 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([q12]) AS __ROW_VERSION, 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(VERSION AS __ROW_VERSION, 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)" ]; + 3 -> 2 [ 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" ]; +}â … - unnamed-2xEXPLAIN select s.version, s.col2 from (select "__ROW_VERSION" as version, t1.col2 as col2 from t1 where col1 = 10) AS s;Ö -Õ૆ · ð¡ƒ(<0£¯?8P@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;× +퇙£¹ šõÝ (<0Å‘Ç8S@XISCAN(I1 [EQUALS promote(@c26 AS LONG)]) | MAP (version([_]) AS VERSION, _.COL2 AS COL2)Ý digraph G { fontname=courier; rankdir=BT; @@ -34,10 +48,10 @@ digraph G { 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ŽüV8P@^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;é +íÚàa¹ Þþì;(<0÷ýÃ8S@^ISCAN(I1 [EQUALS promote(@c22 AS LONG)]) | MAP (version([_]) AS __ROW_VERSION, _.COL2 AS COL2)é digraph G { fontname=courier; rankdir=BT; @@ -47,10 +61,23 @@ digraph G { 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" ]; -}„ +}Ý +} + unnamed-2pEXPLAIN select s.version, s.col2 from (select "__ROW_VERSION" as version, t1_v.col2 as col2 from t1_v(10)) AS s;Û +…àÎÖ è’Ì (I0ÆÊ¢8q@XISCAN(I1 [EQUALS promote(@c24 AS LONG)]) | MAP (version([_]) AS VERSION, _.COL2 AS COL2)á +digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Value Computation
MAP (version([q12]) AS VERSION, q12.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(@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=< q12> label="q12" 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;ª -»àÛ§³ Ôù“(:0ÖàT8L@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;« +Óß‘Òbµ ñá¿<(:0Å«ƒ8O@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; @@ -59,10 +86,11 @@ U 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;è -»¯õ¶³ òêµ(:0Ðõ[8L@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¾Ý½8O@QISCAN(I1 [EQUALS promote(@c16 AS LONG)]) | MAP (version([_]) AS VERSION, _ AS _1)ö digraph G { fontname=courier; rankdir=BT; @@ -72,10 +100,10 @@ digraph G { 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;¼ -»Ò¨¡³ ÂÛî(:0Ò»R8L@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À„ž8O@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; @@ -84,10 +112,10 @@ J 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;ú -»áëß³ °™Ñ(:0”ÒQ8L@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Ù”„8O@WISCAN(I1 [EQUALS promote(@c14 AS LONG)]) | MAP (version([_]) AS __ROW_VERSION, _ AS _1)‚ digraph G { fontname=courier; rankdir=BT; splines=polyline; @@ -134,6 +162,19 @@ digraph G { 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" ]; +}ó +e + unnamed-2XEXPLAIN select t1_v."__ROW_VERSION", t1_v.id from t1_v(20) order by "__ROW_VERSION" ASC;‰ +÷”ÒÖW‚ Ø¥ˆ7(40¡ß8?@mISCAN(GROUPED_VERSION_INDEX [EQUALS promote(@c12 AS LONG)]) | MAP (version([_]) AS __ROW_VERSION, _.ID AS ID)ú +digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Value Computation
MAP (version([q12]) AS __ROW_VERSION, q12.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)]
> 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=< q12> label="q12" 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;½ @@ -159,4 +200,314 @@ x 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" ]; +}ê +q + unnamed-2dEXPLAIN select "__ROW_VERSION", id, col1 from t4 where exists (select 1 from t4.col4 where col4 = 3)ô +¡­*Ù »äÄ(@0ÿ°›8R@wISCAN(T4_COL4_VERSION [EQUALS promote(@c21 AS LONG)]) | MAP (version([_]) AS __ROW_VERSION, _.ID AS ID, _.COL1 AS COL1)Û 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)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS __ROW_VERSION, LONG AS ID, STRING AS COL1)" ]; + 2 [ label=<
Index Scan
comparisons: [EQUALS promote(@c21 AS LONG)]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, LONG AS COL3, ARRAY(LONG) AS COL4)" ]; + 3 [ label=<
Index
T4_COL4_VERSION
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, LONG AS COL3, ARRAY(LONG) AS COL4)" ]; + 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" ]; +}ö +P + unnamed-2CEXPLAIN select "__ROW_VERSION", id, col1 from t4 where 3 in t4.col4¡ +¶¤üÝ%à ⪉ (50­üÌ8R@¹ISCAN(T4_COL2 <,>) | FLATMAP q0 -> { EXPLODE arrayDistinct(q0.COL4) | FILTER promote(@c10 AS LONG) EQUALS _ AS q1 RETURN (version([q0]) AS __ROW_VERSION, q0.ID AS ID, q0.COL1 AS COL1) }Ådigraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Nested Loop Join
FLATMAP (version([q2]) AS __ROW_VERSION, q2.ID AS ID, q2.COL1 AS COL1)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS __ROW_VERSION, LONG AS ID, STRING AS COL1)" ]; + 2 [ label=<
Index Scan
range: <-∞, ∞>
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, LONG AS COL3, ARRAY(LONG) AS COL4)" ]; + 3 [ label=<
Index
T4_COL2
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, LONG AS COL3, ARRAY(LONG) AS COL4)" ]; + 4 [ label=<
Predicate Filter
WHERE promote(@c10 AS LONG) EQUALS q84
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG)" ]; + 5 [ label=<
Value Computation
EXPLODE arrayDistinct(q2.COL4)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG)" ]; + 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=< q84> label="q84" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 4 -> 1 [ label=< q84> label="q84" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + { + rank=same; + rankDir=LR; + 2 -> 4 [ color="red" style="invis" ]; + } +}à + + unnamed-2‚EXPLAIN select "__ROW_VERSION", id, col1 from t4 where exists (select 1 from t4.col4 where col4 = 3) order by "__ROW_VERSION" desc­ +œŸ‡ +… ÷øì(.0ª%8@ISCAN(T4_COL4_VERSION [EQUALS promote(@c21 AS LONG)] REVERSE) | MAP (version([_]) AS __ROW_VERSION, _.ID AS ID, _.COL1 AS COL1) 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)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS __ROW_VERSION, LONG AS ID, STRING AS COL1)" ]; + 2 [ label=<
Index Scan
comparisons: [EQUALS promote(@c21 AS LONG)]
direction: reversed
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, LONG AS COL3, ARRAY(LONG) AS COL4)" ]; + 3 [ label=<
Index
T4_COL4_VERSION
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, LONG AS COL3, ARRAY(LONG) AS COL4)" ]; + 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-2ÃEXPLAIN select t3."__ROW_VERSION" AS version3, t3.id AS id3, t4."__ROW_VERSION" AS version4, t4.id AS id4, t3.col2, t4.col4 from t3, t4 where t3.col1 = 'b' AND t4.col1 = 'b' AND t4.col2 = t3.col2Ø +鄔㚠Ýýæ (Z0»øx8¡@ ¯ISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q0 -> { ISCAN(T4_COL2 [EQUALS q0.COL2]) | FILTER q0.COL1 EQUALS promote(@c42 AS STRING) AND _.COL1 EQUALS promote(@c42 AS STRING) AS q1 RETURN (version([q0]) AS VERSION3, q0.ID AS ID3, version([q1]) AS VERSION4, q1.ID AS ID4, q0.COL2 AS COL2, q1.COL4 AS COL4) }†digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Nested Loop Join
FLATMAP (version([q2]) AS VERSION3, q2.ID AS ID3, version([q6]) AS VERSION4, q6.ID AS ID4, q2.COL2 AS COL2, q6.COL4 AS COL4)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS VERSION3, LONG AS ID3, VERSION AS VERSION4, LONG AS ID4, LONG AS COL2, ARRAY(LONG) AS COL4)" ]; + 2 [ label=<
Index Scan
range: <-∞, ∞>
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2)" ]; + 3 [ label=<
Index
T3_VERSION_WITH_COL1
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2)" ]; + 4 [ label=<
Predicate Filter
WHERE q2.COL1 EQUALS promote(@c42 AS STRING) AND q6.COL1 EQUALS promote(@c42 AS STRING)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, LONG AS COL3, ARRAY(LONG) AS COL4)" ]; + 5 [ label=<
Index Scan
comparisons: [EQUALS q2.COL2]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, LONG AS COL3, ARRAY(LONG) AS COL4)" ]; + 6 [ label=<
Index
T4_COL2
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, LONG AS COL3, ARRAY(LONG) AS COL4)" ]; + 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=< 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" ]; + 4 -> 1 [ label=< q6> label="q6" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + { + rank=same; + rankDir=LR; + 2 -> 4 [ color="red" style="invis" ]; + } +}Ð# +‚ + unnamed-2ôEXPLAIN select t3."__ROW_VERSION" AS version3, t3.id AS id3, t4."__ROW_VERSION" AS version4, t4.id AS id4, t3.col2, t4.col4 from t3, t4 where t3.col1 = 'b' and t4.col1 = 'b' and t4.col2 = t3.col2 and exists (select 1 from t4.col4 x where x = 2)È! +Ó½Ü5 àžë(Ù0Þë›8ü@)ÝISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q0 -> { ISCAN(T4_COL2_COL4 [EQUALS q0.COL2, EQUALS promote(@c70 AS LONG)]) | FILTER _.COL1 EQUALS promote(@c42 AS STRING) | FILTER q0.COL1 EQUALS promote(@c42 AS STRING) AS q1 RETURN (q0.__ROW_VERSION AS VERSION3, q0.ID AS ID3, q1.__ROW_VERSION AS VERSION4, q1.ID AS ID4, q0.COL2 AS COL2, q1.COL4 AS COL4) }Ædigraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Nested Loop Join
FLATMAP (q2.__ROW_VERSION AS VERSION3, q2.ID AS ID3, q6.__ROW_VERSION AS VERSION4, q6.ID AS ID4, q2.COL2 AS COL2, q6.COL4 AS COL4)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS VERSION3, LONG AS ID3, VERSION AS VERSION4, LONG AS ID4, LONG AS COL2, ARRAY(LONG) AS COL4)" ]; + 2 [ label=<
Index Scan
range: <-∞, ∞>
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, VERSION AS __ROW_VERSION)" ]; + 3 [ label=<
Index
T3_VERSION_WITH_COL1
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, VERSION AS __ROW_VERSION)" ]; + 4 [ label=<
Predicate Filter
WHERE q2.COL1 EQUALS promote(@c42 AS STRING)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, LONG AS COL3, ARRAY(LONG) AS COL4, VERSION AS __ROW_VERSION)" ]; + 5 [ label=<
Predicate Filter
WHERE q6.COL1 EQUALS promote(@c42 AS STRING)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, LONG AS COL3, ARRAY(LONG) AS COL4, VERSION AS __ROW_VERSION)" ]; + 6 [ label=<
Index Scan
comparisons: [EQUALS q2.COL2, EQUALS promote(@c70 AS LONG)]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, LONG AS COL3, ARRAY(LONG) AS COL4, VERSION AS __ROW_VERSION)" ]; + 7 [ label=<
Index
T4_COL2_COL4
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, LONG AS COL3, ARRAY(LONG) AS COL4, VERSION AS __ROW_VERSION)" ]; + 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=< 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" ]; + 4 -> 1 [ label=< q6> label="q6" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + { + rank=same; + rankDir=LR; + 2 -> 4 [ color="red" style="invis" ]; + } +}ß" +â + unnamed-2ÔEXPLAIN select t3.id AS id3, t4."__ROW_VERSION" AS version4, t4.id AS id4, t3.col2, t4.col4 from t3, t4 where t3.col1 = 'b' and t4.col1 = 'b' and t4.col2 = t3.col2 and exists (select 1 from t4.col4 x where x = 2)÷ +„È3 ”¬æ(Ù0ÒßÉ8ü@)¿ISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q0 -> { ISCAN(T4_COL2_COL4 [EQUALS q0.COL2, EQUALS promote(@c64 AS LONG)]) | FILTER _.COL1 EQUALS promote(@c36 AS STRING) | FILTER q0.COL1 EQUALS promote(@c36 AS STRING) AS q1 RETURN (q0.ID AS ID3, q1.__ROW_VERSION AS VERSION4, q1.ID AS ID4, q0.COL2 AS COL2, q1.COL4 AS COL4) }“digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Nested Loop Join
FLATMAP (q2.ID AS ID3, q6.__ROW_VERSION AS VERSION4, q6.ID AS ID4, q2.COL2 AS COL2, q6.COL4 AS COL4)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID3, VERSION AS VERSION4, LONG AS ID4, LONG AS COL2, ARRAY(LONG) AS COL4)" ]; + 2 [ label=<
Index Scan
range: <-∞, ∞>
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, VERSION AS __ROW_VERSION)" ]; + 3 [ label=<
Index
T3_VERSION_WITH_COL1
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, VERSION AS __ROW_VERSION)" ]; + 4 [ label=<
Predicate Filter
WHERE q2.COL1 EQUALS promote(@c36 AS STRING)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, LONG AS COL3, ARRAY(LONG) AS COL4, VERSION AS __ROW_VERSION)" ]; + 5 [ label=<
Predicate Filter
WHERE q6.COL1 EQUALS promote(@c36 AS STRING)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, LONG AS COL3, ARRAY(LONG) AS COL4, VERSION AS __ROW_VERSION)" ]; + 6 [ label=<
Index Scan
comparisons: [EQUALS q2.COL2, EQUALS promote(@c64 AS LONG)]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, LONG AS COL3, ARRAY(LONG) AS COL4, VERSION AS __ROW_VERSION)" ]; + 7 [ label=<
Index
T4_COL2_COL4
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, LONG AS COL3, ARRAY(LONG) AS COL4, VERSION AS __ROW_VERSION)" ]; + 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=< 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" ]; + 4 -> 1 [ label=< q6> label="q6" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + { + rank=same; + rankDir=LR; + 2 -> 4 [ color="red" style="invis" ]; + } +}‹ +Ñ + unnamed-2ÃEXPLAIN select a.version AS version3, a.r.id AS id3, b.version AS version4, b.r.id AS id4, a.r.col2, b.r.col4 from t3_by_col1('b') a, t4_by_col1('b') b where 2 in b.r.col4 and b.r.col2 = a.r.col2´ +Ò&¯ÊçÍ· ŽÛ­>(°0…¡Å8¥@;ÓISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q0 -> { ISCAN(T4_COL2 [EQUALS q0.COL2]) | FILTER q0.COL1 EQUALS promote(@c44 AS STRING) AND _.COL1 EQUALS promote(@c44 AS STRING) AND promote(@c54 AS LONG) IN _.COL4 AS q1 RETURN (version([q0]) AS VERSION3, q0.ID AS ID3, version([q1]) AS VERSION4, q1.ID AS ID4, q0.COL2 AS COL2, q1.COL4 AS COL4) }»digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Nested Loop Join
FLATMAP (version([q12]) AS VERSION3, q12.ID AS ID3, version([q33]) AS VERSION4, q33.ID AS ID4, q12.COL2 AS COL2, q33.COL4 AS COL4)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS VERSION3, LONG AS ID3, VERSION AS VERSION4, LONG AS ID4, LONG AS COL2, ARRAY(LONG) AS COL4)" ]; + 2 [ label=<
Index Scan
range: <-∞, ∞>
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2)" ]; + 3 [ label=<
Index
T3_VERSION_WITH_COL1
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2)" ]; + 4 [ label=<
Predicate Filter
WHERE q12.COL1 EQUALS promote(@c44 AS STRING) AND q33.COL1 EQUALS promote(@c44 AS STRING) AND promote(@c54 AS LONG) IN q33.COL4
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, LONG AS COL3, ARRAY(LONG) AS COL4)" ]; + 5 [ label=<
Index Scan
comparisons: [EQUALS q12.COL2]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, LONG AS COL3, ARRAY(LONG) AS COL4)" ]; + 6 [ label=<
Index
T4_COL2
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, LONG AS COL3, ARRAY(LONG) AS COL4)" ]; + 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q12> label="q12" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q33> label="q33" 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" ]; + 4 -> 1 [ label=< q33> label="q33" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + { + rank=same; + rankDir=LR; + 2 -> 4 [ color="red" style="invis" ]; + } +}ò +[ + unnamed-2NEXPLAIN select "__ROW_VERSION", id, col1, col3 from t4 where col3 in (1, 3, 5)’ +© ‹»å5 ´»ô(g0冘8Á@ ÇEXPLODE arrayDistinct(promote(@c14 AS ARRAY(LONG))) | FLATMAP q0 -> { ISCAN(T4_COL3_VERSION [EQUALS q0]) AS q1 RETURN (version([q1]) AS __ROW_VERSION, q1.ID AS ID, q1.COL1 AS COL1, q1.COL3 AS COL3) }§digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Nested Loop Join
FLATMAP (version([q2]) AS __ROW_VERSION, q2.ID AS ID, q2.COL1 AS COL1, q2.COL3 AS COL3)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS __ROW_VERSION, LONG AS ID, STRING AS COL1, LONG AS COL3)" ]; + 2 [ label=<
Value Computation
EXPLODE arrayDistinct(promote(@c14 AS ARRAY(LONG)))
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG)" ]; + 3 [ label=<
Index Scan
comparisons: [EQUALS q88]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, LONG AS COL3, ARRAY(LONG) AS COL4)" ]; + 4 [ label=<
Index
T4_COL3_VERSION
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, LONG AS COL3, ARRAY(LONG) AS COL4)" ]; + 2 -> 1 [ label=< q88> label="q88" color="gray20" style="solid" 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" ]; + 3 -> 1 [ label=< q2> label="q2" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + { + rank=same; + rankDir=LR; + 2 -> 3 [ color="red" style="invis" ]; + } +}Ï +i + unnamed-2\EXPLAIN select "__ROW_VERSION", id, col1, col3 from t4 where col3 in (1, 3, 5) order by col3á +æÅ—Ö„ ’ÄØ (G0Ýßx8b@¿[IN arrayDistinct(promote(@c14 AS ARRAY(LONG))) SORTED] | INJOIN q0 -> { ISCAN(T4_COL3_VERSION [EQUALS q0]) | MAP (version([_]) AS __ROW_VERSION, _.ID AS ID, _.COL1 AS COL1, _.COL3 AS COL3) }€digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Nested Loop Join
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(VERSION AS __ROW_VERSION, LONG AS ID, STRING AS COL1, LONG AS COL3)" ]; + 2 [ label=<
Value Computation
MAP (version([q2]) AS __ROW_VERSION, q2.ID AS ID, q2.COL1 AS COL1, q2.COL3 AS COL3)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS __ROW_VERSION, LONG AS ID, STRING AS COL1, LONG AS COL3)" ]; + 3 [ label=<
Index Scan
comparisons: [EQUALS q65]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, LONG AS COL3, ARRAY(LONG) AS COL4)" ]; + 4 [ label=<
Index
T4_COL3_VERSION
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, LONG AS COL3, ARRAY(LONG) AS COL4)" ]; + 5 [ label=<
Table Function
EXPLODE(arrayDistinct(promote(@c14 AS ARRAY(LONG))))
> color="black" shape="plain" style="filled" fillcolor="darkseagreen2" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS __ROW_VERSION, LONG AS ID, STRING AS COL1, LONG AS COL3)" ]; + 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" ]; + 5 -> 1 [ color="black" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ color="black" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + { + rank=same; + rankDir=LR; + 5 -> 2 [ color="red" style="invis" ]; + } +}¥ +ƒ + unnamed-2vEXPLAIN select "__ROW_VERSION", id, col1, col3 from t4 where col3 in (1, 3, 5) order by col3 asc, "__ROW_VERSION" descœ +ð‹¤ð· «Ó”(40…¼„8$@Ç[IN arrayDistinct(promote(@c14 AS ARRAY(LONG))) SORTED] | INJOIN q0 -> { ISCAN(T4_COL3_VERSION [EQUALS q0] REVERSE) | MAP (version([_]) AS __ROW_VERSION, _.ID AS ID, _.COL1 AS COL1, _.COL3 AS COL3) }²digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Nested Loop Join
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(VERSION AS __ROW_VERSION, LONG AS ID, STRING AS COL1, LONG AS COL3)" ]; + 2 [ label=<
Value Computation
MAP (version([q2]) AS __ROW_VERSION, q2.ID AS ID, q2.COL1 AS COL1, q2.COL3 AS COL3)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS __ROW_VERSION, LONG AS ID, STRING AS COL1, LONG AS COL3)" ]; + 3 [ label=<
Index Scan
comparisons: [EQUALS q49]
direction: reversed
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, LONG AS COL3, ARRAY(LONG) AS COL4)" ]; + 4 [ label=<
Index
T4_COL3_VERSION
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, LONG AS COL3, ARRAY(LONG) AS COL4)" ]; + 5 [ label=<
Table Function
EXPLODE(arrayDistinct(promote(@c14 AS ARRAY(LONG))))
> color="black" shape="plain" style="filled" fillcolor="darkseagreen2" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS __ROW_VERSION, LONG AS ID, STRING AS COL1, LONG AS COL3)" ]; + 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" ]; + 5 -> 1 [ color="black" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ color="black" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + { + rank=same; + rankDir=LR; + 5 -> 2 [ color="red" style="invis" ]; + } +}Å +\ + unnamed-2OEXPLAIN select (t2.*), (t3.*) from t2, t3 where t2.col2 = 'b' and t3.col1 = 'b'ä +³ò÷§ï Ũä (G0ªß°8€@ÞISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q0 -> { COVERING(T1_COL2 [EQUALS promote(@c22 AS STRING)] -> [COL2: KEY[0], ID: KEY[2]]) | FILTER q0.COL1 EQUALS promote(@c22 AS STRING) | FETCH AS q1 RETURN (q1 AS _0, q0 AS _1) }âdigraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Nested Loop Join
FLATMAP (q2 AS _0, q6 AS _1)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS COL2 AS _0, LONG AS ID, STRING AS COL1, LONG AS COL2 AS _1)" ]; + 2 [ label=<
Index Scan
range: <-∞, ∞>
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2)" ]; + 3 [ label=<
Index
T3_VERSION_WITH_COL1
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2)" ]; + 4 [ label=<
Fetch Records
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="12" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS COL2)" ]; + 5 [ label=<
Predicate Filter
WHERE q6.COL1 EQUALS promote(@c22 AS STRING)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS COL2)" ]; + 6 [ label=<
Covering Index Scan
comparisons: [EQUALS promote(@c22 AS STRING)]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS COL2)" ]; + 7 [ label=<
Index
T1_COL2
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING 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="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q145> label="q145" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q143> label="q143" 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=< q2> label="q2" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + { + rank=same; + rankDir=LR; + 2 -> 4 [ color="red" style="invis" ]; + } +}œ +ˆ + unnamed-2{EXPLAIN select (t2.*), (t3.*) from t2, t3 where t2.col2 = 'b' and t3.col1 = 'b' and t2."__ROW_VERSION" > t3."__ROW_VERSION"Ž +ê«Ëûù øÌ›(G0ï¾J8†@ÁISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q0 -> { ISCAN(T1_COL2 [EQUALS promote(@c22 AS STRING)]) | FILTER q0.COL1 EQUALS promote(@c22 AS STRING) AND _.__ROW_VERSION GREATER_THAN q0.__ROW_VERSION AS q1 RETURN ((q1.ID AS ID, q1.COL1 AS COL1, q1.COL2 AS COL2) AS _0, (q0.ID AS ID, q0.COL1 AS COL1, q0.COL2 AS COL2) AS _1) }ªdigraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Nested Loop Join
FLATMAP ((q2.ID AS ID, q2.COL1 AS COL1, q2.COL2 AS COL2) AS _0, (q6.ID AS ID, q6.COL1 AS COL1, q6.COL2 AS COL2) AS _1)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS COL2 AS _0, LONG AS ID, STRING AS COL1, LONG AS COL2 AS _1)" ]; + 2 [ label=<
Index Scan
range: <-∞, ∞>
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, VERSION AS __ROW_VERSION)" ]; + 3 [ label=<
Index
T3_VERSION_WITH_COL1
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, VERSION AS __ROW_VERSION)" ]; + 4 [ label=<
Predicate Filter
WHERE q6.COL1 EQUALS promote(@c22 AS STRING) AND q2.__ROW_VERSION GREATER_THAN q6.__ROW_VERSION
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS COL2, VERSION AS __ROW_VERSION)" ]; + 5 [ label=<
Index Scan
comparisons: [EQUALS promote(@c22 AS STRING)]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS COL2, VERSION AS __ROW_VERSION)" ]; + 6 [ label=<
Index
T1_COL2
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS COL2, VERSION AS __ROW_VERSION)" ]; + 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="solid" 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" ]; + 4 -> 1 [ label=< q2> label="q2" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + { + rank=same; + rankDir=LR; + 2 -> 4 [ color="red" style="invis" ]; + } +}þ +^ + unnamed-2QEXPLAIN select (A.*), (B.*) from t2_v(2) as A, t3_v(2) as B where A.col2 = B.col1› +Æ ¤¼ž‚§ êÚæD(\0²¥ÿ8µ@åISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q0 -> { ISCAN(T1_COL2 [EQUALS q0.COL1]) | FILTER _.COL1 EQUALS promote(@c16 AS LONG) AND q0.COL2 EQUALS promote(@c16 AS LONG) AS q1 RETURN ((version([q1]) AS __ROW_VERSION, q1.ID AS ID, q1.COL1 AS COL1, q1.COL2 AS COL2) AS _0, (version([q0]) AS __ROW_VERSION, q0.ID AS ID, q0.COL1 AS COL1, q0.COL2 AS COL2) AS _1) }‘digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Nested Loop Join
FLATMAP ((version([q12]) AS __ROW_VERSION, q12.ID AS ID, q12.COL1 AS COL1, q12.COL2 AS COL2) AS _0, (version([q33]) AS __ROW_VERSION, q33.ID AS ID, q33.COL1 AS COL1, q33.COL2 AS COL2) 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, STRING AS COL2 AS _0, VERSION AS __ROW_VERSION, LONG AS ID, STRING AS COL1, LONG AS COL2 AS _1)" ]; + 2 [ label=<
Index Scan
range: <-∞, ∞>
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2)" ]; + 3 [ label=<
Index
T3_VERSION_WITH_COL1
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2)" ]; + 4 [ label=<
Predicate Filter
WHERE q12.COL1 EQUALS promote(@c16 AS LONG) AND q33.COL2 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, STRING AS COL2)" ]; + 5 [ label=<
Index Scan
comparisons: [EQUALS q33.COL1]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS COL2)" ]; + 6 [ label=<
Index
T1_COL2
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS COL2)" ]; + 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q33> label="q33" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q12> label="q12" 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" ]; + 4 -> 1 [ label=< q12> label="q12" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + { + rank=same; + rankDir=LR; + 2 -> 4 [ color="red" style="invis" ]; + } +}Ä4 +— + unnamed-2‰EXPLAIN select (A.*) as A, (B.*) as B, (C.*) as C from t2_v(2) as A, t3_v(2) as B, t4_v(2) as C where A.col2 = B.col1 AND B.col1 = C.col1§3 +º7èïÕ[å ޱË(Œ0Ñ›É 8µ@KùISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q0 -> { ISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q1 -> { ISCAN(T1_COL2 [EQUALS q0.COL1]) | FILTER _.COL1 EQUALS promote(@c28 AS LONG) AND q1.COL2 EQUALS promote(@c28 AS LONG) AND q0.COL1 EQUALS q1.COL1 AS q2 RETURN (q2 AS _0, q1 AS _1) } | FILTER q0.COL2 EQUALS promote(@c28 AS LONG) AS q3 RETURN ((q3._0.__ROW_VERSION AS __ROW_VERSION, q3._0.ID AS ID, q3._0.COL1 AS COL1, q3._0.COL2 AS COL2) AS A, (q0.__ROW_VERSION AS __ROW_VERSION, q0.ID AS ID, q0.COL1 AS COL1, q0.COL2 AS COL2) AS B, (q3._1.__ROW_VERSION AS __ROW_VERSION, q3._1.ID AS ID, q3._1.COL1 AS COL1, q3._1.COL2 AS COL2) AS C) }‰.digraph G { + fontname=courier; + rankdir=BT; + splines=polyline; + 1 [ label=<
Nested Loop Join
FLATMAP ((q163._0.__ROW_VERSION AS __ROW_VERSION, q163._0.ID AS ID, q163._0.COL1 AS COL1, q163._0.COL2 AS COL2) AS A, (q33.__ROW_VERSION AS __ROW_VERSION, q33.ID AS ID, q33.COL1 AS COL1, q33.COL2 AS COL2) AS B, (q163._1.__ROW_VERSION AS __ROW_VERSION, q163._1.ID AS ID, q163._1.COL1 AS COL1, q163._1.COL2 AS COL2) AS C)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(VERSION AS __ROW_VERSION, LONG AS ID, LONG AS COL1, STRING AS COL2 AS A, VERSION AS __ROW_VERSION, LONG AS ID, STRING AS COL1, LONG AS COL2 AS B, VERSION AS __ROW_VERSION, LONG AS ID, STRING AS COL1, LONG AS COL2 AS C)" ]; + 2 [ label=<
Index Scan
range: <-∞, ∞>
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, VERSION AS __ROW_VERSION)" ]; + 3 [ label=<
Index
T3_VERSION_WITH_COL1
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, VERSION AS __ROW_VERSION)" ]; + 4 [ label=<
Predicate Filter
WHERE q33.COL2 EQUALS promote(@c28 AS LONG)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS COL2, VERSION AS __ROW_VERSION AS _0, LONG AS ID, STRING AS COL1, LONG AS COL2, VERSION AS __ROW_VERSION AS _1)" ]; + 5 [ label=<
Nested Loop Join
FLATMAP (q12 AS _0, q54 AS _1)
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS COL2, VERSION AS __ROW_VERSION AS _0, LONG AS ID, STRING AS COL1, LONG AS COL2, VERSION AS __ROW_VERSION AS _1)" ]; + 6 [ label=<
Index Scan
range: <-∞, ∞>
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, VERSION AS __ROW_VERSION)" ]; + 7 [ label=<
Predicate Filter
WHERE q12.COL1 EQUALS promote(@c28 AS LONG) AND q54.COL2 EQUALS promote(@c28 AS LONG) AND q33.COL1 EQUALS q54.COL1
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS COL2, VERSION AS __ROW_VERSION)" ]; + 8 [ label=<
Index
T3_VERSION_WITH_COL1
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, STRING AS COL1, LONG AS COL2, VERSION AS __ROW_VERSION)" ]; + 9 [ label=<
Index Scan
comparisons: [EQUALS q33.COL1]
> color="black" shape="plain" style="solid" fillcolor="black" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS COL2, VERSION AS __ROW_VERSION)" ]; + 10 [ label=<
Index
T1_COL2
> color="black" shape="plain" style="filled" fillcolor="lightblue" fontname="courier" fontsize="8" tooltip="RELATION(LONG AS ID, LONG AS COL1, STRING AS COL2, VERSION AS __ROW_VERSION)" ]; + 3 -> 2 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 2 -> 1 [ label=< q33> label="q33" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 5 -> 4 [ label=< q163> label="q163" color="gray20" style="bold" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 6 -> 5 [ label=< q54> label="q54" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 7 -> 5 [ label=< q12> label="q12" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 8 -> 6 [ color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + 9 -> 7 [ label=< q12> label="q12" 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" ]; + 4 -> 1 [ label=< q163> label="q163" color="gray20" style="solid" fontname="courier" fontsize="8" arrowhead="normal" arrowtail="none" dir="both" ]; + { + rank=same; + rankDir=LR; + 2 -> 4 [ color="red" style="invis" ]; + } + { + rank=same; + rankDir=LR; + 6 -> 7 [ color="red" style="invis" ]; + } } \ 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 51a31cf1f9..c4ae003c60 100644 --- a/yaml-tests/src/test/resources/versions-tests.metrics.yaml +++ b/yaml-tests/src/test/resources/versions-tests.metrics.yaml @@ -3,92 +3,116 @@ unnamed-2: 10; explain: ISCAN(I1 [EQUALS promote(@c14 AS LONG)]) | MAP (version([_]) AS VERSION, _.COL2 AS COL2) - task_count: 699 - task_total_time_ms: 35 - transform_count: 179 - transform_time_ms: 13 + task_count: 723 + task_total_time_ms: 68 + transform_count: 181 + transform_time_ms: 23 transform_yield_count: 58 - insert_time_ms: 1 - insert_new_count: 76 + insert_time_ms: 2 + insert_new_count: 79 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: 26 - transform_count: 130 - transform_time_ms: 9 - transform_yield_count: 59 - insert_time_ms: 0 - insert_new_count: 63 - insert_reused_count: 8 + explain: ISCAN(I1 [EQUALS promote(@c10 AS LONG)]) | MAP (_.ID AS ID, _.COL1 AS + COL1, _.COL2 AS COL2) + task_count: 723 + task_total_time_ms: 47 + transform_count: 180 + transform_time_ms: 16 + transform_yield_count: 58 + insert_time_ms: 3 + insert_new_count: 79 + insert_reused_count: 6 +- query: EXPLAIN select t1_v.* from t1_v(10); + explain: ISCAN(I1 [EQUALS promote(@c8 AS LONG)]) | MAP (version([_]) AS __ROW_VERSION, + _.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) + task_count: 875 + task_total_time_ms: 62 + transform_count: 210 + transform_time_ms: 27 + transform_yield_count: 71 + insert_time_ms: 4 + insert_new_count: 109 + insert_reused_count: 6 - 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: 23 - transform_count: 183 - transform_time_ms: 8 + task_count: 749 + task_total_time_ms: 63 + transform_count: 185 + transform_time_ms: 26 transform_yield_count: 60 - insert_time_ms: 1 - insert_new_count: 80 + insert_time_ms: 3 + insert_new_count: 83 insert_reused_count: 6 - query: EXPLAIN select s."__ROW_VERSION", s.col2 from (select "__ROW_VERSION", t1.col2 from t1 where col1 = 10) AS s; explain: ISCAN(I1 [EQUALS promote(@c22 AS LONG)]) | MAP (version([_]) AS __ROW_VERSION, _.COL2 AS COL2) - task_count: 725 - task_total_time_ms: 36 - transform_count: 183 - transform_time_ms: 13 + task_count: 749 + task_total_time_ms: 205 + transform_count: 185 + transform_time_ms: 125 transform_yield_count: 60 - insert_time_ms: 1 - insert_new_count: 80 + insert_time_ms: 9 + insert_new_count: 83 + insert_reused_count: 6 +- query: EXPLAIN select s.version, s.col2 from (select "__ROW_VERSION" as version, + t1_v.col2 as col2 from t1_v(10)) AS s; + explain: ISCAN(I1 [EQUALS promote(@c24 AS LONG)]) | MAP (version([_]) AS VERSION, + _.COL2 AS COL2) + task_count: 901 + task_total_time_ms: 55 + transform_count: 214 + transform_time_ms: 20 + transform_yield_count: 73 + insert_time_ms: 2 + insert_new_count: 113 insert_reused_count: 6 - query: EXPLAIN select "__ROW_VERSION" as version, t1.* from t1 where col1 = 20; 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: 32 - transform_count: 179 - transform_time_ms: 12 + task_count: 723 + task_total_time_ms: 206 + transform_count: 181 + transform_time_ms: 126 transform_yield_count: 58 - insert_time_ms: 1 - insert_new_count: 76 + insert_time_ms: 8 + insert_new_count: 79 insert_reused_count: 6 - query: EXPLAIN select "__ROW_VERSION" as version, (t1.*) from t1 where col1 = 20; explain: ISCAN(I1 [EQUALS promote(@c16 AS LONG)]) | MAP (version([_]) AS VERSION, _ AS _1) - task_count: 699 - task_total_time_ms: 36 - transform_count: 179 - transform_time_ms: 11 + task_count: 723 + task_total_time_ms: 53 + transform_count: 181 + transform_time_ms: 21 transform_yield_count: 58 - insert_time_ms: 1 - insert_new_count: 76 + insert_time_ms: 3 + insert_new_count: 79 insert_reused_count: 6 - query: EXPLAIN select "__ROW_VERSION", t1.* from t1 where col1 = 20; 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: 32 - transform_count: 179 - transform_time_ms: 12 + task_count: 723 + task_total_time_ms: 56 + transform_count: 181 + transform_time_ms: 23 transform_yield_count: 58 - insert_time_ms: 1 - insert_new_count: 76 + insert_time_ms: 2 + insert_new_count: 79 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: 33 - transform_count: 179 - transform_time_ms: 9 + task_count: 723 + task_total_time_ms: 27 + transform_count: 181 + transform_time_ms: 13 transform_yield_count: 58 - insert_time_ms: 1 - insert_new_count: 76 + insert_time_ms: 2 + insert_new_count: 79 insert_reused_count: 6 - query: EXPLAIN select "__ROW_VERSION", t1.id from t1 order by "__ROW_VERSION" ASC; @@ -126,6 +150,18 @@ unnamed-2: insert_time_ms: 0 insert_new_count: 33 insert_reused_count: 2 +- query: EXPLAIN select t1_v."__ROW_VERSION", t1_v.id from t1_v(20) order by "__ROW_VERSION" + ASC; + explain: ISCAN(GROUPED_VERSION_INDEX [EQUALS promote(@c12 AS LONG)]) | MAP (version([_]) + AS __ROW_VERSION, _.ID AS ID) + task_count: 503 + task_total_time_ms: 183 + transform_count: 130 + transform_time_ms: 115 + transform_yield_count: 52 + insert_time_ms: 9 + insert_new_count: 63 + insert_reused_count: 2 - query: EXPLAIN select "__ROW_VERSION", t1.id from t1 where col1 = 20 order by "__ROW_VERSION" DESC; explain: ISCAN(GROUPED_VERSION_INDEX [EQUALS promote(@c12 AS LONG)] REVERSE) | @@ -150,3 +186,220 @@ unnamed-2: insert_time_ms: 0 insert_new_count: 27 insert_reused_count: 1 +- query: EXPLAIN select "__ROW_VERSION", id, col1 from t4 where exists (select 1 + from t4.col4 where col4 = 3) + explain: ISCAN(T4_COL4_VERSION [EQUALS promote(@c21 AS LONG)]) | MAP (version([_]) + AS __ROW_VERSION, _.ID AS ID, _.COL1 AS COL1) + task_count: 707 + task_total_time_ms: 88 + transform_count: 217 + transform_time_ms: 38 + transform_yield_count: 64 + insert_time_ms: 2 + insert_new_count: 82 + insert_reused_count: 5 +- query: EXPLAIN select "__ROW_VERSION", id, col1 from t4 where 3 in t4.col4 + explain: ISCAN(T4_COL2 <,>) | FLATMAP q0 -> { EXPLODE arrayDistinct(q0.COL4) | + FILTER promote(@c10 AS LONG) EQUALS _ AS q1 RETURN (version([q0]) AS __ROW_VERSION, + q0.ID AS ID, q0.COL1 AS COL1) } + task_count: 694 + task_total_time_ms: 79 + transform_count: 195 + transform_time_ms: 27 + transform_yield_count: 53 + insert_time_ms: 3 + insert_new_count: 82 + insert_reused_count: 8 +- query: EXPLAIN select "__ROW_VERSION", id, col1 from t4 where exists (select 1 + from t4.col4 where col4 = 3) order by "__ROW_VERSION" desc + explain: ISCAN(T4_COL4_VERSION [EQUALS promote(@c21 AS LONG)] REVERSE) | MAP (version([_]) + AS __ROW_VERSION, _.ID AS ID, _.COL1 AS COL1) + task_count: 399 + task_total_time_ms: 21 + transform_count: 133 + transform_time_ms: 12 + transform_yield_count: 46 + insert_time_ms: 0 + insert_new_count: 29 + insert_reused_count: 2 +- query: EXPLAIN select t3."__ROW_VERSION" AS version3, t3.id AS id3, t4."__ROW_VERSION" + AS version4, t4.id AS id4, t3.col2, t4.col4 from t3, t4 where t3.col1 = 'b' + AND t4.col1 = 'b' AND t4.col2 = t3.col2 + explain: ISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q0 -> { ISCAN(T4_COL2 [EQUALS + q0.COL2]) | FILTER q0.COL1 EQUALS promote(@c42 AS STRING) AND _.COL1 EQUALS + promote(@c42 AS STRING) AS q1 RETURN (version([q0]) AS VERSION3, q0.ID AS + ID3, version([q1]) AS VERSION4, q1.ID AS ID4, q0.COL2 AS COL2, q1.COL4 AS + COL4) } + task_count: 1129 + task_total_time_ms: 45 + transform_count: 282 + transform_time_ms: 20 + transform_yield_count: 90 + insert_time_ms: 1 + insert_new_count: 161 + insert_reused_count: 9 +- query: EXPLAIN select t3."__ROW_VERSION" AS version3, t3.id AS id3, t4."__ROW_VERSION" + AS version4, t4.id AS id4, t3.col2, t4.col4 from t3, t4 where t3.col1 = 'b' + and t4.col1 = 'b' and t4.col2 = t3.col2 and exists (select 1 from t4.col4 + x where x = 2) + explain: ISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q0 -> { ISCAN(T4_COL2_COL4 + [EQUALS q0.COL2, EQUALS promote(@c70 AS LONG)]) | FILTER _.COL1 EQUALS promote(@c42 + AS STRING) | FILTER q0.COL1 EQUALS promote(@c42 AS STRING) AS q1 RETURN (q0.__ROW_VERSION + AS VERSION3, q0.ID AS ID3, q1.__ROW_VERSION AS VERSION4, q1.ID AS ID4, q0.COL2 + AS COL2, q1.COL4 AS COL4) } + task_count: 3329 + task_total_time_ms: 112 + transform_count: 1053 + transform_time_ms: 52 + transform_yield_count: 217 + insert_time_ms: 10 + insert_new_count: 508 + insert_reused_count: 41 +- query: EXPLAIN select t3.id AS id3, t4."__ROW_VERSION" AS version4, t4.id AS id4, + t3.col2, t4.col4 from t3, t4 where t3.col1 = 'b' and t4.col1 = 'b' and t4.col2 + = t3.col2 and exists (select 1 from t4.col4 x where x = 2) + explain: ISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q0 -> { ISCAN(T4_COL2_COL4 + [EQUALS q0.COL2, EQUALS promote(@c64 AS LONG)]) | FILTER _.COL1 EQUALS promote(@c36 + AS STRING) | FILTER q0.COL1 EQUALS promote(@c36 AS STRING) AS q1 RETURN (q0.ID + AS ID3, q1.__ROW_VERSION AS VERSION4, q1.ID AS ID4, q0.COL2 AS COL2, q1.COL4 + AS COL4) } + task_count: 3329 + task_total_time_ms: 106 + transform_count: 1053 + transform_time_ms: 49 + transform_yield_count: 217 + insert_time_ms: 9 + insert_new_count: 508 + insert_reused_count: 41 +- query: EXPLAIN select a.version AS version3, a.r.id AS id3, b.version AS version4, + b.r.id AS id4, a.r.col2, b.r.col4 from t3_by_col1('b') a, t4_by_col1('b') + b where 2 in b.r.col4 and b.r.col2 = a.r.col2 + explain: ISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q0 -> { ISCAN(T4_COL2 [EQUALS + q0.COL2]) | FILTER q0.COL1 EQUALS promote(@c44 AS STRING) AND _.COL1 EQUALS + promote(@c44 AS STRING) AND promote(@c54 AS LONG) IN _.COL4 AS q1 RETURN (version([q0]) + AS VERSION3, q0.ID AS ID3, version([q1]) AS VERSION4, q1.ID AS ID4, q0.COL2 + AS COL2, q1.COL4 AS COL4) } + task_count: 4946 + task_total_time_ms: 431 + transform_count: 1463 + transform_time_ms: 130 + transform_yield_count: 304 + insert_time_ms: 43 + insert_new_count: 805 + insert_reused_count: 59 +- query: EXPLAIN select "__ROW_VERSION", id, col1, col3 from t4 where col3 in (1, + 3, 5) + explain: EXPLODE arrayDistinct(promote(@c14 AS ARRAY(LONG))) | FLATMAP q0 -> { + ISCAN(T4_COL3_VERSION [EQUALS q0]) AS q1 RETURN (version([q1]) AS __ROW_VERSION, + q1.ID AS ID, q1.COL1 AS COL1, q1.COL3 AS COL3) } + task_count: 1449 + task_total_time_ms: 112 + transform_count: 397 + transform_time_ms: 35 + transform_yield_count: 103 + insert_time_ms: 6 + insert_new_count: 193 + insert_reused_count: 9 +- query: EXPLAIN select "__ROW_VERSION", id, col1, col3 from t4 where col3 in (1, + 3, 5) order by col3 + explain: '[IN arrayDistinct(promote(@c14 AS ARRAY(LONG))) SORTED] | INJOIN q0 + -> { ISCAN(T4_COL3_VERSION [EQUALS q0]) | MAP (version([_]) AS __ROW_VERSION, + _.ID AS ID, _.COL1 AS COL1, _.COL3 AS COL3) }' + task_count: 870 + task_total_time_ms: 60 + transform_count: 260 + transform_time_ms: 20 + transform_yield_count: 71 + insert_time_ms: 1 + insert_new_count: 98 + insert_reused_count: 2 +- query: EXPLAIN select "__ROW_VERSION", id, col1, col3 from t4 where col3 in (1, + 3, 5) order by col3 asc, "__ROW_VERSION" desc + explain: '[IN arrayDistinct(promote(@c14 AS ARRAY(LONG))) SORTED] | INJOIN q0 + -> { ISCAN(T4_COL3_VERSION [EQUALS q0] REVERSE) | MAP (version([_]) AS __ROW_VERSION, + _.ID AS ID, _.COL1 AS COL1, _.COL3 AS COL3) }' + task_count: 496 + task_total_time_ms: 62 + transform_count: 183 + transform_time_ms: 38 + transform_yield_count: 52 + insert_time_ms: 2 + insert_new_count: 36 + insert_reused_count: 1 +- query: EXPLAIN select (t2.*), (t3.*) from t2, t3 where t2.col2 = 'b' and t3.col1 + = 'b' + explain: 'ISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q0 -> { COVERING(T1_COL2 [EQUALS + promote(@c22 AS STRING)] -> [COL2: KEY[0], ID: KEY[2]]) | FILTER q0.COL1 EQUALS + promote(@c22 AS STRING) | FETCH AS q1 RETURN (q1 AS _0, q0 AS _1) }' + task_count: 947 + task_total_time_ms: 59 + transform_count: 239 + transform_time_ms: 24 + transform_yield_count: 71 + insert_time_ms: 2 + insert_new_count: 128 + insert_reused_count: 7 +- query: EXPLAIN select (t2.*), (t3.*) from t2, t3 where t2.col2 = 'b' and t3.col1 + = 'b' and t2."__ROW_VERSION" > t3."__ROW_VERSION" + explain: ISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q0 -> { ISCAN(T1_COL2 [EQUALS + promote(@c22 AS STRING)]) | FILTER q0.COL1 EQUALS promote(@c22 AS STRING) + AND _.__ROW_VERSION GREATER_THAN q0.__ROW_VERSION AS q1 RETURN ((q1.ID AS + ID, q1.COL1 AS COL1, q1.COL2 AS COL2) AS _0, (q0.ID AS ID, q0.COL1 AS COL1, + q0.COL2 AS COL2) AS _1) } + task_count: 1002 + task_total_time_ms: 18 + transform_count: 249 + transform_time_ms: 8 + transform_yield_count: 71 + insert_time_ms: 1 + insert_new_count: 134 + insert_reused_count: 7 +- query: EXPLAIN select (A.*), (B.*) from t2_v(2) as A, t3_v(2) as B where A.col2 + = B.col1 + explain: ISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q0 -> { ISCAN(T1_COL2 [EQUALS + q0.COL1]) | FILTER _.COL1 EQUALS promote(@c16 AS LONG) AND q0.COL2 EQUALS + promote(@c16 AS LONG) AS q1 RETURN ((version([q1]) AS __ROW_VERSION, q1.ID + AS ID, q1.COL1 AS COL1, q1.COL2 AS COL2) AS _0, (version([q0]) AS __ROW_VERSION, + q0.ID AS ID, q0.COL1 AS COL1, q0.COL2 AS COL2) AS _1) } + task_count: 1222 + task_total_time_ms: 273 + transform_count: 295 + transform_time_ms: 144 + transform_yield_count: 92 + insert_time_ms: 16 + insert_new_count: 181 + insert_reused_count: 7 +- query: EXPLAIN select (A.*), (B.*) from t2_v(2) as A, t3_v(2) as B where A.col2 + = B.col1 + explain: ISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q0 -> { ISCAN(T1_COL2 [EQUALS + q0.COL1]) | FILTER _.COL1 EQUALS promote(@c16 AS LONG) AND q0.COL2 EQUALS + promote(@c16 AS LONG) AS q1 RETURN ((version([q1]) AS __ROW_VERSION, q1.ID + AS ID, q1.COL1 AS COL1, q1.COL2 AS COL2) AS _0, (version([q0]) AS __ROW_VERSION, + q0.ID AS ID, q0.COL1 AS COL1, q0.COL2 AS COL2) AS _1) } + task_count: 1222 + task_total_time_ms: 273 + transform_count: 295 + transform_time_ms: 144 + transform_yield_count: 92 + insert_time_ms: 16 + insert_new_count: 181 + insert_reused_count: 7 +- query: EXPLAIN select (A.*) as A, (B.*) as B, (C.*) as C from t2_v(2) as A, t3_v(2) + as B, t4_v(2) as C where A.col2 = B.col1 AND B.col1 = C.col1 + explain: ISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q0 -> { ISCAN(T3_VERSION_WITH_COL1 + <,>) | FLATMAP q1 -> { ISCAN(T1_COL2 [EQUALS q0.COL1]) | FILTER _.COL1 EQUALS + promote(@c28 AS LONG) AND q1.COL2 EQUALS promote(@c28 AS LONG) AND q0.COL1 + EQUALS q1.COL1 AS q2 RETURN (q2 AS _0, q1 AS _1) } | FILTER q0.COL2 EQUALS + promote(@c28 AS LONG) AS q3 RETURN ((q3._0.__ROW_VERSION AS __ROW_VERSION, + q3._0.ID AS ID, q3._0.COL1 AS COL1, q3._0.COL2 AS COL2) AS A, (q0.__ROW_VERSION + AS __ROW_VERSION, q0.ID AS ID, q0.COL1 AS COL1, q0.COL2 AS COL2) AS B, (q3._1.__ROW_VERSION + AS __ROW_VERSION, q3._1.ID AS ID, q3._1.COL1 AS COL1, q3._1.COL2 AS COL2) + AS C) } + task_count: 7098 + task_total_time_ms: 192 + transform_count: 2149 + transform_time_ms: 64 + transform_yield_count: 396 + insert_time_ms: 20 + insert_new_count: 1077 + insert_reused_count: 75 diff --git a/yaml-tests/src/test/resources/versions-tests.yamsql b/yaml-tests/src/test/resources/versions-tests.yamsql index 9ce1d6a220..5357fb7abc 100644 --- a/yaml-tests/src/test/resources/versions-tests.yamsql +++ b/yaml-tests/src/test/resources/versions-tests.yamsql @@ -21,14 +21,35 @@ schema_template: create table t1(id bigint, col1 bigint, col2 bigint, primary key(id)) create index i1 as select col1 from t1 - create index version_index as select "__ROW_VERSION" from t1 + create index t1_version_index as select "__ROW_VERSION" from t1 create index grouped_version_index as select col1, "__ROW_VERSION" from t1 order by col1, "__ROW_VERSION" + + create table t2(id bigint, col1 bigint, col2 string, primary key (id)) + create index t1_col2 as select col2 from t2 + + create table t3(id bigint, col1 string, col2 bigint, primary key (id)) + create index t3_version_with_col1 as select "__ROW_VERSION", col1 from t3 order by "__ROW_VERSION" + + create table t4(id bigint, col1 string, col2 bigint, col3 bigint, col4 bigint array, primary key (id)) + create index t4_col2 as select col2 from t4 + create index t4_col2_col4 as select col2, col4 from t4 order by col2, col4 + create index t4_col3_version as select col3, "__ROW_VERSION" from t4 order by col3, "__ROW_VERSION" + create index t4_col4_version as select col4, "__ROW_VERSION" from t4 order by col4, "__ROW_VERSION" + + create function t1_v(in x bigint) as select "__ROW_VERSION", id, col1, col2 from t1 where col1 = x + create function t2_v(in x bigint) as select "__ROW_VERSION", id, col1, col2 from t2 where col1 = x + create function t3_v(in x bigint) as select "__ROW_VERSION", id, col1, col2 from t3 where col2 = x + create function t4_v(in x bigint) as select "__ROW_VERSION", id, col1, col2 from t3 where col2 = x + + create function t3_by_col1(in x string) as select "__ROW_VERSION" AS version, (t3.*) as r from t3 where t3.col1 = x + create function t4_by_col1(in x string) as select "__ROW_VERSION" AS version, (t4.*) as r from t4 where t4.col1 = x + with options (store_row_versions=true) --- setup: steps: # Insert the odd rows first - - query: INSERT INTO T1 VALUES + - query: INSERT INTO T1(ID, COL1, COL2) VALUES (1, 10, 1), (3, 10, 3), (5, 10, 5), @@ -36,67 +57,139 @@ setup: (9, 20, 9), (11, 20, 11), (13, 20, 13) + - query: INSERT INTO T2(ID, COL1, COL2) VALUES + (1, 1, 'a'), + (3, 1, 'b'), + (5, 1, 'a'), + (7, 3, 'b'), + (9, 3, 'a'), + (11, 3, 'b'), + (13, 3, 'a') + - query: INSERT INTO T3(ID, COL1, COL2) VALUES + (1, 'a', 1), + (3, 'b', 1), + (5, 'a', 1), + (7, 'b', 3), + (9, 'a', 3), + (11, 'b', 3), + (13, 'a', 3) + - query: INSERT INTO T4(ID, COL1, COL2, COL3, COL4) VALUES + ( 1, 'a', 1, 10, [ ]), + ( 3, 'b', 1, 9, [ 1 ]), + ( 5, 'a', 2, 8, [ 2 ]), + ( 7, 'b', 2, 7, [ 1, 2 ]), + ( 9, 'a', 3, 6, [ 3 ]), + (11, 'b', 3, 5, [ 1, 3 ]), + (13, 'a', 1, 4, [ 2, 3 ]), + (15, 'b', 1, 3, [ 1, 2, 3 ]), + (17, 'a', 2, 2, [ 4 ]), + (19, 'b', 2, 1, [ 1, 4 ]), + (21, 'a', 3, 0, [ 2, 4 ]) # Then insert the even rows so that they are given higher row versions - - query: INSERT INTO T1 VALUES + - query: INSERT INTO T1(ID, COL1, COL2) VALUES (2, 10, 2), (4, 10, 4), (6, 20, 6), (8, 20, 8), (10, 20, 10), (12, 20, 12) + - query: INSERT INTO T2(ID, COL1, COL2) VALUES + (2, 2, 'a'), + (4, 2, 'b'), + (6, 2, 'a'), + (8, 4, 'b'), + (10, 4, 'a'), + (12, 4, 'b'), + (14, 4, 'a') + - query: INSERT INTO T3(ID, COL1, COL2) VALUES + (2, 'a', 2), + (4, 'b', 2), + (6, 'a', 2), + (8, 'b', 4), + (10, 'a', 4), + (12, 'b', 4), + (14, 'a', 4) + - query: INSERT INTO T4(ID, COL1, COL2, COL3, COL4) VALUES + ( 2, 'a', 1, 10, [ 1, 2, 4 ]), + ( 4, 'b', 1, 9, [ 3, 4 ]), + ( 6, 'a', 2, 8, [ 1, 3, 4 ]), + ( 8, 'b', 2, 7, [ 2, 3, 4 ]), + (10, 'a', 3, 6, [ 1, 2, 3, 4 ]), + (12, 'b', 3, 5, [ 5 ]), + (14, 'a', 1, 4, [ 1, 5 ]), + (16, 'b', 1, 3, [ 2, 5 ]), + (18, 'a', 2, 2, [ 1, 2, 5 ]), + (20, 'b', 2, 1, [ 3, 5 ]), + (22, 'a', 3, 0, [ 1, 3, 5 ]) --- test_block: + preset: single_repetition_ordered tests: - - query: select "__ROW_VERSION" as version, t1.col2 from t1 where col1 = 10; - - explain: "ISCAN(I1 [EQUALS promote(@c14 AS LONG)]) | MAP (version([_]) AS VERSION, _.COL2 AS COL2)" + - explain: "ISCAN(I1 [EQUALS promote(@c14 AS LONG)]) | MAP (_.__ROW_VERSION AS VERSION, _.COL2 AS COL2)" - result: [{VERSION: !not_null _, COL2: 1}, {VERSION: !not_null _, COL2: 2}, {VERSION: !not_null _, COL2: 3}, {VERSION: !not_null _, COL2: 4}, {VERSION: !not_null _, COL2: 5}] - # 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)]) | MAP (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)" - 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}] + - + # Do include __ROW_VERSION (as a real column) when querying the table function + - query: select t1_v.* from t1_v(10); + - explain: "ISCAN(I1 [EQUALS promote(@c8 AS LONG)]) | MAP (_.__ROW_VERSION AS __ROW_VERSION, _.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)" + - result: [{'__ROW_VERSION': !not_null _, ID: 1, COL1: 10, COL2: 1}, {'__ROW_VERSION': !not_null _, ID: 2, COL1: 10, COL2: 2}, {'__ROW_VERSION': !not_null _, ID: 3, COL1: 10, COL2: 3}, {'__ROW_VERSION': !not_null _, ID: 4, COL1: 10, COL2: 4}, {'__ROW_VERSION': !not_null _, ID: 5, COL1: 10, COL2: 5}] - # Get version column from sub-select - query: 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)" + - explain: "ISCAN(I1 [EQUALS promote(@c26 AS LONG)]) | MAP (_.__ROW_VERSION AS VERSION, _.COL2 AS COL2)" - result: [{VERSION: !not_null _, COL2: 1}, {VERSION: !not_null _, COL2: 2}, {VERSION: !not_null _, COL2: 3}, {VERSION: !not_null _, COL2: 4}, {VERSION: !not_null _, COL2: 5}] - # In inner select, the pseudo-column is selected but not renamed. Then, in the outer select, the column is read and returned, and a new version(S) value is *not* created - query: select s."__ROW_VERSION", s.col2 from (select "__ROW_VERSION", t1.col2 from t1 where col1 = 10) AS s; - - explain: "ISCAN(I1 [EQUALS promote(@c22 AS LONG)]) | MAP (version([_]) AS __ROW_VERSION, _.COL2 AS COL2)" + - explain: "ISCAN(I1 [EQUALS promote(@c22 AS LONG)]) | MAP (_.__ROW_VERSION AS __ROW_VERSION, _.COL2 AS COL2)" - result: [{__ROW_VERSION: !not_null _, COL2: 1}, {__ROW_VERSION: !not_null _, COL2: 2}, {__ROW_VERSION: !not_null _, COL2: 3}, {__ROW_VERSION: !not_null _, COL2: 4}, {__ROW_VERSION: !not_null _, COL2: 5}] + - + # Get version column with subselect over a TVF + - query: select s.version, s.col2 from (select "__ROW_VERSION" as version, t1_v.col2 as col2 from t1_v(10)) AS s; + - explain: "ISCAN(I1 [EQUALS promote(@c24 AS LONG)]) | MAP (_.__ROW_VERSION AS VERSION, _.COL2 AS COL2)" + - result: [{VERSION: !not_null _, COL2: 1}, {VERSION: !not_null _, COL2: 2}, {VERSION: !not_null _, COL2: 3}, {VERSION: !not_null _, COL2: 4}, {VERSION: !not_null _, COL2: 5}] - - query: select "__ROW_VERSION" as version, t1.* from t1 where col1 = 20; - - explain: "ISCAN(I1 [EQUALS promote(@c14 AS LONG)]) | MAP (version([_]) AS VERSION, _.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)" + - explain: "ISCAN(I1 [EQUALS promote(@c14 AS LONG)]) | MAP (_.__ROW_VERSION AS VERSION, _.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)" - result: [{VERSION: !not_null _, ID: 6, COL1: 20, COL2: 6}, {VERSION: !not_null _, ID: 7, COL1: 20, COL2: 7}, {VERSION: !not_null _, ID: 8, COL1: 20, COL2: 8}, {VERSION: !not_null _, ID: 9, COL1: 20, COL2: 9}, {VERSION: !not_null _, ID: 10, COL1: 20, COL2: 10}, {VERSION: !not_null _, ID: 11, COL1: 20, COL2: 11}, {VERSION: !not_null _, ID: 12, COL1: 20, COL2: 12}, {VERSION: !not_null _, ID: 13, COL1: 20, COL2: 13}] - - query: select "__ROW_VERSION" as version, (t1.*) from t1 where col1 = 20; - - explain: "ISCAN(I1 [EQUALS promote(@c16 AS LONG)]) | MAP (version([_]) AS VERSION, _ AS _1)" + - explain: "ISCAN(I1 [EQUALS promote(@c16 AS LONG)]) | MAP (_.__ROW_VERSION AS VERSION, (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) AS _1)" - result: [{VERSION: !not_null _, {ID: 6, COL1: 20, COL2: 6}}, {VERSION: !not_null _, {ID: 7, COL1: 20, COL2: 7}}, {VERSION: !not_null _, {ID: 8, COL1: 20, COL2: 8}}, {VERSION: !not_null _, {ID: 9, COL1: 20, COL2: 9}}, {VERSION: !not_null _, {ID: 10, COL1: 20, COL2: 10}}, {VERSION: !not_null _, {ID: 11, COL1: 20, COL2: 11}}, {VERSION: !not_null _, {ID: 12, COL1: 20, COL2: 12}}, {VERSION: !not_null _, {ID: 13, COL1: 20, COL2: 13}}] - - query: select "__ROW_VERSION", t1.* from t1 where col1 = 20; - - explain: "ISCAN(I1 [EQUALS promote(@c12 AS LONG)]) | MAP (version([_]) AS __ROW_VERSION, _.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)" + - explain: "ISCAN(I1 [EQUALS promote(@c12 AS LONG)]) | MAP (_.__ROW_VERSION AS __ROW_VERSION, _.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2)" - result: [{__ROW_VERSION: !not_null _, ID: 6, COL1: 20, COL2: 6}, {__ROW_VERSION: !not_null _, ID: 7, COL1: 20, COL2: 7}, {__ROW_VERSION: !not_null _, ID: 8, COL1: 20, COL2: 8}, {__ROW_VERSION: !not_null _, ID: 9, COL1: 20, COL2: 9}, {__ROW_VERSION: !not_null _, ID: 10, COL1: 20, COL2: 10}, {__ROW_VERSION: !not_null _, ID: 11, COL1: 20, COL2: 11}, {__ROW_VERSION: !not_null _, ID: 12, COL1: 20, COL2: 12}, {__ROW_VERSION: !not_null _, ID: 13, COL1: 20, COL2: 13}] - - query: select "__ROW_VERSION", (t1.*) from t1 where col1 = 20; - - explain: "ISCAN(I1 [EQUALS promote(@c14 AS LONG)]) | MAP (version([_]) AS __ROW_VERSION, _ AS _1)" + - explain: "ISCAN(I1 [EQUALS promote(@c14 AS LONG)]) | MAP (_.__ROW_VERSION AS __ROW_VERSION, (_.ID AS ID, _.COL1 AS COL1, _.COL2 AS COL2) AS _1)" - result: [{__ROW_VERSION: !not_null _, {ID: 6, COL1: 20, COL2: 6}}, {__ROW_VERSION: !not_null _, {ID: 7, COL1: 20, COL2: 7}}, {__ROW_VERSION: !not_null _, {ID: 8, COL1: 20, COL2: 8}}, {__ROW_VERSION: !not_null _, {ID: 9, COL1: 20, COL2: 9}}, {__ROW_VERSION: !not_null _, {ID: 10, COL1: 20, COL2: 10}}, {__ROW_VERSION: !not_null _, {ID: 11, COL1: 20, COL2: 11}}, {__ROW_VERSION: !not_null _, {ID: 12, COL1: 20, COL2: 12}}, {__ROW_VERSION: !not_null _, {ID: 13, COL1: 20, COL2: 13}}] - - query: select "__ROW_VERSION", t1.id from t1 order by "__ROW_VERSION" ASC; - - explain: "ISCAN(VERSION_INDEX <,>) | MAP (version([_]) AS __ROW_VERSION, _.ID AS ID)" + - debugger: repl + - explain: "ISCAN(T1_VERSION_INDEX <,>) | MAP (_.__ROW_VERSION AS __ROW_VERSION, _.ID AS ID)" - result: [{__ROW_VERSION: !not_null _, ID: 1}, {__ROW_VERSION: !not_null _, ID: 3}, {__ROW_VERSION: !not_null _, ID: 5}, {__ROW_VERSION: !not_null _, ID: 7}, {__ROW_VERSION: !not_null _, ID: 9}, {__ROW_VERSION: !not_null _, ID: 11}, {__ROW_VERSION: !not_null _, ID: 13}, {__ROW_VERSION: !not_null _, ID: 2}, {__ROW_VERSION: !not_null _, ID: 4}, {__ROW_VERSION: !not_null _, ID: 6}, {__ROW_VERSION: !not_null _, ID: 8}, {__ROW_VERSION: !not_null _, ID: 10}, {__ROW_VERSION: !not_null _, ID: 12}] - - query: select t1."__ROW_VERSION", t1.id from t1 order by "__ROW_VERSION" DESC; - - explain: "ISCAN(VERSION_INDEX <,> REVERSE) | MAP (version([_]) AS __ROW_VERSION, _.ID AS ID)" + - explain: "ISCAN(T1_VERSION_INDEX <,> REVERSE) | MAP (_.__ROW_VERSION AS __ROW_VERSION, _.ID AS ID)" - result: [{__ROW_VERSION: !not_null _, ID: 12}, {__ROW_VERSION: !not_null _, ID: 10}, {__ROW_VERSION: !not_null _, ID: 8}, {__ROW_VERSION: !not_null _, ID: 6}, {__ROW_VERSION: !not_null _, ID: 4}, {__ROW_VERSION: !not_null _, ID: 2}, {__ROW_VERSION: !not_null _, ID: 13}, {__ROW_VERSION: !not_null _, ID: 11}, {__ROW_VERSION: !not_null _, ID: 9}, {__ROW_VERSION: !not_null _, ID: 7}, {__ROW_VERSION: !not_null _, ID: 5}, {__ROW_VERSION: !not_null _, ID: 3}, {__ROW_VERSION: !not_null _, ID: 1}] - - query: select t1."__ROW_VERSION", t1.id from t1 where col1 = 20 order by "__ROW_VERSION" ASC; - - explain: "ISCAN(GROUPED_VERSION_INDEX [EQUALS promote(@c14 AS LONG)]) | MAP (version([_]) AS __ROW_VERSION, _.ID AS ID)" + - explain: "ISCAN(GROUPED_VERSION_INDEX [EQUALS promote(@c14 AS LONG)]) | MAP (_.__ROW_VERSION AS __ROW_VERSION, _.ID AS ID)" + - result: [{__ROW_VERSION: !not_null _, ID: 7}, {__ROW_VERSION: !not_null _, ID: 9}, {__ROW_VERSION: !not_null _, ID: 11}, {__ROW_VERSION: !not_null _, ID: 13}, {__ROW_VERSION: !not_null _, ID: 6}, {__ROW_VERSION: !not_null _, ID: 8}, {__ROW_VERSION: !not_null _, ID: 10}, {__ROW_VERSION: !not_null _, ID: 12}] + - + - query: select t1_v."__ROW_VERSION", t1_v.id from t1_v(20) order by "__ROW_VERSION" ASC; + - explain: "ISCAN(GROUPED_VERSION_INDEX [EQUALS promote(@c12 AS LONG)]) | MAP (_.__ROW_VERSION AS __ROW_VERSION, _.ID AS ID)" - result: [{__ROW_VERSION: !not_null _, ID: 7}, {__ROW_VERSION: !not_null _, ID: 9}, {__ROW_VERSION: !not_null _, ID: 11}, {__ROW_VERSION: !not_null _, ID: 13}, {__ROW_VERSION: !not_null _, ID: 6}, {__ROW_VERSION: !not_null _, ID: 8}, {__ROW_VERSION: !not_null _, ID: 10}, {__ROW_VERSION: !not_null _, ID: 12}] - - query: select "__ROW_VERSION", t1.id from t1 where col1 = 20 order by "__ROW_VERSION" DESC; - - explain: "ISCAN(GROUPED_VERSION_INDEX [EQUALS promote(@c12 AS LONG)] REVERSE) | MAP (version([_]) AS __ROW_VERSION, _.ID AS ID)" + - explain: "ISCAN(GROUPED_VERSION_INDEX [EQUALS promote(@c12 AS LONG)] REVERSE) | MAP (_.__ROW_VERSION AS __ROW_VERSION, _.ID AS ID)" - result: [{__ROW_VERSION: !not_null _, ID: 12}, {__ROW_VERSION: !not_null _, ID: 10}, {__ROW_VERSION: !not_null _, ID: 8}, {__ROW_VERSION: !not_null _, ID: 6}, {__ROW_VERSION: !not_null _, ID: 13}, {__ROW_VERSION: !not_null _, ID: 11}, {__ROW_VERSION: !not_null _, ID: 9}, {__ROW_VERSION: !not_null _, ID: 7}] - - query: select t1."__ROW_VERSION", t1.id from t1 where col1 = 20 order by t1."__ROW_VERSION" ASC; @@ -110,11 +203,285 @@ test_block: # - result: [{__ROW_VERSION: !not_null _, COL1: 10, ID: 1}, {__ROW_VERSION: !not_null _, COL1: 10, ID: 3}, {__ROW_VERSION: !not_null _, COL1: 10, ID: 5}, {__ROW_VERSION: !not_null _, COL1: 10, ID: 2}, {__ROW_VERSION: !not_null _, COL1: 10, ID: 4}] - - query: select "__ROW_VERSION", col1, t1.id from t1 where col1 > 10 order by col1 asc, "__ROW_VERSION" asc; - - explain: "ISCAN(GROUPED_VERSION_INDEX [[GREATER_THAN promote(@c14 AS LONG)]]) | MAP (version([_]) AS __ROW_VERSION, _.COL1 AS COL1, _.ID AS ID)" + - explain: "ISCAN(GROUPED_VERSION_INDEX [[GREATER_THAN promote(@c14 AS LONG)]]) | MAP (_.__ROW_VERSION AS __ROW_VERSION, _.COL1 AS COL1, _.ID AS ID)" - result: [{__ROW_VERSION: !not_null _, COL1: 20, ID: 7}, {__ROW_VERSION: !not_null _, COL1: 20, ID: 9}, {__ROW_VERSION: !not_null _, COL1: 20, ID: 11}, {__ROW_VERSION: !not_null _, COL1: 20, ID: 13}, {__ROW_VERSION: !not_null _, COL1: 20, ID: 6}, {__ROW_VERSION: !not_null _, COL1: 20, ID: 8}, {__ROW_VERSION: !not_null _, COL1: 20, ID: 10}, {__ROW_VERSION: !not_null _, COL1: 20, ID: 12}] # - # - query: select "__ROW_VERSION", col1, t1.id from t1 where (col1 = 10 AND "__ROW_VERSION" > 'AAAAAAAAAAAAAAAA') OR col1 > 10 order by col1 asc, "__ROW_VERSION" asc; # # Should be able to execute as a single index scan. See: TODO (Combine scan ranges to execute certain OR queries with a single scan) # - explain: "map(Index(GROUPED_VERSION_INDEX ([10, Versionstamp(\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00 0)],>)[(version(T1) as __ROW_VERSION, $T1.COL1 as COL1, $T1.ID as ID)])" # - result: [{__ROW_VERSION: !not_null _, COL1: 10, ID: 1}, {__ROW_VERSION: !not_null _, COL1: 10, ID: 3}, {__ROW_VERSION: !not_null _, COL1: 10, ID: 5}, {__ROW_VERSION: !not_null _, COL1: 10, ID: 2}, {__ROW_VERSION: !not_null _, COL1: 10, ID: 4}, {__ROW_VERSION: !not_null _, COL1: 20, ID: 7}, {__ROW_VERSION: !not_null _, COL1: 20, ID: 9}, {__ROW_VERSION: !not_null _, COL1: 20, ID: 11}, {__ROW_VERSION: !not_null _, COL1: 20, ID: 13}, {__ROW_VERSION: !not_null _, COL1: 20, ID: 6}, {__ROW_VERSION: !not_null _, COL1: 20, ID: 8}, {__ROW_VERSION: !not_null _, COL1: 20, ID: 10}, {__ROW_VERSION: !not_null _, COL1: 20, ID: 12}] + - + - query: select "__ROW_VERSION", id, col1 + from t4 + where exists (select 1 from t4.col4 where col4 = 3) + - explain: "ISCAN(T4_COL4_VERSION [EQUALS promote(@c21 AS LONG)]) | MAP (_.__ROW_VERSION AS __ROW_VERSION, _.ID AS ID, _.COL1 AS COL1)" + - result: [ + {__ROW_VERSION: !not_null _, ID: 9, COL1: "a" }, + {__ROW_VERSION: !not_null _, ID: 11, COL1: "b" }, + {__ROW_VERSION: !not_null _, ID: 13, COL1: "a" }, + {__ROW_VERSION: !not_null _, ID: 15, COL1: "b" }, + {__ROW_VERSION: !not_null _, ID: 4, COL1: "b" }, + {__ROW_VERSION: !not_null _, ID: 6, COL1: "a" }, + {__ROW_VERSION: !not_null _, ID: 8, COL1: "b" }, + {__ROW_VERSION: !not_null _, ID: 10, COL1: "a" }, + {__ROW_VERSION: !not_null _, ID: 20, COL1: "b" }, + {__ROW_VERSION: !not_null _, ID: 22, COL1: "a" }, + ] + - + - query: select "__ROW_VERSION", id, col1 + from t4 + where 3 in t4.col4 + - explain: "ISCAN(T4_COL2 <,>) | FLATMAP q0 -> { EXPLODE arrayDistinct(q0.COL4) | FILTER promote(@c10 AS LONG) EQUALS _ AS q1 RETURN (q0.__ROW_VERSION AS __ROW_VERSION, q0.ID AS ID, q0.COL1 AS COL1) }" + - unorderedResult: [ + {__ROW_VERSION: !not_null _, ID: 9, COL1: "a" }, + {__ROW_VERSION: !not_null _, ID: 11, COL1: "b" }, + {__ROW_VERSION: !not_null _, ID: 13, COL1: "a" }, + {__ROW_VERSION: !not_null _, ID: 15, COL1: "b" }, + {__ROW_VERSION: !not_null _, ID: 4, COL1: "b" }, + {__ROW_VERSION: !not_null _, ID: 6, COL1: "a" }, + {__ROW_VERSION: !not_null _, ID: 8, COL1: "b" }, + {__ROW_VERSION: !not_null _, ID: 10, COL1: "a" }, + {__ROW_VERSION: !not_null _, ID: 20, COL1: "b" }, + {__ROW_VERSION: !not_null _, ID: 22, COL1: "a" }, + ] + - + - query: select "__ROW_VERSION", id, col1 + from t4 + where exists (select 1 from t4.col4 where col4 = 3) + order by "__ROW_VERSION" desc + - explain: "ISCAN(T4_COL4_VERSION [EQUALS promote(@c21 AS LONG)] REVERSE) | MAP (_.__ROW_VERSION AS __ROW_VERSION, _.ID AS ID, _.COL1 AS COL1)" + - result: [ + {__ROW_VERSION: !not_null _, ID: 22, COL1: "a" }, + {__ROW_VERSION: !not_null _, ID: 20, COL1: "b" }, + {__ROW_VERSION: !not_null _, ID: 10, COL1: "a" }, + {__ROW_VERSION: !not_null _, ID: 8, COL1: "b" }, + {__ROW_VERSION: !not_null _, ID: 6, COL1: "a" }, + {__ROW_VERSION: !not_null _, ID: 4, COL1: "b" }, + {__ROW_VERSION: !not_null _, ID: 15, COL1: "b" }, + {__ROW_VERSION: !not_null _, ID: 13, COL1: "a" }, + {__ROW_VERSION: !not_null _, ID: 11, COL1: "b" }, + {__ROW_VERSION: !not_null _, ID: 9, COL1: "a" }, + ] + # - + # # Project the array field as part of a join, projecting the version out of both join constituents + # - query: select t2."__ROW_VERSION" AS version2, t2.id AS id2, t4."__ROW_VERSION" AS version4, t4.id AS id4, t2.col1, t4.col4 + # from t2, t4 + # where t2.col2 = 'b' AND t4.col1 = 'b' AND t2.col1 = t4.col2 + # - explain: "ISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q0 -> { ISCAN(T4_COL2 <,>) | FILTER q0.COL1 EQUALS promote(@c42 AS STRING) AND _.COL1 EQUALS promote(@c42 AS STRING) AND q0.COL2 EQUALS _.COL2 AS q1 RETURN (version([q0]) AS VERSION3, q0.ID AS ID3, version([q1]) AS VERSION4, q1.ID AS ID4, q0.COL2 AS COL2, q1.COL4 AS COL4) }" + # - result: [ + # { VERSION3: !not_null _, ID3: 3, VERSION4: !not_null _, ID4: 3, COL2: 1, COL4: [1] }, + # { VERSION3: !not_null _, ID3: 3, VERSION4: !not_null _, ID4: 4, COL2: 1, COL4: [3, 4] }, + # { VERSION3: !not_null _, ID3: 3, VERSION4: !not_null _, ID4: 15, COL2: 1, COL4: [1, 2, 3] }, + # { VERSION3: !not_null _, ID3: 3, VERSION4: !not_null _, ID4: 16, COL2: 1, COL4: [2, 5] }, + # { VERSION3: !not_null _, ID3: 7, VERSION4: !not_null _, ID4: 11, COL2: 3, COL4: [1, 3] }, + # { VERSION3: !not_null _, ID3: 7, VERSION4: !not_null _, ID4: 12, COL2: 3, COL4: [5] }, + # { VERSION3: !not_null _, ID3: 11, VERSION4: !not_null _, ID4: 11, COL2: 3, COL4: [1, 3] }, + # { VERSION3: !not_null _, ID3: 11, VERSION4: !not_null _, ID4: 12, COL2: 3, COL4: [5] }, + # { VERSION3: !not_null _, ID3: 4, VERSION4: !not_null _, ID4: 7, COL2: 2, COL4: [1, 2] }, + # { VERSION3: !not_null _, ID3: 4, VERSION4: !not_null _, ID4: 8, COL2: 2, COL4: [2, 3, 4] }, + # { VERSION3: !not_null _, ID3: 4, VERSION4: !not_null _, ID4: 19, COL2: 2, COL4: [1, 4] }, + # { VERSION3: !not_null _, ID3: 4, VERSION4: !not_null _, ID4: 20, COL2: 2, COL4: [3, 5] }, + # ] + - + # Project the array field as part of a join, projecting the version out of both join constituents + - query: select t3."__ROW_VERSION" AS version3, t3.id AS id3, t4."__ROW_VERSION" AS version4, t4.id AS id4, t3.col2, t4.col4 + from t3, t4 + where t3.col1 = 'b' AND t4.col1 = 'b' AND t4.col2 = t3.col2 + - explain: "ISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q0 -> { ISCAN(T4_COL2 [EQUALS q0.COL2]) | FILTER q0.COL1 EQUALS promote(@c42 AS STRING) AND _.COL1 EQUALS promote(@c42 AS STRING) AS q1 RETURN (q0.__ROW_VERSION AS VERSION3, q0.ID AS ID3, q1.__ROW_VERSION AS VERSION4, q1.ID AS ID4, q0.COL2 AS COL2, q1.COL4 AS COL4) }" + - result: [ + { VERSION3: !not_null _, ID3: 3, VERSION4: !not_null _, ID4: 3, COL2: 1, COL4: [1] }, + { VERSION3: !not_null _, ID3: 3, VERSION4: !not_null _, ID4: 4, COL2: 1, COL4: [3, 4] }, + { VERSION3: !not_null _, ID3: 3, VERSION4: !not_null _, ID4: 15, COL2: 1, COL4: [1, 2, 3] }, + { VERSION3: !not_null _, ID3: 3, VERSION4: !not_null _, ID4: 16, COL2: 1, COL4: [2, 5] }, + { VERSION3: !not_null _, ID3: 7, VERSION4: !not_null _, ID4: 11, COL2: 3, COL4: [1, 3] }, + { VERSION3: !not_null _, ID3: 7, VERSION4: !not_null _, ID4: 12, COL2: 3, COL4: [5] }, + { VERSION3: !not_null _, ID3: 11, VERSION4: !not_null _, ID4: 11, COL2: 3, COL4: [1, 3] }, + { VERSION3: !not_null _, ID3: 11, VERSION4: !not_null _, ID4: 12, COL2: 3, COL4: [5] }, + { VERSION3: !not_null _, ID3: 4, VERSION4: !not_null _, ID4: 7, COL2: 2, COL4: [1, 2] }, + { VERSION3: !not_null _, ID3: 4, VERSION4: !not_null _, ID4: 8, COL2: 2, COL4: [2, 3, 4] }, + { VERSION3: !not_null _, ID3: 4, VERSION4: !not_null _, ID4: 19, COL2: 2, COL4: [1, 4] }, + { VERSION3: !not_null _, ID3: 4, VERSION4: !not_null _, ID4: 20, COL2: 2, COL4: [3, 5] }, + ] + - + # Project the array field as part of a join, projecting the version out of both join constituents + - query: select t3."__ROW_VERSION" AS version3, t3.id AS id3, t4."__ROW_VERSION" AS version4, t4.id AS id4, t3.col2, t4.col4 + from t3, t4 + where t3.col1 = 'b' and t4.col1 = 'b' and t4.col2 = t3.col2 and exists (select 1 from t4.col4 x where x = 2) + - explain: "ISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q0 -> { ISCAN(T4_COL2_COL4 [EQUALS q0.COL2, EQUALS promote(@c70 AS LONG)]) | FILTER _.COL1 EQUALS promote(@c42 AS STRING) | FILTER q0.COL1 EQUALS promote(@c42 AS STRING) AS q1 RETURN (q0.__ROW_VERSION AS VERSION3, q0.ID AS ID3, q1.__ROW_VERSION AS VERSION4, q1.ID AS ID4, q0.COL2 AS COL2, q1.COL4 AS COL4) }" + - result: [ + { VERSION3: !not_null _, ID3: 3, VERSION4: !not_null _, ID4: 15, COL2: 1, COL4: [1, 2, 3] }, + { VERSION3: !not_null _, ID3: 3, VERSION4: !not_null _, ID4: 16, COL2: 1, COL4: [2, 5] }, + { VERSION3: !not_null _, ID3: 4, VERSION4: !not_null _, ID4: 7, COL2: 2, COL4: [1, 2] }, + { VERSION3: !not_null _, ID3: 4, VERSION4: !not_null _, ID4: 8, COL2: 2, COL4: [2, 3, 4] }, + ] + - + # Project the array field as part of a join, projecting the version out of both join constituents + - query: select t3.id AS id3, t4."__ROW_VERSION" AS version4, t4.id AS id4, t3.col2, t4.col4 + from t3, t4 + where t3.col1 = 'b' and t4.col1 = 'b' and t4.col2 = t3.col2 and exists (select 1 from t4.col4 x where x = 2) + - explain: "ISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q0 -> { ISCAN(T4_COL2_COL4 [EQUALS q0.COL2, EQUALS promote(@c64 AS LONG)]) | FILTER _.COL1 EQUALS promote(@c36 AS STRING) | FILTER q0.COL1 EQUALS promote(@c36 AS STRING) AS q1 RETURN (q0.ID AS ID3, q1.__ROW_VERSION AS VERSION4, q1.ID AS ID4, q0.COL2 AS COL2, q1.COL4 AS COL4) }" + - result: [ + { ID3: 3, VERSION4: !not_null _, ID4: 15, COL2: 1, COL4: [1, 2, 3] }, + { ID3: 3, VERSION4: !not_null _, ID4: 16, COL2: 1, COL4: [2, 5] }, + { ID3: 4, VERSION4: !not_null _, ID4: 7, COL2: 2, COL4: [1, 2] }, + { ID3: 4, VERSION4: !not_null _, ID4: 8, COL2: 2, COL4: [2, 3, 4] }, + ] + - + # Use TVFs but otherwise this behaves like the previous query + - query: select a.version AS version3, a.r.id AS id3, b.version AS version4, b.r.id AS id4, a.r.col2, b.r.col4 + from t3_by_col1('b') a, t4_by_col1('b') b + where 2 in b.r.col4 and b.r.col2 = a.r.col2 + - explain: "ISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q0 -> { ISCAN(T4_COL2 [EQUALS q0.COL2]) | FILTER q0.COL1 EQUALS promote(@c44 AS STRING) AND _.COL1 EQUALS promote(@c44 AS STRING) AND promote(@c54 AS LONG) IN _.COL4 AS q1 RETURN (q0.__ROW_VERSION AS VERSION3, q0.ID AS ID3, q1.__ROW_VERSION AS VERSION4, q1.ID AS ID4, q0.COL2 AS COL2, q1.COL4 AS COL4) }" + - result: [ + { VERSION3: !not_null _, ID3: 3, VERSION4: !not_null _, ID4: 15, COL2: 1, COL4: [1, 2, 3] }, + { VERSION3: !not_null _, ID3: 3, VERSION4: !not_null _, ID4: 16, COL2: 1, COL4: [2, 5] }, + { VERSION3: !not_null _, ID3: 4, VERSION4: !not_null _, ID4: 7, COL2: 2, COL4: [1, 2] }, + { VERSION3: !not_null _, ID3: 4, VERSION4: !not_null _, ID4: 8, COL2: 2, COL4: [2, 3, 4] }, + ] + - + - query: select "__ROW_VERSION", id, col1, col3 + from t4 + where col3 in (1, 3, 5) + - explain: "EXPLODE arrayDistinct(promote(@c14 AS ARRAY(LONG))) | FLATMAP q0 -> { ISCAN(T4_COL3_VERSION [EQUALS q0]) AS q1 RETURN (q1.__ROW_VERSION AS __ROW_VERSION, q1.ID AS ID, q1.COL1 AS COL1, q1.COL3 AS COL3) }" + - result: [ + {__ROW_VERSION: !not_null _, ID: 19, COL1: "b", COL3: 1 }, + {__ROW_VERSION: !not_null _, ID: 20, COL1: "b", COL3: 1 }, + {__ROW_VERSION: !not_null _, ID: 15, COL1: "b", COL3: 3 }, + {__ROW_VERSION: !not_null _, ID: 16, COL1: "b", COL3: 3 }, + {__ROW_VERSION: !not_null _, ID: 11, COL1: "b", COL3: 5 }, + {__ROW_VERSION: !not_null _, ID: 12, COL1: "b", COL3: 5 }, + ] + - + - query: select "__ROW_VERSION", id, col1, col3 + from t4 + where col3 in (1, 3, 5) + order by col3 + - explain: "[IN arrayDistinct(promote(@c14 AS ARRAY(LONG))) SORTED] | INJOIN q0 -> { ISCAN(T4_COL3_VERSION [EQUALS q0]) | MAP (_.__ROW_VERSION AS __ROW_VERSION, _.ID AS ID, _.COL1 AS COL1, _.COL3 AS COL3) }" + - result: [ + {__ROW_VERSION: !not_null _, ID: 19, COL1: "b", COL3: 1 }, + {__ROW_VERSION: !not_null _, ID: 20, COL1: "b", COL3: 1 }, + {__ROW_VERSION: !not_null _, ID: 15, COL1: "b", COL3: 3 }, + {__ROW_VERSION: !not_null _, ID: 16, COL1: "b", COL3: 3 }, + {__ROW_VERSION: !not_null _, ID: 11, COL1: "b", COL3: 5 }, + {__ROW_VERSION: !not_null _, ID: 12, COL1: "b", COL3: 5 }, + ] + - + - query: select "__ROW_VERSION", id, col1, col3 + from t4 + where col3 in (1, 3, 5) + order by col3 asc, "__ROW_VERSION" desc + - explain: "[IN arrayDistinct(promote(@c14 AS ARRAY(LONG))) SORTED] | INJOIN q0 -> { ISCAN(T4_COL3_VERSION [EQUALS q0] REVERSE) | MAP (_.__ROW_VERSION AS __ROW_VERSION, _.ID AS ID, _.COL1 AS COL1, _.COL3 AS COL3) }" + - result: [ + {__ROW_VERSION: !not_null _, ID: 20, COL1: "b", COL3: 1 }, + {__ROW_VERSION: !not_null _, ID: 19, COL1: "b", COL3: 1 }, + {__ROW_VERSION: !not_null _, ID: 16, COL1: "b", COL3: 3 }, + {__ROW_VERSION: !not_null _, ID: 15, COL1: "b", COL3: 3 }, + {__ROW_VERSION: !not_null _, ID: 12, COL1: "b", COL3: 5 }, + {__ROW_VERSION: !not_null _, ID: 11, COL1: "b", COL3: 5 }, + ] + - + - query: select (t2.*), (t3.*) + from t2, t3 + where t2.col2 = 'b' and t3.col1 = 'b' + # This plan is incorrect! The filter is seemingly including two predicates on the same version!!! + - explain: "ISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q0 -> { COVERING(T1_COL2 [EQUALS promote(@c22 AS STRING)] -> [COL2: KEY:[0], ID: KEY:[2]]) | FILTER q0.COL1 EQUALS promote(@c22 AS STRING) | FETCH AS q1 RETURN ((q1.ID AS ID, q1.COL1 AS COL1, q1.COL2 AS COL2) AS _0, (q0.ID AS ID, q0.COL1 AS COL1, q0.COL2 AS COL2) AS _1) }" + - result: [ + { { ID: 3, COL1: 1, COL2: 'b' }, { ID: 3, COL1: 'b', COL2: 1 } }, + { { ID: 4, COL1: 2, COL2: 'b' }, { ID: 3, COL1: 'b', COL2: 1 } }, + { { ID: 7, COL1: 3, COL2: 'b' }, { ID: 3, COL1: 'b', COL2: 1 } }, + { { ID: 8, COL1: 4, COL2: 'b' }, { ID: 3, COL1: 'b', COL2: 1 } }, + { { ID: 11, COL1: 3, COL2: 'b' }, { ID: 3, COL1: 'b', COL2: 1 } }, + { { ID: 12, COL1: 4, COL2: 'b' }, { ID: 3, COL1: 'b', COL2: 1 } }, + { { ID: 3, COL1: 1, COL2: 'b' }, { ID: 7, COL1: 'b', COL2: 3 } }, + { { ID: 4, COL1: 2, COL2: 'b' }, { ID: 7, COL1: 'b', COL2: 3 } }, + { { ID: 7, COL1: 3, COL2: 'b' }, { ID: 7, COL1: 'b', COL2: 3 } }, + { { ID: 8, COL1: 4, COL2: 'b' }, { ID: 7, COL1: 'b', COL2: 3 } }, + { { ID: 11, COL1: 3, COL2: 'b' }, { ID: 7, COL1: 'b', COL2: 3 } }, + { { ID: 12, COL1: 4, COL2: 'b' }, { ID: 7, COL1: 'b', COL2: 3 } }, + { { ID: 3, COL1: 1, COL2: 'b' }, { ID: 11, COL1: 'b', COL2: 3 } }, + { { ID: 4, COL1: 2, COL2: 'b' }, { ID: 11, COL1: 'b', COL2: 3 } }, + { { ID: 7, COL1: 3, COL2: 'b' }, { ID: 11, COL1: 'b', COL2: 3 } }, + { { ID: 8, COL1: 4, COL2: 'b' }, { ID: 11, COL1: 'b', COL2: 3 } }, + { { ID: 11, COL1: 3, COL2: 'b' }, { ID: 11, COL1: 'b', COL2: 3 } }, + { { ID: 12, COL1: 4, COL2: 'b' }, { ID: 11, COL1: 'b', COL2: 3 } }, + { { ID: 3, COL1: 1, COL2: 'b' }, { ID: 4, COL1: 'b', COL2: 2 } }, + { { ID: 4, COL1: 2, COL2: 'b' }, { ID: 4, COL1: 'b', COL2: 2 } }, + { { ID: 7, COL1: 3, COL2: 'b' }, { ID: 4, COL1: 'b', COL2: 2 } }, + { { ID: 8, COL1: 4, COL2: 'b' }, { ID: 4, COL1: 'b', COL2: 2 } }, + { { ID: 11, COL1: 3, COL2: 'b' }, { ID: 4, COL1: 'b', COL2: 2 } }, + { { ID: 12, COL1: 4, COL2: 'b' }, { ID: 4, COL1: 'b', COL2: 2 } }, + { { ID: 3, COL1: 1, COL2: 'b' }, { ID: 8, COL1: 'b', COL2: 4 } }, + { { ID: 4, COL1: 2, COL2: 'b' }, { ID: 8, COL1: 'b', COL2: 4 } }, + { { ID: 7, COL1: 3, COL2: 'b' }, { ID: 8, COL1: 'b', COL2: 4 } }, + { { ID: 8, COL1: 4, COL2: 'b' }, { ID: 8, COL1: 'b', COL2: 4 } }, + { { ID: 11, COL1: 3, COL2: 'b' }, { ID: 8, COL1: 'b', COL2: 4 } }, + { { ID: 12, COL1: 4, COL2: 'b' }, { ID: 8, COL1: 'b', COL2: 4 } }, + { { ID: 3, COL1: 1, COL2: 'b' }, { ID: 12, COL1: 'b', COL2: 4 } }, + { { ID: 4, COL1: 2, COL2: 'b' }, { ID: 12, COL1: 'b', COL2: 4 } }, + { { ID: 7, COL1: 3, COL2: 'b' }, { ID: 12, COL1: 'b', COL2: 4 } }, + { { ID: 8, COL1: 4, COL2: 'b' }, { ID: 12, COL1: 'b', COL2: 4 } }, + { { ID: 11, COL1: 3, COL2: 'b' }, { ID: 12, COL1: 'b', COL2: 4 } }, + { { ID: 12, COL1: 4, COL2: 'b' }, { ID: 12, COL1: 'b', COL2: 4 } }, + ] + - + - query: select (t2.*), (t3.*) + from t2, t3 + where t2.col2 = 'b' and t3.col1 = 'b' + and t2."__ROW_VERSION" > t3."__ROW_VERSION" + - explain: "ISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q0 -> { ISCAN(T1_COL2 [EQUALS promote(@c22 AS STRING)]) | FILTER q0.COL1 EQUALS promote(@c22 AS STRING) AND _.__ROW_VERSION GREATER_THAN q0.__ROW_VERSION AS q1 RETURN ((q1.ID AS ID, q1.COL1 AS COL1, q1.COL2 AS COL2) AS _0, (q0.ID AS ID, q0.COL1 AS COL1, q0.COL2 AS COL2) AS _1) }" + - result: [ + { { ID: 4, COL1: 2, COL2: 'b' }, {ID: 3, COL1: 'b', COL2: 1 } } , + { { ID: 8, COL1: 4, COL2: 'b' }, {ID: 3, COL1: 'b', COL2: 1 } } , + { { ID: 12, COL1: 4, COL2: 'b' }, {ID: 3, COL1: 'b', COL2: 1 } } , + { { ID: 4, COL1: 2, COL2: 'b' }, {ID: 7, COL1: 'b', COL2: 3 } } , + { { ID: 8, COL1: 4, COL2: 'b' }, {ID: 7, COL1: 'b', COL2: 3 } } , + { { ID: 12, COL1: 4, COL2: 'b' }, {ID: 7, COL1: 'b', COL2: 3 } } , + { { ID: 4, COL1: 2, COL2: 'b' }, {ID: 11, COL1: 'b', COL2: 3 } } , + { { ID: 8, COL1: 4, COL2: 'b' }, {ID: 11, COL1: 'b', COL2: 3 } } , + { { ID: 12, COL1: 4, COL2: 'b' }, {ID: 11, COL1: 'b', COL2: 3 } } , + ] + - + # Join two TVFs with row versions projected through + - query: select (A.*), (B.*) + from t2_v(2) as A, t3_v(2) as B + where A.col2 = B.col1 + - explain: "ISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q0 -> { ISCAN(T1_COL2 [EQUALS q0.COL1]) | FILTER _.COL1 EQUALS promote(@c16 AS LONG) AND q0.COL2 EQUALS promote(@c16 AS LONG) AS q1 RETURN ((q1.__ROW_VERSION AS __ROW_VERSION, q1.ID AS ID, q1.COL1 AS COL1, q1.COL2 AS COL2) AS _0, (q0.__ROW_VERSION AS __ROW_VERSION, q0.ID AS ID, q0.COL1 AS COL1, q0.COL2 AS COL2) AS _1) }" + - result: [ + { { '__ROW_VERSION': !not_null _, ID: 2, COL1: 2, COL2: 'a' }, { '__ROW_VERSION': !not_null _, ID: 2, COL1: 'a', COL2: 2 } }, + { { '__ROW_VERSION': !not_null _, ID: 6, COL1: 2, COL2: 'a' }, { '__ROW_VERSION': !not_null _, ID: 2, COL1: 'a', COL2: 2 } }, + { { '__ROW_VERSION': !not_null _, ID: 4, COL1: 2, COL2: 'b' }, { '__ROW_VERSION': !not_null _, ID: 4, COL1: 'b', COL2: 2 } }, + { { '__ROW_VERSION': !not_null _, ID: 2, COL1: 2, COL2: 'a' }, { '__ROW_VERSION': !not_null _, ID: 6, COL1: 'a', COL2: 2 } }, + { { '__ROW_VERSION': !not_null _, ID: 6, COL1: 2, COL2: 'a' }, { '__ROW_VERSION': !not_null _, ID: 6, COL1: 'a', COL2: 2 } }, + ] + - + # Join two TVFs with row versions projected through + - query: select (A.*), (B.*) + from t2_v(2) as A, t3_v(2) as B + where A.col2 = B.col1 + - explain: "ISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q0 -> { ISCAN(T1_COL2 [EQUALS q0.COL1]) | FILTER _.COL1 EQUALS promote(@c16 AS LONG) AND q0.COL2 EQUALS promote(@c16 AS LONG) AS q1 RETURN ((q1.__ROW_VERSION AS __ROW_VERSION, q1.ID AS ID, q1.COL1 AS COL1, q1.COL2 AS COL2) AS _0, (q0.__ROW_VERSION AS __ROW_VERSION, q0.ID AS ID, q0.COL1 AS COL1, q0.COL2 AS COL2) AS _1) }" + - result: [ + { { '__ROW_VERSION': !not_null _, ID: 2, COL1: 2, COL2: 'a' }, { '__ROW_VERSION': !not_null _, ID: 2, COL1: 'a', COL2: 2 } }, + { { '__ROW_VERSION': !not_null _, ID: 6, COL1: 2, COL2: 'a' }, { '__ROW_VERSION': !not_null _, ID: 2, COL1: 'a', COL2: 2 } }, + { { '__ROW_VERSION': !not_null _, ID: 4, COL1: 2, COL2: 'b' }, { '__ROW_VERSION': !not_null _, ID: 4, COL1: 'b', COL2: 2 } }, + { { '__ROW_VERSION': !not_null _, ID: 2, COL1: 2, COL2: 'a' }, { '__ROW_VERSION': !not_null _, ID: 6, COL1: 'a', COL2: 2 } }, + { { '__ROW_VERSION': !not_null _, ID: 6, COL1: 2, COL2: 'a' }, { '__ROW_VERSION': !not_null _, ID: 6, COL1: 'a', COL2: 2 } }, + ] + - + # Join three TVFs with row versions projected through + - query: select (A.*) as A, (B.*) as B, (C.*) as C + from t2_v(2) as A, t3_v(2) as B, t4_v(2) as C + where A.col2 = B.col1 AND B.col1 = C.col1 + # Throws an error while trying to partition the select: https://github.com/FoundationDB/fdb-record-layer/issues/3796 + - explain: "ISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q0 -> { ISCAN(T3_VERSION_WITH_COL1 <,>) | FLATMAP q1 -> { ISCAN(T1_COL2 [EQUALS q0.COL1]) | FILTER _.COL1 EQUALS promote(@c28 AS LONG) AND q1.COL2 EQUALS promote(@c28 AS LONG) AND q0.COL1 EQUALS q1.COL1 AS q2 RETURN (q2 AS _0, q1 AS _1) } | FILTER q0.COL2 EQUALS promote(@c28 AS LONG) AS q3 RETURN ((q3._0.__ROW_VERSION AS __ROW_VERSION, q3._0.ID AS ID, q3._0.COL1 AS COL1, q3._0.COL2 AS COL2) AS A, (q0.__ROW_VERSION AS __ROW_VERSION, q0.ID AS ID, q0.COL1 AS COL1, q0.COL2 AS COL2) AS B, (q3._1.__ROW_VERSION AS __ROW_VERSION, q3._1.ID AS ID, q3._1.COL1 AS COL1, q3._1.COL2 AS COL2) AS C) }" + - result: [ + { A: { '__ROW_VERSION': !not_null _, ID: 2, COL1: 2, COL2: 'a' }, B: { '__ROW_VERSION': !not_null _, ID: 2, COL1: 'a', COL2: 2 }, C: { '__ROW_VERSION': !not_null _, ID: 2, COL1: 'a', COL2: 2 } }, + { A: { '__ROW_VERSION': !not_null _, ID: 6, COL1: 2, COL2: 'a' }, B: { '__ROW_VERSION': !not_null _, ID: 2, COL1: 'a', COL2: 2 }, C: { '__ROW_VERSION': !not_null _, ID: 2, COL1: 'a', COL2: 2 } }, + { A: { '__ROW_VERSION': !not_null _, ID: 2, COL1: 2, COL2: 'a' }, B: { '__ROW_VERSION': !not_null _, ID: 2, COL1: 'a', COL2: 2 }, C: { '__ROW_VERSION': !not_null _, ID: 6, COL1: 'a', COL2: 2 } }, + { A: { '__ROW_VERSION': !not_null _, ID: 6, COL1: 2, COL2: 'a' }, B: { '__ROW_VERSION': !not_null _, ID: 2, COL1: 'a', COL2: 2 }, C: { '__ROW_VERSION': !not_null _, ID: 6, COL1: 'a', COL2: 2 } }, + { A: { '__ROW_VERSION': !not_null _, ID: 4, COL1: 2, COL2: 'b' }, B: { '__ROW_VERSION': !not_null _, ID: 4, COL1: 'b', COL2: 2 }, C: { '__ROW_VERSION': !not_null _, ID: 4, COL1: 'b', COL2: 2 } }, + { A: { '__ROW_VERSION': !not_null _, ID: 2, COL1: 2, COL2: 'a' }, B: { '__ROW_VERSION': !not_null _, ID: 6, COL1: 'a', COL2: 2 }, C: { '__ROW_VERSION': !not_null _, ID: 2, COL1: 'a', COL2: 2 } }, + { A: { '__ROW_VERSION': !not_null _, ID: 6, COL1: 2, COL2: 'a' }, B: { '__ROW_VERSION': !not_null _, ID: 6, COL1: 'a', COL2: 2 }, C: { '__ROW_VERSION': !not_null _, ID: 2, COL1: 'a', COL2: 2 } }, + { A: { '__ROW_VERSION': !not_null _, ID: 2, COL1: 2, COL2: 'a' }, B: { '__ROW_VERSION': !not_null _, ID: 6, COL1: 'a', COL2: 2 }, C: { '__ROW_VERSION': !not_null _, ID: 6, COL1: 'a', COL2: 2 } }, + { A: { '__ROW_VERSION': !not_null _, ID: 6, COL1: 2, COL2: 'a' }, B: { '__ROW_VERSION': !not_null _, ID: 6, COL1: 'a', COL2: 2 }, C: { '__ROW_VERSION': !not_null _, ID: 6, COL1: 'a', COL2: 2 } }, + ] ...