You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by AsterixDB Code Review <do...@asterix-gerrit.ics.uci.edu> on 2026/09/20 23:29:51 UTC
[L] Change in asterixdb[master]: [ASTERIXDB-3871][COMP] Size the vector search for a LIMIT's OFFSET
From Ali Alsuliman <al...@gmail.com>:
Ali Alsuliman has uploaded this change for review. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21855?usp=email )
Change subject: [ASTERIXDB-3871][COMP] Size the vector search for a LIMIT's OFFSET
......................................................................
[ASTERIXDB-3871][COMP] Size the vector search for a LIMIT's OFFSET
The top-k rule matched the outermost LIMIT and took its count as the
search's k. A LIMIT nested below it on the way to the ORDER BY was
walked through without a look, so a subquery's LIMIT 3 OFFSET 2 under
an outer LIMIT 3 got a search collecting 3 candidates where the OFFSET
needed 5 -- one row where three were due, hidden on a multi-partition
cluster by the per-partition caps merged above the search. A single
LIMIT with an OFFSET was refused the index outright for the same
reason.
The search is now sized from the LIMIT nearest the ORDER BY, its count
plus its offset. A LIMIT further out takes its rows from the one below
it and can only need fewer. The refusal goes with it.
Co-Authored-By: Claude Fable 5.1 <no...@anthropic.com>
Change-Id: Ic29dd3b13b9f7a098e0483a70ae11aa0bf2b004e
---
M asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/IntroduceTopKAccessMethodRule.java
M asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/VectorIndexAccessMethod.java
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.20.query.sqlpp
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.21.plans.sqlpp
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.22.query.sqlpp
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.23.plans.sqlpp
A asterixdb/asterix-app/src/test/resources/runtimets/results/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.20.adm
A asterixdb/asterix-app/src/test/resources/runtimets/results/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.21.plan
A asterixdb/asterix-app/src/test/resources/runtimets/results/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.22.adm
A asterixdb/asterix-app/src/test/resources/runtimets/results/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.23.plan
10 files changed, 237 insertions(+), 15 deletions(-)
git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/55/21855/1
diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/IntroduceTopKAccessMethodRule.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/IntroduceTopKAccessMethodRule.java
index f826c4a..af4ddbd 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/IntroduceTopKAccessMethodRule.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/IntroduceTopKAccessMethodRule.java
@@ -32,17 +32,20 @@
import org.apache.asterix.common.annotations.SkipSecondaryIndexSearchExpressionAnnotation;
import org.apache.asterix.common.config.DatasetConfig.IndexType;
import org.apache.asterix.common.vector.VectorSimilarityMetric;
+import org.apache.asterix.lang.common.util.FunctionUtil;
import org.apache.asterix.metadata.declared.IIndexProvider;
import org.apache.asterix.metadata.declared.MetadataProvider;
import org.apache.asterix.metadata.entities.Index;
import org.apache.asterix.metadata.utils.DatasetUtil;
import org.apache.asterix.metadata.utils.KeyFieldTypeUtil;
+import org.apache.asterix.om.functions.BuiltinFunctions;
import org.apache.asterix.om.types.ARecordType;
import org.apache.asterix.om.types.IAType;
import org.apache.asterix.om.utils.ConstantExpressionUtil;
import org.apache.asterix.optimizer.cost.VectorIndexGeometry;
import org.apache.asterix.optimizer.rules.VectorIncludeFilterPushdown;
import org.apache.commons.lang3.mutable.Mutable;
+import org.apache.commons.lang3.mutable.MutableObject;
import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.hyracks.algebricks.common.utils.Pair;
import org.apache.hyracks.algebricks.core.algebra.base.ILogicalExpression;
@@ -53,6 +56,7 @@
import org.apache.hyracks.algebricks.core.algebra.base.LogicalVariable;
import org.apache.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
import org.apache.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
+import org.apache.hyracks.algebricks.core.algebra.expressions.ScalarFunctionCallExpression;
import org.apache.hyracks.algebricks.core.algebra.expressions.VariableReferenceExpression;
import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import org.apache.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator;
@@ -116,6 +120,10 @@
// Operators representing the pattern to be matched
protected Mutable<ILogicalOperator> limitRef = null;
protected LimitOperator limitOp = null;
+ // The LIMIT nearest the ORDER BY, which decides how many ranked rows the plan needs: its count plus its
+ // offset. limitOp is the outermost, where the pattern was matched; a LIMIT further out takes rows from
+ // the one below it and so can only need fewer, never more.
+ protected LimitOperator innermostLimitOp = null;
protected Mutable<ILogicalOperator> orderRef = null;
protected OrderOperator orderOp = null;
protected AbstractFunctionCallExpression annDistanceExpr = null;
@@ -234,11 +242,9 @@
if (orderPair != null) {
orderRef = orderPair.first;
orderOp = orderPair.second;
- // Skip the index transform when the LIMIT carries an OFFSET: the vector search is sized
- // from k alone, so LIMIT k OFFSET o would skip into an undersized candidate pool and return
- // truncated/empty results. Fall through to the exact ORDER BY ... LIMIT plan, which honors
- // OFFSET correctly. (A future enhancement could size the search to (k + offset).)
- if (!limitOp.hasOffset() && matchesAnnDistancePattern()) {
+ // An OFFSET needs no refusal: the search is sized to count + offset of the LIMIT nearest the
+ // ORDER BY (see searchKExpression), so the rows the OFFSET skips are collected too.
+ if (matchesAnnDistancePattern()) {
return action.apply(context);
}
}
@@ -272,7 +278,9 @@
* - LIMIT: For distributed top-k optimization
*
* This method traverses through these intermediate operators until it finds
- * the ORDER operator or encounters an operator it doesn't recognize.
+ * the ORDER operator or encounters an operator it doesn't recognize. Each LIMIT it passes is recorded in
+ * {@link #innermostLimitOp}, so that the search is sized from the LIMIT nearest the ORDER BY: a nested
+ * {@code LIMIT k OFFSET o} needs k + o ranked rows however few the outer LIMIT keeps of them.
*
* @param limitOp The LIMIT operator to start from
* @return Pair of (orderRef, orderOp) if found, null otherwise
@@ -282,6 +290,7 @@
return null;
}
+ innermostLimitOp = limitOp;
Mutable<ILogicalOperator> currentRef = limitOp.getInputs().get(0);
AbstractLogicalOperator currentOp = (AbstractLogicalOperator) currentRef.getValue();
@@ -300,6 +309,9 @@
if (currentOp.getOperatorTag() == LogicalOperatorTag.ASSIGN
|| currentOp.getOperatorTag() == LogicalOperatorTag.EXCHANGE
|| currentOp.getOperatorTag() == LogicalOperatorTag.LIMIT) {
+ if (currentOp.getOperatorTag() == LogicalOperatorTag.LIMIT) {
+ innermostLimitOp = (LimitOperator) currentOp;
+ }
if (currentOp.getInputs().isEmpty()) {
// No more children to traverse
@@ -316,6 +328,27 @@
}
/**
+ * How many ranked rows the plan needs from the search, as the expression the search's k parameter is
+ * assigned from: the count of the LIMIT nearest the ORDER BY, plus its OFFSET when it has one. The
+ * search collects k * k_multiplier candidates and the OFFSET then discards the first o of the ranked
+ * rows, so a search sized from the count alone would leave the LIMIT short by o rows -- or, on one
+ * partition, empty. Non-constant counts and offsets are fine: the sum is evaluated at runtime.
+ */
+ @AiProvenance(agent = AiProvenance.Agent.CLAUDE_FABLE_5_1, tool = AiProvenance.Tool.CLAUDE_CODE_UI, contributionKind = AiProvenance.ContributionKind.GENERATED, notes = "Size the search from the innermost LIMIT, offset included (ASTERIXDB-3871)")
+ protected ILogicalExpression searchKExpression() {
+ ILogicalExpression count = innermostLimitOp.getMaxObjects().getValue().cloneExpression();
+ if (!innermostLimitOp.hasOffset()) {
+ return count;
+ }
+ ILogicalExpression offset = innermostLimitOp.getOffset().getValue().cloneExpression();
+ ScalarFunctionCallExpression sum =
+ new ScalarFunctionCallExpression(FunctionUtil.getFunctionInfo(BuiltinFunctions.NUMERIC_ADD),
+ new MutableObject<>(count), new MutableObject<>(offset));
+ sum.setSourceLocation(innermostLimitOp.getSourceLocation());
+ return sum;
+ }
+
+ /**
* Checks if ORDER BY pattern exists (has at least one ordering expression).
* We don't resolve the actual ANN_DISTANCE function here - that happens later
* after subtree initialization in analyzeAnnDistanceFunction().
@@ -707,7 +740,12 @@
return false;
}
- Long topK = integralConstant(limitOp.getMaxObjects().getValue());
+ // Sized as the plan will be: from the LIMIT nearest the ORDER BY, offset included.
+ Long topK = integralConstant(innermostLimitOp.getMaxObjects().getValue());
+ if (topK != null && innermostLimitOp.hasOffset()) {
+ Long offset = integralConstant(innermostLimitOp.getOffset().getValue());
+ topK = offset == null ? null : topK + offset;
+ }
if (topK == null || queryKMultiplier <= 0) {
return false;
}
@@ -775,8 +813,9 @@
// Build the index-search subplan (UNNEST-MAP over vector index). selectOp is passed so the
// access method can attach a selectCondition for filter pushdown when applicable.
- ILogicalOperator indexSearchOp = VectorIndexAccessMethod.INSTANCE.createIndexSearchPlan(limitRef, orderRef,
- annDistanceExpr, subTree, vectorIndex, analysisCtx, context, selectOp, indexOnly, aboveLimitOps);
+ ILogicalOperator indexSearchOp = VectorIndexAccessMethod.INSTANCE.createIndexSearchPlan(limitRef,
+ searchKExpression(), orderRef, annDistanceExpr, subTree, vectorIndex, analysisCtx, context, selectOp,
+ indexOnly, aboveLimitOps);
if (indexSearchOp == null) {
return false;
@@ -1130,6 +1169,7 @@
protected void clear() {
limitRef = null;
limitOp = null;
+ innermostLimitOp = null;
orderRef = null;
orderOp = null;
annDistanceExpr = null;
diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/VectorIndexAccessMethod.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/VectorIndexAccessMethod.java
index 6079005..17cd269 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/VectorIndexAccessMethod.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/VectorIndexAccessMethod.java
@@ -68,7 +68,6 @@
import org.apache.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator;
import org.apache.hyracks.algebricks.core.algebra.operators.logical.AssignOperator;
import org.apache.hyracks.algebricks.core.algebra.operators.logical.DistinctOperator;
-import org.apache.hyracks.algebricks.core.algebra.operators.logical.LimitOperator;
import org.apache.hyracks.algebricks.core.algebra.operators.logical.OrderOperator;
import org.apache.hyracks.algebricks.core.algebra.operators.logical.SelectOperator;
import org.apache.hyracks.algebricks.core.algebra.operators.logical.UnnestMapOperator;
@@ -216,7 +215,8 @@
* and the INCLUDE columns, the ORDER BY sorts on that distance, and the plan above is rebound to those
* outputs.
*
- * @param limitRef Reference to LIMIT operator
+ * @param limitRef Reference to the outermost LIMIT operator, where the pattern was matched
+ * @param searchK The number of ranked rows the search must produce, as an expression
* @param orderRef Reference to ORDER operator
* @param annDistanceExpr The ANN_DISTANCE function expression from ORDER BY
* @param subTree The subtree containing the data source
@@ -226,7 +226,7 @@
* @return The transformed plan with vector index search + primary lookup, or null if transformation fails
*/
@AiProvenance(agent = AiProvenance.Agent.CLAUDE_FABLE_5_1, tool = AiProvenance.Tool.CLAUDE_CODE_UI, contributionKind = AiProvenance.ContributionKind.ASSISTED, notes = "Splice the index-only search into the plan before retyping the operators above it")
- public ILogicalOperator createIndexSearchPlan(Mutable<ILogicalOperator> limitRef,
+ public ILogicalOperator createIndexSearchPlan(Mutable<ILogicalOperator> limitRef, ILogicalExpression searchK,
Mutable<ILogicalOperator> orderRef, AbstractFunctionCallExpression annDistanceExpr,
OptimizableOperatorSubTree subTree, Index chosenIndex, AccessMethodAnalysisContext analysisCtx,
IOptimizationContext context, SelectOperator selectOp, boolean indexOnly,
@@ -243,9 +243,9 @@
AnnSearchPreferenceAnnotation annHint = annDistanceExpr.getAnnotation(AnnSearchPreferenceAnnotation.class);
ILogicalExpression queryVectorExpr = getQueryVectorExpr(annDistanceExpr, analysisCtx);
- // Extract k value from LIMIT operator
- LimitOperator limitOp = (LimitOperator) limitRef.getValue();
- ILogicalExpression kValueExpr = limitOp.getMaxObjects().getValue();
+ // The ranked rows the plan needs, sized by the rule from the LIMIT nearest the ORDER BY with its
+ // OFFSET included; the outermost LIMIT alone would undersize a nested LIMIT ... OFFSET.
+ ILogicalExpression kValueExpr = searchK;
// Create variables to hold query parameters in the positional layout the runtime search expects:
// [query_vector, k_value, distance_metric, min_probe_fraction, k_multiplier].
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.20.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.20.query.sqlpp
new file mode 100644
index 0000000..3b656eb
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.20.query.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+USE test;
+// LIMIT with an OFFSET. The search is sized to count + offset, 5 here, so the plan can take the index and
+// still hand the OFFSET the rows it skips. The five nearest to the origin are ids 1..5; skipping 2 leaves
+// 3, 4, 5. Before, any OFFSET fell back to the exact scan.
+SELECT VALUE m.id
+FROM MovieSmall m
+ORDER BY ann_distance(m.embedding, [0.0, 0.0, 0.0, 0.0], "euclidean", 1.0)
+LIMIT 3 OFFSET 2;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.21.plans.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.21.plans.sqlpp
new file mode 100644
index 0000000..69428a5
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.21.plans.sqlpp
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+-- param compile-only:string=true
+-- param optimized-logical-plan:string=true
+// CBO cost estimates vary with the cluster shape (partition count / core count), which
+// differs between a local run and CI. Disable the CBO so the plan is stable everywhere.
+SET `compiler.cbo` "false";
+// The .20 query as a plan assertion: index-only, and the search's parameter ASSIGN carries 5, the count
+// plus the offset, not the count alone.
+USE test;
+SELECT VALUE m.id
+FROM MovieSmall m
+ORDER BY ann_distance(m.embedding, [0.0, 0.0, 0.0, 0.0], "euclidean", 1.0)
+LIMIT 3 OFFSET 2;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.22.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.22.query.sqlpp
new file mode 100644
index 0000000..c7eb789
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.22.query.sqlpp
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+USE test;
+// A subquery LIMIT with an OFFSET under an outer LIMIT (ASTERIXDB-3871). The pattern is matched at the outer
+// LIMIT, but the search must be sized from the one nearest the ORDER BY, whose offset it is: 5 rows, giving
+// 3, 4, 5. Sized from the outer count alone it would collect 3 and the OFFSET would leave one row.
+SELECT VALUE t.id
+FROM (SELECT m.id FROM MovieSmall m ORDER BY ann_distance(m.embedding, [0.0, 0.0, 0.0, 0.0], "euclidean", 1.0) LIMIT 3 OFFSET 2) t
+LIMIT 3;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.23.plans.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.23.plans.sqlpp
new file mode 100644
index 0000000..91d5e9d
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.23.plans.sqlpp
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+-- param compile-only:string=true
+-- param optimized-logical-plan:string=true
+// CBO cost estimates vary with the cluster shape (partition count / core count), which
+// differs between a local run and CI. Disable the CBO so the plan is stable everywhere.
+SET `compiler.cbo` "false";
+// The .22 query as a plan assertion: the search's parameter ASSIGN carries 5, from the inner LIMIT's count
+// plus offset, under both LIMITs.
+USE test;
+SELECT VALUE t.id
+FROM (SELECT m.id FROM MovieSmall m ORDER BY ann_distance(m.embedding, [0.0, 0.0, 0.0, 0.0], "euclidean", 1.0) LIMIT 3 OFFSET 2) t
+LIMIT 3;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.20.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.20.adm
new file mode 100644
index 0000000..e2e8ea0
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.20.adm
@@ -0,0 +1,3 @@
+3
+4
+5
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.21.plan b/asterixdb/asterix-app/src/test/resources/runtimets/results/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.21.plan
new file mode 100644
index 0000000..84f62ca
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.21.plan
@@ -0,0 +1,30 @@
+distribute result [$$28]
+-- DISTRIBUTE_RESULT |UNPARTITIONED|
+ exchange
+ -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
+ limit 3 offset 2
+ -- STREAM_LIMIT |UNPARTITIONED|
+ project ([$$28])
+ -- STREAM_PROJECT |PARTITIONED|
+ exchange
+ -- SORT_MERGE_EXCHANGE [$$29(ASC) ] |PARTITIONED|
+ limit 5
+ -- STREAM_LIMIT |PARTITIONED|
+ exchange
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ order (topK: 5) (ASC, $$29)
+ -- STABLE_SORT [topK: 5] [$$29(ASC)] |PARTITIONED|
+ exchange
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ project ([$$28, $$29])
+ -- STREAM_PROJECT |PARTITIONED|
+ exchange
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ unnest-map [$$28, $$29, $$30] <- index-search("idx_emb", 8, "Default", "test", "MovieSmall", false, false, true, 5, $$23, $$24, $$25, $$26, $$27)
+ -- VECTOR_SEARCH |PARTITIONED|
+ exchange
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ assign [$$23, $$24, $$25, $$26, $$27] <- [array: [ 0.0, 0.0, 0.0, 0.0 ], 5, "euclidean", 1.0, 1]
+ -- ASSIGN |PARTITIONED|
+ empty-tuple-source
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.22.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.22.adm
new file mode 100644
index 0000000..e2e8ea0
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.22.adm
@@ -0,0 +1,3 @@
+3
+4
+5
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.23.plan b/asterixdb/asterix-app/src/test/resources/runtimets/results/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.23.plan
new file mode 100644
index 0000000..639d607
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/vector/create-index-vtree-include-filter/create-index-vtree-include-filter.23.plan
@@ -0,0 +1,32 @@
+distribute result [$$46]
+-- DISTRIBUTE_RESULT |UNPARTITIONED|
+ exchange
+ -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
+ limit 3
+ -- STREAM_LIMIT |UNPARTITIONED|
+ limit 3 offset 2
+ -- STREAM_LIMIT |UNPARTITIONED|
+ project ([$$46])
+ -- STREAM_PROJECT |PARTITIONED|
+ exchange
+ -- SORT_MERGE_EXCHANGE [$$47(ASC) ] |PARTITIONED|
+ limit 5
+ -- STREAM_LIMIT |PARTITIONED|
+ exchange
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ order (topK: 5) (ASC, $$47)
+ -- STABLE_SORT [topK: 5] [$$47(ASC)] |PARTITIONED|
+ exchange
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ project ([$$46, $$47])
+ -- STREAM_PROJECT |PARTITIONED|
+ exchange
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ unnest-map [$$46, $$47, $$48] <- index-search("idx_emb", 8, "Default", "test", "MovieSmall", false, false, true, 5, $$41, $$42, $$43, $$44, $$45)
+ -- VECTOR_SEARCH |PARTITIONED|
+ exchange
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ assign [$$41, $$42, $$43, $$44, $$45] <- [array: [ 0.0, 0.0, 0.0, 0.0 ], 5, "euclidean", 1.0, 1]
+ -- ASSIGN |PARTITIONED|
+ empty-tuple-source
+ -- EMPTY_TUPLE_SOURCE |PARTITIONED|
--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21855?usp=email
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: Ic29dd3b13b9f7a098e0483a70ae11aa0bf2b004e
Gerrit-Change-Number: 21855
Gerrit-PatchSet: 1
Gerrit-Owner: Ali Alsuliman <al...@gmail.com>