>From Ritik Raj <[email protected]>: Ritik Raj has submitted this change. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20992?usp=email )
Change subject: [ASTERIXDB-3708][COMP] Fix range-filter pushdown with secondary index intersection ...................................................................... [ASTERIXDB-3708][COMP] Fix range-filter pushdown with secondary index intersection - user model changes: no - storage format changes: no - interface changes: no Details: When querying a columnar dataset with multiple secondary indexes (causing an INTERSECT-based intersection plan), range-filter pushdown was silently skipped, e.g.: SELECT count(*) FROM A WHERE b = 0 AND a = 1 AND c = 4 with indexes on (a), (b), (c) produced an INTERSECT plan where the range-filter was not pushed into the primary scan. Root cause: The ASTERIXDB-3708 fix (46d36883bf) introduced a registration ordering constraint: registerDatasetIfApplicable must run before visitInputs so that a pushed-down selectCondition can link its field accesses to the scan's record variable in the def-use chain. However, this caused a scope mismatch: the scan was registered before the INTERSECT (a scope-bumping operator) in its input subtree was visited, so the scan's scope was lower than the SELECT operator above it, causing canPushSelect to reject the pushdown. The two constraints conflict: - Def-use correctness: register BEFORE processing the scan's own expressions - Scope correctness: register AFTER visiting the input subtree (so all scope-bumping operators have already advanced the counter) Fix: Split visitInputs into visitChildren + processOperator, exposing the boundary between the two phases. The three scan visitors (DataSourceScan, UnnestMap, LeftOuterUnnestMap) now explicitly do: visitChildren → registerDatasetIfApplicable → processOperator This satisfies both constraints: the scope counter is fully advanced before registration, and registration precedes expression processing. Ext-ref: MB-70725 Change-Id: I7a06aa40f43358a6ef3e5773c8d02c5928eb8007 Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20992 Reviewed-by: Murtadha Hubail <[email protected]> Reviewed-by: Ritik Raj <[email protected]> Integration-Tests: Jenkins <[email protected]> Tested-by: Jenkins <[email protected]> --- M asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/pushdown/visitor/PushdownOperatorVisitor.java A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/range-filter-intersect/range-filter-intersect.001.ddl.sqlpp A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/range-filter-intersect/range-filter-intersect.002.update.sqlpp A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/range-filter-intersect/range-filter-intersect.003.query.sqlpp A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/range-filter-intersect/range-filter-intersect.004.query.sqlpp A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/range-filter-intersect/range-filter-intersect.005.ddl.sqlpp A asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/range-filter-intersect/range-filter-intersect.003.plan A asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/range-filter-intersect/range-filter-intersect.004.adm M asterixdb/asterix-app/src/test/resources/runtimets/results_column/index-selection/btree-index-range-02/btree-index-range-02.16.plan M asterixdb/asterix-app/src/test/resources/runtimets/results_column/index-selection/btree-index-range-02/btree-index-range-02.18.plan M asterixdb/asterix-app/src/test/resources/runtimets/testsuite_single_partition_sqlpp.xml 11 files changed, 274 insertions(+), 5 deletions(-) Approvals: Jenkins: Verified; Verified Murtadha Hubail: Looks good to me, approved Ritik Raj: Looks good to me, but someone else must approve Objections: Anon. E. Moose #1000171: Violations found diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/pushdown/visitor/PushdownOperatorVisitor.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/pushdown/visitor/PushdownOperatorVisitor.java index 7878ebf..5b7c039 100644 --- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/pushdown/visitor/PushdownOperatorVisitor.java +++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/pushdown/visitor/PushdownOperatorVisitor.java @@ -122,9 +122,27 @@ if (visitedOperators.contains(op)) { return; } + visitChildren(op); + processOperator(op, producedVariables); + } + + /** + * Visits all children of an operator. Scope-bumping operators (e.g., INTERSECT, JOIN) encountered in the + * subtree will advance the scope counter as a side effect. + */ + private void visitChildren(ILogicalOperator op) throws AlgebricksException { for (Mutable<ILogicalOperator> child : op.getInputs()) { child.getValue().accept(this, null); } + } + + /** + * Processes the operator itself: enters its scope, builds the def-use chain for its expressions, and marks it + * as visited. Must be called after {@link #visitChildren} and after any dataset registration so that + * expressions referencing the scan's record variable are correctly linked in the def-use chain. + */ + private void processOperator(ILogicalOperator op, List<LogicalVariable> producedVariables) + throws AlgebricksException { visitedOperators.add(op); // Enter scope for (new stage) for operators like GROUP and JOIN pushdownContext.enterScope(op); @@ -163,21 +181,35 @@ */ @Override public Void visitDataScanOperator(DataSourceScanOperator op, Void arg) throws AlgebricksException { + if (visitedOperators.contains(op)) { + return null; + } + visitChildren(op); DatasetDataSource datasetDataSource = getDatasetDataSourceIfApplicable((DataSource) op.getDataSource()); registerDatasetIfApplicable(datasetDataSource, op); - visitInputs(op); + processOperator(op, null); return null; } /** * From the {@link UnnestMapOperator}, we need to register the payload variable (record variable) to check * which expression in the plan is using it. + * <p> + * Registration must happen after visiting children (so that any scope-bumping operators in the input subtree, + * e.g. an INTERSECT used for secondary-index intersection, have already advanced the scope counter) but before + * processing the operator's own expressions (so that the scan's record variable is in the def-use chain when + * the selectCondition — which may have been pushed into the UNNEST_MAP by PushLimitIntoPrimarySearchRule — is + * processed). */ @Override public Void visitUnnestMapOperator(UnnestMapOperator op, Void arg) throws AlgebricksException { + if (visitedOperators.contains(op)) { + return null; + } + visitChildren(op); DatasetDataSource datasetDataSource = getDatasetDataSourceIfApplicable(getDataSourceFromUnnestMapOperator(op)); registerDatasetIfApplicable(datasetDataSource, op); - visitInputs(op); + processOperator(op, null); return null; } @@ -187,9 +219,13 @@ */ @Override public Void visitLeftOuterUnnestMapOperator(LeftOuterUnnestMapOperator op, Void arg) throws AlgebricksException { + if (visitedOperators.contains(op)) { + return null; + } + visitChildren(op); DatasetDataSource datasetDataSource = getDatasetDataSourceIfApplicable(getDataSourceFromUnnestMapOperator(op)); registerDatasetIfApplicable(datasetDataSource, op); - visitInputs(op); + processOperator(op, null); return null; } diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/range-filter-intersect/range-filter-intersect.001.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/range-filter-intersect/range-filter-intersect.001.ddl.sqlpp new file mode 100644 index 0000000..64f2d37 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/range-filter-intersect/range-filter-intersect.001.ddl.sqlpp @@ -0,0 +1,45 @@ +/* + * 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. + */ + +/* + * Regression test for ASTERIXDB-3708 (scope fix): + * Range-filter pushdown must be applied to the primary scan even when the + * query plan uses a secondary-index INTERSECT (multiple secondary index + * lookups joined via INTERSECT before the primary BTREE_SEARCH). + * + * Before the fix the INTERSECT operator bumped the scope counter before the + * primary scan was registered, causing scope(SELECT) != scope(scan) and + * silently suppressing the range-filter pushdown. + */ + +DROP DATAVERSE range_filter_intersect IF EXISTS; +CREATE DATAVERSE range_filter_intersect; +USE range_filter_intersect; + +CREATE TYPE intType AS { + id: integer +}; + +CREATE DATASET A(intType) PRIMARY KEY id WITH { + "storage-format": {"format": "column"} +}; + +CREATE INDEX idx_b ON A (b); +CREATE INDEX idx_a ON A (a); +CREATE INDEX idx_c ON A (c); diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/range-filter-intersect/range-filter-intersect.002.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/range-filter-intersect/range-filter-intersect.002.update.sqlpp new file mode 100644 index 0000000..b81299c --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/range-filter-intersect/range-filter-intersect.002.update.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 range_filter_intersect; + +-- Only {id:1} matches all three conditions: b=0, a=1, c=4 +INSERT INTO A {"id": 1, "a": 1, "b": 0, "c": 4}; +INSERT INTO A {"id": 2, "a": 2, "b": 0, "c": 4}; +INSERT INTO A {"id": 3, "a": 1, "b": 1, "c": 4}; +INSERT INTO A {"id": 4, "a": 1, "b": 0, "c": 5}; diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/range-filter-intersect/range-filter-intersect.003.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/range-filter-intersect/range-filter-intersect.003.query.sqlpp new file mode 100644 index 0000000..aebacd5 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/range-filter-intersect/range-filter-intersect.003.query.sqlpp @@ -0,0 +1,32 @@ +/* + * 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. + */ + +/* + * Verifies that range-filter on: appears on the primary BTREE_SEARCH when + * the plan uses a secondary-index INTERSECT below it. + */ +USE range_filter_intersect; +SET `compiler.parallelism` "0"; +SET `compiler.sort.parallel` "false"; +EXPLAIN +SELECT count(*) +FROM A +WHERE b = 0 + AND a = 1 + AND c = 4; diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/range-filter-intersect/range-filter-intersect.004.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/range-filter-intersect/range-filter-intersect.004.query.sqlpp new file mode 100644 index 0000000..3989ca9 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/range-filter-intersect/range-filter-intersect.004.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 range_filter_intersect; + +SELECT count(*) +FROM A +WHERE b = 0 + AND a = 1 + AND c = 4; diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/range-filter-intersect/range-filter-intersect.005.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/range-filter-intersect/range-filter-intersect.005.ddl.sqlpp new file mode 100644 index 0000000..ce0180f --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/range-filter-intersect/range-filter-intersect.005.ddl.sqlpp @@ -0,0 +1,20 @@ +/* + * 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. + */ + +DROP DATAVERSE range_filter_intersect IF EXISTS; diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/range-filter-intersect/range-filter-intersect.003.plan b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/range-filter-intersect/range-filter-intersect.003.plan new file mode 100644 index 0000000..2e8b713 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/range-filter-intersect/range-filter-intersect.003.plan @@ -0,0 +1,78 @@ +distribute result [$$41] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] +-- DISTRIBUTE_RESULT |UNPARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED| + assign [$$41] <- [{"$1": $$43}] project: [$$41] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ASSIGN |UNPARTITIONED| + aggregate [$$43] <- [agg-sql-sum($$47)] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- AGGREGATE |UNPARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- RANDOM_MERGE_EXCHANGE |PARTITIONED| + aggregate [$$47] <- [agg-sql-count(1)] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- AGGREGATE |PARTITIONED| + select (and(eq($$A.getField("b"), 0), eq($$A.getField("a"), 1), eq($$A.getField("c"), 4))) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- STREAM_SELECT |PARTITIONED| + project ([$$A]) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- STREAM_PROJECT |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + unnest-map [$$42, $$A] <- index-search("A", 0, "Default", "range_filter_intersect", "A", false, false, 1, $$60, 1, $$60, true, true, true) project ({a:any,b:any,c:any}) range-filter on: and(eq($$A.getField("b"), 0), eq($$A.getField("a"), 1), eq($$A.getField("c"), 4)) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- BTREE_SEARCH |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + intersect [$$60] <- [[$$51], [$$55], [$$59]] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- INTERSECT |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + order (ASC, $$51) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- STABLE_SORT [$$51(ASC)] |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + project ([$$51]) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- STREAM_PROJECT |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + unnest-map [$$50, $$51] <- index-search("idx_a", 0, "Default", "range_filter_intersect", "A", false, false, 1, $$48, 1, $$49, true, true, true) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- BTREE_SEARCH |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + assign [$$48, $$49] <- [1, 1] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ASSIGN |PARTITIONED| + empty-tuple-source [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- EMPTY_TUPLE_SOURCE |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + order (ASC, $$55) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- STABLE_SORT [$$55(ASC)] |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + project ([$$55]) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- STREAM_PROJECT |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + unnest-map [$$54, $$55] <- index-search("idx_b", 0, "Default", "range_filter_intersect", "A", false, false, 1, $$52, 1, $$53, true, true, true) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- BTREE_SEARCH |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + assign [$$52, $$53] <- [0, 0] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ASSIGN |PARTITIONED| + empty-tuple-source [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- EMPTY_TUPLE_SOURCE |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + order (ASC, $$59) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- STABLE_SORT [$$59(ASC)] |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + project ([$$59]) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- STREAM_PROJECT |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + unnest-map [$$58, $$59] <- index-search("idx_c", 0, "Default", "range_filter_intersect", "A", false, false, 1, $$56, 1, $$57, true, true, true) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- BTREE_SEARCH |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + assign [$$56, $$57] <- [4, 4] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ASSIGN |PARTITIONED| + empty-tuple-source [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- EMPTY_TUPLE_SOURCE |PARTITIONED| diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/range-filter-intersect/range-filter-intersect.004.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/range-filter-intersect/range-filter-intersect.004.adm new file mode 100644 index 0000000..7cc3573 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/range-filter-intersect/range-filter-intersect.004.adm @@ -0,0 +1 @@ +{ "$1": 1 } diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_column/index-selection/btree-index-range-02/btree-index-range-02.16.plan b/asterixdb/asterix-app/src/test/resources/runtimets/results_column/index-selection/btree-index-range-02/btree-index-range-02.16.plan index 03ab55b..09f8f83 100644 --- a/asterixdb/asterix-app/src/test/resources/runtimets/results_column/index-selection/btree-index-range-02/btree-index-range-02.16.plan +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_column/index-selection/btree-index-range-02/btree-index-range-02.16.plan @@ -18,7 +18,7 @@ -- STREAM_PROJECT |PARTITIONED| exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] -- ONE_TO_ONE_EXCHANGE |PARTITIONED| - unnest-map [$$48, $$A] <- index-search("A", 0, "Default", "test", "A", false, false, 1, $$64, 1, $$64, true, true, true) project ({a:any,b:any,c:any}) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + unnest-map [$$48, $$A] <- index-search("A", 0, "Default", "test", "A", false, false, 1, $$64, 1, $$64, true, true, true) project ({a:any,b:any,c:any}) range-filter on: and(or(eq($$A.getField("b"), 0), eq($$A.getField("b"), 1), eq($$A.getField("b"), 2), eq($$A.getField("b"), 3), eq($$A.getField("b"), 4), eq($$A.getField("b"), 5), eq($$A.getField("b"), 6), eq($$A.getField("b"), 7), eq($$A.getField("b"), 8), eq($$A.getField("b"), 9), eq($$A.getField("b"), 10), eq($$A.getField("b"), 11), eq($$A.getField("b"), 12), eq($$A.getField("b"), 13), eq($$A.getField("b"), 14), eq($$A.getField("b"), 15), eq($$A.getField("b"), 16), eq($$A.getField("b"), 17), eq($$A.getField("b"), 18), eq($$A.getField("b"), 19), eq($$A.getField("b"), 20), eq($$A.getField("b"), 21), eq($$A.getField("b"), 22), eq($$A.getField("b"), 23), eq($$A.getField("b"), 24), eq($$A.getField("b"), 25), eq($$A.getField("b"), 26), eq($$A.getField("b"), 27), eq($$A.getField("b"), 28), eq($$A.getField("b"), 29)), eq($$A.getField("a"), 1), or(eq($$A.getField("c"), 0), eq($$A.getField("c"), 1), eq($$A.getField("c"), 2), eq($$A.getField("c"), 3), eq($$A.getField("c"), 4))) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] -- BTREE_SEARCH |PARTITIONED| exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] -- ONE_TO_ONE_EXCHANGE |PARTITIONED| diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_column/index-selection/btree-index-range-02/btree-index-range-02.18.plan b/asterixdb/asterix-app/src/test/resources/runtimets/results_column/index-selection/btree-index-range-02/btree-index-range-02.18.plan index 1f865ac..02d7bdd 100644 --- a/asterixdb/asterix-app/src/test/resources/runtimets/results_column/index-selection/btree-index-range-02/btree-index-range-02.18.plan +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_column/index-selection/btree-index-range-02/btree-index-range-02.18.plan @@ -18,7 +18,7 @@ -- STREAM_PROJECT |PARTITIONED| exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] -- ONE_TO_ONE_EXCHANGE |PARTITIONED| - unnest-map [$$45, $$A] <- index-search("A", 0, "Default", "test", "A", false, false, 1, $$61, 1, $$61, true, true, true) project ({a:any,b:any,c:any}) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + unnest-map [$$45, $$A] <- index-search("A", 0, "Default", "test", "A", false, false, 1, $$61, 1, $$61, true, true, true) project ({a:any,b:any,c:any}) range-filter on: and(eq($$A.getField("b"), 15), lt($$A.getField("c"), 3), or(eq($$A.getField("a"), 0), eq($$A.getField("a"), 1))) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] -- BTREE_SEARCH |PARTITIONED| exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] -- ONE_TO_ONE_EXCHANGE |PARTITIONED| diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_single_partition_sqlpp.xml b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_single_partition_sqlpp.xml index d0a8452..27bd8f9 100644 --- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_single_partition_sqlpp.xml +++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_single_partition_sqlpp.xml @@ -410,6 +410,11 @@ </compilation-unit> </test-case> <test-case FilePath="column"> + <compilation-unit name="secondary-index/range-filter-intersect"> + <output-dir compare="Text">secondary-index/range-filter-intersect</output-dir> + </compilation-unit> + </test-case> + <test-case FilePath="column"> <compilation-unit name="secondary-index/array-index/use-case-1"> <output-dir compare="Text">secondary-index/array-index/use-case-1</output-dir> </compilation-unit> -- To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20992?usp=email To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: asterixdb Gerrit-Branch: phoenix Gerrit-Change-Id: I7a06aa40f43358a6ef3e5773c8d02c5928eb8007 Gerrit-Change-Number: 20992 Gerrit-PatchSet: 5 Gerrit-Owner: Ritik Raj <[email protected]> Gerrit-Reviewer: Ali Alsuliman <[email protected]> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Murtadha Hubail <[email protected]> Gerrit-Reviewer: Ritik Raj <[email protected]>
