This is an automated email from the ASF dual-hosted git repository.

mblow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 4d3a6678ad [ASTERIXDB-3651][COMP] Correct delivered properties of 
secondary index search operator
4d3a6678ad is described below

commit 4d3a6678adf96f1c8632b68104bff24991c02455
Author: Shahrzad Shirazi <[email protected]>
AuthorDate: Thu Sep 25 14:14:45 2025 -0700

    [ASTERIXDB-3651][COMP] Correct delivered properties of secondary index 
search operator
    
    Ext-ref: MB-55766
    Change-Id: I2812c034a6d002bf906a0dff7a26aa7402707a3f
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20411
    Tested-by: Ali Alsuliman <[email protected]>
    Integration-Tests: Jenkins <[email protected]>
    Reviewed-by: Ali Alsuliman <[email protected]>
---
 .../operators/physical/IndexSearchPOperator.java   | 40 ++++++++++++-
 .../optimizerts/results/ASTERIXDB-2402.plan        |  2 +-
 ...join-probe-pidx-with-join-btree-sidx_01_ps.plan |  4 +-
 ...be-pidx-with-join-btree-sidx_03-index-only.plan |  2 +-
 .../results/filter_on_meta_with_idx_0.plan         |  2 +-
 ...join-probe-pidx-with-join-rtree-sidx_01_ps.plan |  4 +-
 .../optimizerts/results_cbo/ASTERIXDB-2402.plan    |  2 +-
 .../index-only-with-Meta.1.ddl.sqlpp               | 68 ++++++++++++++++++++++
 .../index-only-with-Meta.2.update.sqlpp            | 30 ++++++++++
 .../index-only-with-Meta.3.query.sqlpp             | 26 +++++++++
 .../index-only-with-Meta.4.query.sqlpp             | 25 ++++++++
 .../index-only-with-Meta.5.query.sqlpp             | 25 ++++++++
 .../index-only-with-Meta.6.query.sqlpp             | 24 ++++++++
 .../heterogeneous-index-only-compund-keys.6.plan   |  2 +-
 .../index-only-with-Meta.3.adm                     |  8 +++
 .../index-only-with-Meta.4.plan                    | 30 ++++++++++
 .../index-only-with-Meta.5.adm                     |  1 +
 .../index-only-with-Meta.6.plan}                   | 38 ++++++------
 .../index-only-leftouterjoin.008.plan              |  2 +-
 .../index-only-leftouterjoin.010.plan              |  2 +-
 .../index-only-leftouterjoin.008.plan              |  2 +-
 .../index-only-leftouterjoin.010.plan              |  2 +-
 .../heterogeneous-index-only-compund-keys.6.plan   |  2 +-
 .../index-only-with-Meta.6.plan}                   | 38 ++++++------
 .../index-only-leftouterjoin.008.plan              |  2 +-
 .../index-only-leftouterjoin.010.plan              |  2 +-
 .../heterogeneous-index-only-compund-keys.6.plan   |  0
 .../index-only-with-Meta.6.plan}                   | 38 ++++++------
 .../heterogeneous-index-only-compund-keys.6.plan   |  0
 .../index-only-with-Meta.6.plan}                   | 38 ++++++------
 .../src/test/resources/runtimets/sqlpp_queries.xml |  5 ++
 31 files changed, 372 insertions(+), 94 deletions(-)

diff --git 
a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/algebra/operators/physical/IndexSearchPOperator.java
 
b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/algebra/operators/physical/IndexSearchPOperator.java
index f522d935b0..21547cfddb 100644
--- 
a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/algebra/operators/physical/IndexSearchPOperator.java
+++ 
b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/algebra/operators/physical/IndexSearchPOperator.java
@@ -18,20 +18,27 @@
  */
 package org.apache.asterix.algebra.operators.physical;
 
+import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.common.exceptions.ErrorCode;
 import org.apache.asterix.metadata.declared.DataSourceId;
+import org.apache.asterix.metadata.declared.DataSourceIndex;
+import org.apache.asterix.metadata.declared.DatasetDataSource;
+import org.apache.asterix.metadata.entities.Dataset;
+import org.apache.asterix.metadata.entities.Index;
 import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
 import org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator;
 import org.apache.hyracks.algebricks.core.algebra.base.IOptimizationContext;
+import org.apache.hyracks.algebricks.core.algebra.base.LogicalOperatorTag;
 import org.apache.hyracks.algebricks.core.algebra.base.LogicalVariable;
 import 
org.apache.hyracks.algebricks.core.algebra.expressions.IAlgebricksConstantValue;
 import org.apache.hyracks.algebricks.core.algebra.metadata.IDataSource;
 import org.apache.hyracks.algebricks.core.algebra.metadata.IDataSourceIndex;
 import 
org.apache.hyracks.algebricks.core.algebra.metadata.IDataSourcePropertiesProvider;
 import 
org.apache.hyracks.algebricks.core.algebra.operators.logical.AbstractScanOperator;
+import 
org.apache.hyracks.algebricks.core.algebra.operators.logical.AbstractUnnestMapOperator;
 import 
org.apache.hyracks.algebricks.core.algebra.operators.logical.IOperatorSchema;
 import 
org.apache.hyracks.algebricks.core.algebra.operators.physical.AbstractScanPOperator;
 import 
org.apache.hyracks.algebricks.core.algebra.properties.BroadcastPartitioningProperty;
@@ -69,9 +76,38 @@ public abstract class IndexSearchPOperator extends 
AbstractScanPOperator {
     public void computeDeliveredProperties(ILogicalOperator op, 
IOptimizationContext context)
             throws AlgebricksException {
         IDataSource<?> ds = idx.getDataSource();
+        List<LogicalVariable> scanVariables = new ArrayList<>();
+        if (idx instanceof DataSourceIndex) {
+            Index index = ((DataSourceIndex) idx).getIndex();
+            if (index.isSecondaryIndex() && ds instanceof DatasetDataSource) {
+                Dataset dataset = ((DatasetDataSource) ds).getDataset();
+                int numOfPrimaryKeys = dataset.getPrimaryKeys().size();
+                if (op.getOperatorTag() == LogicalOperatorTag.UNNEST_MAP
+                        || op.getOperatorTag() == 
LogicalOperatorTag.LEFT_OUTER_UNNEST_MAP) {
+                    // Getting the primary keys vars from the Unnest Map or 
Left Outer Unnest Map operator.
+                    // Primary key Vars are always located at the end of the 
unnest variables list.
+                    // This check is unnecessary as the operator will always be
+                    // AbstractUnnestMapOperator in secondary index search 
cases.
+                    List<LogicalVariable> opVars = 
((AbstractUnnestMapOperator) op).getScanVariables();
+                    int varsSize = opVars.size();
+                    scanVariables.addAll(opVars.subList(varsSize - 
numOfPrimaryKeys, varsSize));
+                    scanVariables.add(new LogicalVariable(-1));
+                    if (dataset.hasMetaPart()) {
+                        //if the dataset has a meta part, we add an additional 
variable for the meta item
+                        //By doing so we ensure that 
DataSource.getPrimaryKeyVariables will always pick
+                        //the correct pks.
+                        scanVariables.add(new LogicalVariable(-1));
+                    }
+                }
+            }
+        }
+        if (scanVariables.isEmpty()) {
+            AbstractScanOperator as = (AbstractScanOperator) op;
+            scanVariables.addAll(as.getScanVariables());
+        }
+
         IDataSourcePropertiesProvider dspp = ds.getPropertiesProvider();
-        AbstractScanOperator as = (AbstractScanOperator) op;
-        deliveredProperties = 
dspp.computeDeliveredProperties(as.getScanVariables(), context);
+        deliveredProperties = dspp.computeDeliveredProperties(scanVariables, 
context);
     }
 
     protected int[] getKeyIndexes(List<LogicalVariable> keyVarList, 
IOperatorSchema[] inputSchemas) {
diff --git 
a/asterixdb/asterix-app/src/test/resources/optimizerts/results/ASTERIXDB-2402.plan
 
b/asterixdb/asterix-app/src/test/resources/optimizerts/results/ASTERIXDB-2402.plan
index e4785ed72b..a862167f76 100644
--- 
a/asterixdb/asterix-app/src/test/resources/optimizerts/results/ASTERIXDB-2402.plan
+++ 
b/asterixdb/asterix-app/src/test/resources/optimizerts/results/ASTERIXDB-2402.plan
@@ -133,7 +133,7 @@ distribute result [$$227]
                                                                     order 
(ASC, $$236) (ASC, $$288) (ASC, $$289) (ASC, $$290) (ASC, $$291)
                                                                     -- 
STABLE_SORT [$$236(ASC), $$288(ASC), $$289(ASC), $$290(ASC), $$291(ASC)]  
|PARTITIONED|
                                                                       exchange
-                                                                      -- 
HASH_PARTITION_EXCHANGE [$$236]  |PARTITIONED|
+                                                                      -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                                         select 
(spatial-intersect($$293, $$244)) retain-untrue ($$236 <- missing)
                                                                         -- 
STREAM_SELECT  |PARTITIONED|
                                                                           
assign [$$293] <- [create-point($$288, $$289)]
diff --git 
a/asterixdb/asterix-app/src/test/resources/optimizerts/results/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_ps.plan
 
b/asterixdb/asterix-app/src/test/resources/optimizerts/results/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_ps.plan
index ba8c9353fc..b2f8063a34 100644
--- 
a/asterixdb/asterix-app/src/test/resources/optimizerts/results/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_ps.plan
+++ 
b/asterixdb/asterix-app/src/test/resources/optimizerts/results/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_ps.plan
@@ -44,7 +44,7 @@ distribute result [$$41]
                                   order (ASC, $$45) (ASC, $$46)
                                   -- STABLE_SORT [$$45(ASC), $$46(ASC)]  
|PARTITIONED|
                                     exchange
-                                    -- HASH_PARTITION_EXCHANGE [$$45]  
|PARTITIONED|
+                                    -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                       select (eq($$47, $$46)) retain-untrue 
($$45 <- missing)
                                       -- STREAM_SELECT  |PARTITIONED|
                                         exchange
@@ -107,7 +107,7 @@ distribute result [$$41]
                                             order (ASC, $$45) (ASC, $$46)
                                             -- STABLE_SORT [$$45(ASC), 
$$46(ASC)]  |PARTITIONED|
                                               exchange
-                                              -- HASH_PARTITION_EXCHANGE 
[$$45]  |PARTITIONED|
+                                              -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
                                                 select (eq($$47, $$46)) 
retain-untrue ($$45 <- missing)
                                                 -- STREAM_SELECT  |PARTITIONED|
                                                   exchange
diff --git 
a/asterixdb/asterix-app/src/test/resources/optimizerts/results/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_03-index-only.plan
 
b/asterixdb/asterix-app/src/test/resources/optimizerts/results/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_03-index-only.plan
index 508a8be7ac..968d126b5f 100644
--- 
a/asterixdb/asterix-app/src/test/resources/optimizerts/results/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_03-index-only.plan
+++ 
b/asterixdb/asterix-app/src/test/resources/optimizerts/results/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_03-index-only.plan
@@ -29,7 +29,7 @@ distribute result [$$37]
                             order (ASC, $$42) (ASC, $$44)
                             -- STABLE_SORT [$$42(ASC), $$44(ASC)]  
|PARTITIONED|
                               exchange
-                              -- HASH_PARTITION_EXCHANGE [$$42]  |PARTITIONED|
+                              -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                 select (eq($$43, $$44)) retain-untrue ($$42 <- 
missing)
                                 -- STREAM_SELECT  |PARTITIONED|
                                   exchange
diff --git 
a/asterixdb/asterix-app/src/test/resources/optimizerts/results/filter_on_meta_with_idx_0.plan
 
b/asterixdb/asterix-app/src/test/resources/optimizerts/results/filter_on_meta_with_idx_0.plan
index 876d2ed74b..4fe887625f 100644
--- 
a/asterixdb/asterix-app/src/test/resources/optimizerts/results/filter_on_meta_with_idx_0.plan
+++ 
b/asterixdb/asterix-app/src/test/resources/optimizerts/results/filter_on_meta_with_idx_0.plan
@@ -15,7 +15,7 @@ distribute result [$$34]
               order (ASC, $$50) (ASC, $$46) (ASC, $$47) (ASC, $$48) (ASC, $$49)
               -- STABLE_SORT [$$50(ASC), $$46(ASC), $$47(ASC), $$48(ASC), 
$$49(ASC)]  |PARTITIONED|
                 exchange
-                -- HASH_PARTITION_EXCHANGE [$$50]  |PARTITIONED|
+                -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                   select (spatial-intersect($$38, create-point($$46, $$47))) 
project: [$$t, $$50, $$46, $$47, $$48, $$49]
                   -- STREAM_SELECT  |PARTITIONED|
                     project ([$$t, $$38, $$46, $$47, $$48, $$49, $$50])
diff --git 
a/asterixdb/asterix-app/src/test/resources/optimizerts/results/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_01_ps.plan
 
b/asterixdb/asterix-app/src/test/resources/optimizerts/results/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_01_ps.plan
index db51423e97..a6df03a722 100644
--- 
a/asterixdb/asterix-app/src/test/resources/optimizerts/results/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_01_ps.plan
+++ 
b/asterixdb/asterix-app/src/test/resources/optimizerts/results/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_01_ps.plan
@@ -46,7 +46,7 @@ distribute result [$$53]
                                     order (ASC, $$58) (ASC, $$72) (ASC, $$73) 
(ASC, $$74) (ASC, $$75)
                                     -- STABLE_SORT [$$58(ASC), $$72(ASC), 
$$73(ASC), $$74(ASC), $$75(ASC)]  |PARTITIONED|
                                       exchange
-                                      -- HASH_PARTITION_EXCHANGE [$$58]  
|PARTITIONED|
+                                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                         select (spatial-intersect($$77, $$n)) 
retain-untrue ($$58 <- missing) project: [$$56, $$58, $$77, $$57, $$72, $$73, 
$$74, $$75]
                                         -- STREAM_SELECT  |PARTITIONED|
                                           assign [$$77] <- [create-point($$72, 
$$73)]
@@ -119,7 +119,7 @@ distribute result [$$53]
                                               order (ASC, $$58) (ASC, $$72) 
(ASC, $$73) (ASC, $$74) (ASC, $$75)
                                               -- STABLE_SORT [$$58(ASC), 
$$72(ASC), $$73(ASC), $$74(ASC), $$75(ASC)]  |PARTITIONED|
                                                 exchange
-                                                -- HASH_PARTITION_EXCHANGE 
[$$58]  |PARTITIONED|
+                                                -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
                                                   select 
(spatial-intersect($$77, $$n)) retain-untrue ($$58 <- missing) project: [$$56, 
$$58, $$77, $$57, $$72, $$73, $$74, $$75]
                                                   -- STREAM_SELECT  
|PARTITIONED|
                                                     assign [$$77] <- 
[create-point($$72, $$73)]
diff --git 
a/asterixdb/asterix-app/src/test/resources/optimizerts/results_cbo/ASTERIXDB-2402.plan
 
b/asterixdb/asterix-app/src/test/resources/optimizerts/results_cbo/ASTERIXDB-2402.plan
index 92ea3c5668..85d37d9d9c 100644
--- 
a/asterixdb/asterix-app/src/test/resources/optimizerts/results_cbo/ASTERIXDB-2402.plan
+++ 
b/asterixdb/asterix-app/src/test/resources/optimizerts/results_cbo/ASTERIXDB-2402.plan
@@ -133,7 +133,7 @@ distribute result [$$227]
                                                                     order 
(ASC, $$236) (ASC, $$285) (ASC, $$286) (ASC, $$287) (ASC, $$288)
                                                                     -- 
STABLE_SORT [$$236(ASC), $$285(ASC), $$286(ASC), $$287(ASC), $$288(ASC)]  
|PARTITIONED|
                                                                       exchange
-                                                                      -- 
HASH_PARTITION_EXCHANGE [$$236]  |PARTITIONED|
+                                                                      -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                                         select 
(spatial-intersect($$290, $$244)) retain-untrue ($$236 <- missing)
                                                                         -- 
STREAM_SELECT  |PARTITIONED|
                                                                           
assign [$$290] <- [create-point($$285, $$286)]
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-only-testcases/index-only-with-Meta/index-only-with-Meta.1.ddl.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-only-testcases/index-only-with-Meta/index-only-with-Meta.1.ddl.sqlpp
new file mode 100644
index 0000000000..493edf534c
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-only-testcases/index-only-with-Meta/index-only-with-Meta.1.ddl.sqlpp
@@ -0,0 +1,68 @@
+/*
+ * 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 test if exists;
+CREATE DATAVERSE test;
+USE test;
+
+CREATE TYPE DataType AS {
+    name:string,
+    age:int};
+
+CREATE TYPE MetaType AS {
+    id:int
+};
+
+CREATE DATASET DS(DataType) WITH META(MetaType)
+PRIMARY KEY META().id;
+
+CREATE DATASET DS2(DataType)
+PRIMARY KEY age;
+
+CREATE FEED DsStream WITH {
+ "adapter-name" : "localfs",
+ "reader" : "localfs",
+ "parser" : "record-with-metadata",
+ "type-name" : "DataType",
+ "meta-type-name" : "MetaType",
+ "path" : "asterix_nc1://data/csv/people.csv",
+ "format" : "csv",
+ "delimiter" : ",",
+ "record-format" : "adm",
+ "record-index" : "1",
+ "key-indexes" : "0",
+ "key-indicators" : "1",
+ "header" : "false"
+};
+
+CREATE FEED DsStream2 WITH {
+ "adapter-name" : "localfs",
+ "reader" : "localfs",
+ "parser" : "record-with-metadata",
+ "type-name" : "DataType",
+ "meta-type-name" : "MetaType",
+ "path" : "asterix_nc1://data/csv/people3.csv",
+ "format" : "csv",
+ "delimiter" : ",",
+ "record-format" : "adm",
+ "record-index" : "1",
+ "key-indexes" : "0",
+ "key-indicators" : "1",
+ "header" : "false"
+};
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-only-testcases/index-only-with-Meta/index-only-with-Meta.2.update.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-only-testcases/index-only-with-Meta/index-only-with-Meta.2.update.sqlpp
new file mode 100644
index 0000000000..91e4cf42f7
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-only-testcases/index-only-with-Meta/index-only-with-Meta.2.update.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.
+ */
+
+use test;
+
+SET `wait-for-completion-feed` "true";
+CONNECT FEED DsStream TO DATASET DS;
+START FEED DsStream;
+
+insert into DS2 ( {"id":1,"name":"name1","age":32} );
+
+CREATE INDEX age_idx ON DS(age);
+CREATE INDEX name_idx ON DS(name);
+
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-only-testcases/index-only-with-Meta/index-only-with-Meta.3.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-only-testcases/index-only-with-Meta/index-only-with-Meta.3.query.sqlpp
new file mode 100644
index 0000000000..86a3fa4f30
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-only-testcases/index-only-with-Meta/index-only-with-Meta.3.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;
+
+
+select age
+from DS
+where age > 25
+order by age;
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-only-testcases/index-only-with-Meta/index-only-with-Meta.4.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-only-testcases/index-only-with-Meta/index-only-with-Meta.4.query.sqlpp
new file mode 100644
index 0000000000..802c81240d
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-only-testcases/index-only-with-Meta/index-only-with-Meta.4.query.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * 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;
+
+
+explain select age
+from DS
+where age > 25;
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-only-testcases/index-only-with-Meta/index-only-with-Meta.5.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-only-testcases/index-only-with-Meta/index-only-with-Meta.5.query.sqlpp
new file mode 100644
index 0000000000..8dad0eee91
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-only-testcases/index-only-with-Meta/index-only-with-Meta.5.query.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * 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;
+
+
+select d.age
+from DS d,DS2 d2
+where d.age>30 and d.age = d2.age;
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-only-testcases/index-only-with-Meta/index-only-with-Meta.6.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-only-testcases/index-only-with-Meta/index-only-with-Meta.6.query.sqlpp
new file mode 100644
index 0000000000..aa31f2da02
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-only-testcases/index-only-with-Meta/index-only-with-Meta.6.query.sqlpp
@@ -0,0 +1,24 @@
+/*
+ * 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;
+
+explain select d.age
+from DS d,DS2 d2
+where d.age>30 and d.age = d2.age;
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
index 1c5408cf9c..6215321db5 100644
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
@@ -23,7 +23,7 @@ distribute result [$$34] [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-c
                       order (ASC, $$36) (ASC, $$39) [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
                       -- STABLE_SORT [$$36(ASC), $$39(ASC)]  |PARTITIONED|
                         exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 
0.0, total-cost: 0.0]
-                        -- HASH_PARTITION_EXCHANGE [$$36]  |PARTITIONED|
+                        -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                           select (gt($$39, 3)) [cardinality: 0.0, doc-size: 
0.0, op-cost: 0.0, total-cost: 0.0]
                           -- STREAM_SELECT  |PARTITIONED|
                             exchange [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/index-only-with-Meta/index-only-with-Meta.3.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/index-only-with-Meta/index-only-with-Meta.3.adm
new file mode 100644
index 0000000000..a1aa812b32
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/index-only-with-Meta/index-only-with-Meta.3.adm
@@ -0,0 +1,8 @@
+{ "age": 28 }
+{ "age": 29 }
+{ "age": 30 }
+{ "age": 32 }
+{ "age": 35 }
+{ "age": 36 }
+{ "age": 40 }
+{ "age": 45 }
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/index-only-with-Meta/index-only-with-Meta.4.plan
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/index-only-with-Meta/index-only-with-Meta.4.plan
new file mode 100644
index 0000000000..b044261967
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/index-only-with-Meta/index-only-with-Meta.4.plan
@@ -0,0 +1,30 @@
+distribute result [$$17] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+-- DISTRIBUTE_RESULT  |PARTITIONED|
+  exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
+  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+    assign [$$17] <- [{"age": $$18}] project: [$$17] [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
+    -- ASSIGN  |PARTITIONED|
+      project ([$$18]) [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|
+          distinct ([$$23]) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+          -- PRE_SORTED_DISTINCT_BY  |PARTITIONED|
+            exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+              order (ASC, $$23) [cardinality: 0.0, doc-size: 0.0, op-cost: 
0.0, total-cost: 0.0]
+              -- STABLE_SORT [$$23(ASC)]  |PARTITIONED|
+                exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+                -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                  select (gt($$18, 25)) [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                  -- STREAM_SELECT  |PARTITIONED|
+                    exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+                    -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                      unnest-map [$$18, $$23] <- index-search("age_idx", 0, 
"Default", "test", "DS", false, false, 1, $$21, 0, false, true, false) 
[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 [$$21] <- [25] [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|
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/index-only-with-Meta/index-only-with-Meta.5.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/index-only-with-Meta/index-only-with-Meta.5.adm
new file mode 100644
index 0000000000..069873dbf4
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/index-only-with-Meta/index-only-with-Meta.5.adm
@@ -0,0 +1 @@
+{ "age": 32 }
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/index-only-with-Meta/index-only-with-Meta.6.plan
similarity index 57%
copy from 
asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
copy to 
asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/index-only-with-Meta/index-only-with-Meta.6.plan
index 1c5408cf9c..306d7eca08 100644
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/index-only-with-Meta/index-only-with-Meta.6.plan
@@ -1,48 +1,48 @@
-distribute result [$$34] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+distribute result [$$33] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, 
total-cost: 0.0]
 -- DISTRIBUTE_RESULT  |PARTITIONED|
   exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-    assign [$$34] <- [{"cid": $$36, "oid": $$37}] project: [$$34] 
[cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
+    assign [$$33] <- [{"age": $$34}] project: [$$33] [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
     -- ASSIGN  |PARTITIONED|
-      project ([$$36, $$37]) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+      project ([$$34]) [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|
-          join (eq($$38, $$36)) [cardinality: 0.0, doc-size: 0.0, op-cost: 
0.0, total-cost: 0.0]
-          -- HYBRID_HASH_JOIN [$$36][$$38]  |PARTITIONED|
+          join (eq($$34, $$37)) [cardinality: 0.0, doc-size: 0.0, op-cost: 
0.0, total-cost: 0.0]
+          -- HYBRID_HASH_JOIN [$$34][$$37]  |PARTITIONED|
             exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, 
total-cost: 0.0]
-            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-              select ($$44) project: [$$36] [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+            -- HASH_PARTITION_EXCHANGE [$$34]  |PARTITIONED|
+              select ($$42) project: [$$34] [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
               -- STREAM_SELECT  |PARTITIONED|
-                project ([$$36, $$44]) [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                project ([$$34, $$42]) [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
                 -- STREAM_PROJECT  |PARTITIONED|
-                  window-aggregate [$$44] <- [win-mark-valid-tuple-impl($$39)] 
partition [$$36] order (ASC, $$39) [cardinality: 0.0, doc-size: 0.0, op-cost: 
0.0, total-cost: 0.0]
+                  window-aggregate [$$42] <- [win-mark-valid-tuple-impl($$34)] 
partition [$$41] order (ASC, $$34) [cardinality: 0.0, doc-size: 0.0, op-cost: 
0.0, total-cost: 0.0]
                   -- WINDOW_STREAM  |PARTITIONED|
                     exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, 
total-cost: 0.0]
                     -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                      order (ASC, $$36) (ASC, $$39) [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
-                      -- STABLE_SORT [$$36(ASC), $$39(ASC)]  |PARTITIONED|
+                      order (ASC, $$41) (ASC, $$34) [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
+                      -- STABLE_SORT [$$41(ASC), $$34(ASC)]  |PARTITIONED|
                         exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 
0.0, total-cost: 0.0]
-                        -- HASH_PARTITION_EXCHANGE [$$36]  |PARTITIONED|
-                          select (gt($$39, 3)) [cardinality: 0.0, doc-size: 
0.0, op-cost: 0.0, total-cost: 0.0]
+                        -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                          select (gt($$34, 30)) [cardinality: 0.0, doc-size: 
0.0, op-cost: 0.0, total-cost: 0.0]
                           -- STREAM_SELECT  |PARTITIONED|
                             exchange [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
                             -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                              unnest-map [$$39, $$36] <- 
index-search("CustomerAge_idx", 0, "Default", "test", "Customers", false, 
false, 1, $$41, 0, false, true, false) [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                              unnest-map [$$34, $$41] <- 
index-search("age_idx", 0, "Default", "test", "DS", false, false, 1, $$39, 0, 
false, true, false) [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 [$$41] <- [3] [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
+                                  assign [$$39] <- [30] [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]
-            -- HASH_PARTITION_EXCHANGE [$$38]  |PARTITIONED|
-              assign [$$38] <- [$$o.getField(1)] project: [$$37, $$38] 
[cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
-              -- ASSIGN  |PARTITIONED|
+            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+              project ([$$37]) [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|
-                  data-scan []<-[$$37, $$o] <- test.Orders [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
+                  data-scan []<-[$$37, $$d2] <- test.DS2 [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
                   -- DATASOURCE_SCAN  |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/leftouterjoin/index-only-leftouterjoin/index-only-leftouterjoin.008.plan
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/leftouterjoin/index-only-leftouterjoin/index-only-leftouterjoin.008.plan
index 30936eb871..b5293f0fea 100644
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/leftouterjoin/index-only-leftouterjoin/index-only-leftouterjoin.008.plan
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/leftouterjoin/index-only-leftouterjoin/index-only-leftouterjoin.008.plan
@@ -31,7 +31,7 @@ distribute result [$$52] [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-c
                               order (ASC, $$54) (ASC, $$56) [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
                               -- STABLE_SORT [$$54(ASC), $$56(ASC)]  
|PARTITIONED|
                                 exchange [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
-                                -- HASH_PARTITION_EXCHANGE [$$54]  
|PARTITIONED|
+                                -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                   select (eq($$55, $$56)) retain-untrue ($$54 
<- missing) project: [$$53, $$54, $$56] [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
                                   -- STREAM_SELECT  |PARTITIONED|
                                     exchange [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/leftouterjoin/index-only-leftouterjoin/index-only-leftouterjoin.010.plan
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/leftouterjoin/index-only-leftouterjoin/index-only-leftouterjoin.010.plan
index c0957b3463..f6ac275539 100644
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/leftouterjoin/index-only-leftouterjoin/index-only-leftouterjoin.010.plan
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/leftouterjoin/index-only-leftouterjoin/index-only-leftouterjoin.010.plan
@@ -31,7 +31,7 @@ distribute result [$$52] [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-c
                               order (ASC, $$54) (ASC, $$56) [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
                               -- STABLE_SORT [$$54(ASC), $$56(ASC)]  
|PARTITIONED|
                                 exchange [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
-                                -- HASH_PARTITION_EXCHANGE [$$54]  
|PARTITIONED|
+                                -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                   select (eq($$55, $$56)) retain-untrue ($$54 
<- missing) project: [$$53, $$54, $$56] [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
                                   -- STREAM_SELECT  |PARTITIONED|
                                     exchange [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results_cbo/leftouterjoin/index-only-leftouterjoin/index-only-leftouterjoin.008.plan
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results_cbo/leftouterjoin/index-only-leftouterjoin/index-only-leftouterjoin.008.plan
index 94c5b94180..b13341e902 100644
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/results_cbo/leftouterjoin/index-only-leftouterjoin/index-only-leftouterjoin.008.plan
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results_cbo/leftouterjoin/index-only-leftouterjoin/index-only-leftouterjoin.008.plan
@@ -31,7 +31,7 @@ distribute result [$$52] [cardinality: 6.0, doc-size: 15.0, 
op-cost: 0.0, total-
                               order (ASC, $$54) (ASC, $$56) [cardinality: 2.0, 
doc-size: 15.0, op-cost: 0.0, total-cost: 2.0]
                               -- STABLE_SORT [$$54(ASC), $$56(ASC)]  
|PARTITIONED|
                                 exchange [cardinality: 2.0, doc-size: 15.0, 
op-cost: 0.0, total-cost: 2.0]
-                                -- HASH_PARTITION_EXCHANGE [$$54]  
|PARTITIONED|
+                                -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                   select (eq($$55, $$56)) retain-untrue ($$54 
<- missing) project: [$$53, $$54, $$56] [cardinality: 2.0, doc-size: 15.0, 
op-cost: 0.0, total-cost: 2.0]
                                   -- STREAM_SELECT  |PARTITIONED|
                                     exchange [cardinality: 2.0, doc-size: 
15.0, op-cost: 0.0, total-cost: 2.0]
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results_cbo/leftouterjoin/index-only-leftouterjoin/index-only-leftouterjoin.010.plan
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results_cbo/leftouterjoin/index-only-leftouterjoin/index-only-leftouterjoin.010.plan
index c1b27c8a11..c1074bff4d 100644
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/results_cbo/leftouterjoin/index-only-leftouterjoin/index-only-leftouterjoin.010.plan
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results_cbo/leftouterjoin/index-only-leftouterjoin/index-only-leftouterjoin.010.plan
@@ -31,7 +31,7 @@ distribute result [$$52] [cardinality: 6.0, doc-size: 15.0, 
op-cost: 0.0, total-
                               order (ASC, $$54) (ASC, $$56) [cardinality: 2.0, 
doc-size: 15.0, op-cost: 0.0, total-cost: 2.0]
                               -- STABLE_SORT [$$54(ASC), $$56(ASC)]  
|PARTITIONED|
                                 exchange [cardinality: 2.0, doc-size: 15.0, 
op-cost: 0.0, total-cost: 2.0]
-                                -- HASH_PARTITION_EXCHANGE [$$54]  
|PARTITIONED|
+                                -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                   select (eq($$55, $$56)) retain-untrue ($$54 
<- missing) project: [$$53, $$54, $$56] [cardinality: 2.0, doc-size: 15.0, 
op-cost: 0.0, total-cost: 2.0]
                                   -- STREAM_SELECT  |PARTITIONED|
                                     exchange [cardinality: 2.0, doc-size: 
15.0, op-cost: 0.0, total-cost: 2.0]
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results_column/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results_column/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
index b4c7a1b911..130c50f1fb 100644
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/results_column/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results_column/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
@@ -23,7 +23,7 @@ distribute result [$$34] [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-c
                       order (ASC, $$36) (ASC, $$39) [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
                       -- STABLE_SORT [$$36(ASC), $$39(ASC)]  |PARTITIONED|
                         exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 
0.0, total-cost: 0.0]
-                        -- HASH_PARTITION_EXCHANGE [$$36]  |PARTITIONED|
+                        -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                           select (gt($$39, 3)) [cardinality: 0.0, doc-size: 
0.0, op-cost: 0.0, total-cost: 0.0]
                           -- STREAM_SELECT  |PARTITIONED|
                             exchange [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results_column/index-only-testcases/index-only-with-Meta/index-only-with-Meta.6.plan
similarity index 57%
copy from 
asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
copy to 
asterixdb/asterix-app/src/test/resources/runtimets/results_column/index-only-testcases/index-only-with-Meta/index-only-with-Meta.6.plan
index 1c5408cf9c..3bafe90442 100644
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results_column/index-only-testcases/index-only-with-Meta/index-only-with-Meta.6.plan
@@ -1,48 +1,48 @@
-distribute result [$$34] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+distribute result [$$33] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, 
total-cost: 0.0]
 -- DISTRIBUTE_RESULT  |PARTITIONED|
   exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-    assign [$$34] <- [{"cid": $$36, "oid": $$37}] project: [$$34] 
[cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
+    assign [$$33] <- [{"age": $$34}] project: [$$33] [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
     -- ASSIGN  |PARTITIONED|
-      project ([$$36, $$37]) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+      project ([$$34]) [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|
-          join (eq($$38, $$36)) [cardinality: 0.0, doc-size: 0.0, op-cost: 
0.0, total-cost: 0.0]
-          -- HYBRID_HASH_JOIN [$$36][$$38]  |PARTITIONED|
+          join (eq($$34, $$37)) [cardinality: 0.0, doc-size: 0.0, op-cost: 
0.0, total-cost: 0.0]
+          -- HYBRID_HASH_JOIN [$$34][$$37]  |PARTITIONED|
             exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, 
total-cost: 0.0]
-            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-              select ($$44) project: [$$36] [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+            -- HASH_PARTITION_EXCHANGE [$$34]  |PARTITIONED|
+              select ($$42) project: [$$34] [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
               -- STREAM_SELECT  |PARTITIONED|
-                project ([$$36, $$44]) [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                project ([$$34, $$42]) [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
                 -- STREAM_PROJECT  |PARTITIONED|
-                  window-aggregate [$$44] <- [win-mark-valid-tuple-impl($$39)] 
partition [$$36] order (ASC, $$39) [cardinality: 0.0, doc-size: 0.0, op-cost: 
0.0, total-cost: 0.0]
+                  window-aggregate [$$42] <- [win-mark-valid-tuple-impl($$34)] 
partition [$$41] order (ASC, $$34) [cardinality: 0.0, doc-size: 0.0, op-cost: 
0.0, total-cost: 0.0]
                   -- WINDOW_STREAM  |PARTITIONED|
                     exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, 
total-cost: 0.0]
                     -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                      order (ASC, $$36) (ASC, $$39) [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
-                      -- STABLE_SORT [$$36(ASC), $$39(ASC)]  |PARTITIONED|
+                      order (ASC, $$41) (ASC, $$34) [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
+                      -- STABLE_SORT [$$41(ASC), $$34(ASC)]  |PARTITIONED|
                         exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 
0.0, total-cost: 0.0]
-                        -- HASH_PARTITION_EXCHANGE [$$36]  |PARTITIONED|
-                          select (gt($$39, 3)) [cardinality: 0.0, doc-size: 
0.0, op-cost: 0.0, total-cost: 0.0]
+                        -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                          select (gt($$34, 30)) [cardinality: 0.0, doc-size: 
0.0, op-cost: 0.0, total-cost: 0.0]
                           -- STREAM_SELECT  |PARTITIONED|
                             exchange [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
                             -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                              unnest-map [$$39, $$36] <- 
index-search("CustomerAge_idx", 0, "Default", "test", "Customers", false, 
false, 1, $$41, 0, false, true, false) [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                              unnest-map [$$34, $$41] <- 
index-search("age_idx", 0, "Default", "test", "DS", false, false, 1, $$39, 0, 
false, true, false) [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 [$$41] <- [3] [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
+                                  assign [$$39] <- [30] [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]
-            -- HASH_PARTITION_EXCHANGE [$$38]  |PARTITIONED|
-              assign [$$38] <- [$$o.getField(1)] project: [$$37, $$38] 
[cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
-              -- ASSIGN  |PARTITIONED|
+            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+              project ([$$37]) [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|
-                  data-scan []<-[$$37, $$o] <- test.Orders [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
+                  data-scan []<-[$$37, $$d2] <- test.DS2 project ({}) 
[cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
                   -- DATASOURCE_SCAN  |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/leftouterjoin/index-only-leftouterjoin/index-only-leftouterjoin.008.plan
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results_column/leftouterjoin/index-only-leftouterjoin/index-only-leftouterjoin.008.plan
index 42836a2254..cec5432f89 100644
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/results_column/leftouterjoin/index-only-leftouterjoin/index-only-leftouterjoin.008.plan
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results_column/leftouterjoin/index-only-leftouterjoin/index-only-leftouterjoin.008.plan
@@ -31,7 +31,7 @@ distribute result [$$52] [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-c
                               order (ASC, $$54) (ASC, $$56) [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
                               -- STABLE_SORT [$$54(ASC), $$56(ASC)]  
|PARTITIONED|
                                 exchange [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
-                                -- HASH_PARTITION_EXCHANGE [$$54]  
|PARTITIONED|
+                                -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                   select (eq($$55, $$56)) retain-untrue ($$54 
<- missing) project: [$$53, $$54, $$56] [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
                                   -- STREAM_SELECT  |PARTITIONED|
                                     exchange [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results_column/leftouterjoin/index-only-leftouterjoin/index-only-leftouterjoin.010.plan
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results_column/leftouterjoin/index-only-leftouterjoin/index-only-leftouterjoin.010.plan
index 91c27a7eb6..976c8b1308 100644
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/results_column/leftouterjoin/index-only-leftouterjoin/index-only-leftouterjoin.010.plan
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results_column/leftouterjoin/index-only-leftouterjoin/index-only-leftouterjoin.010.plan
@@ -31,7 +31,7 @@ distribute result [$$52] [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-c
                               order (ASC, $$54) (ASC, $$56) [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
                               -- STABLE_SORT [$$54(ASC), $$56(ASC)]  
|PARTITIONED|
                                 exchange [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
-                                -- HASH_PARTITION_EXCHANGE [$$54]  
|PARTITIONED|
+                                -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                   select (eq($$55, $$56)) retain-untrue ($$54 
<- missing) project: [$$53, $$54, $$56] [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
                                   -- STREAM_SELECT  |PARTITIONED|
                                     exchange [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results_full_parallelism/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
similarity index 100%
copy from 
asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
copy to 
asterixdb/asterix-app/src/test/resources/runtimets/results_full_parallelism/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results_full_parallelism/index-only-testcases/index-only-with-Meta/index-only-with-Meta.6.plan
similarity index 56%
copy from 
asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
copy to 
asterixdb/asterix-app/src/test/resources/runtimets/results_full_parallelism/index-only-testcases/index-only-with-Meta/index-only-with-Meta.6.plan
index 1c5408cf9c..5fbbba8174 100644
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results_full_parallelism/index-only-testcases/index-only-with-Meta/index-only-with-Meta.6.plan
@@ -1,48 +1,48 @@
-distribute result [$$34] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+distribute result [$$33] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, 
total-cost: 0.0]
 -- DISTRIBUTE_RESULT  |PARTITIONED|
   exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-    assign [$$34] <- [{"cid": $$36, "oid": $$37}] project: [$$34] 
[cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
+    assign [$$33] <- [{"age": $$34}] project: [$$33] [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
     -- ASSIGN  |PARTITIONED|
-      project ([$$36, $$37]) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+      project ([$$34]) [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|
-          join (eq($$38, $$36)) [cardinality: 0.0, doc-size: 0.0, op-cost: 
0.0, total-cost: 0.0]
-          -- HYBRID_HASH_JOIN [$$36][$$38]  |PARTITIONED|
+          join (eq($$34, $$37)) [cardinality: 0.0, doc-size: 0.0, op-cost: 
0.0, total-cost: 0.0]
+          -- HYBRID_HASH_JOIN [$$34][$$37]  |PARTITIONED|
             exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, 
total-cost: 0.0]
-            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-              select ($$44) project: [$$36] [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+            -- HASH_PARTITION_EXCHANGE [$$34]  |PARTITIONED|
+              select ($$42) project: [$$34] [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
               -- STREAM_SELECT  |PARTITIONED|
-                project ([$$36, $$44]) [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                project ([$$34, $$42]) [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
                 -- STREAM_PROJECT  |PARTITIONED|
-                  window-aggregate [$$44] <- [win-mark-valid-tuple-impl($$39)] 
partition [$$36] order (ASC, $$39) [cardinality: 0.0, doc-size: 0.0, op-cost: 
0.0, total-cost: 0.0]
+                  window-aggregate [$$42] <- [win-mark-valid-tuple-impl($$34)] 
partition [$$41] order (ASC, $$34) [cardinality: 0.0, doc-size: 0.0, op-cost: 
0.0, total-cost: 0.0]
                   -- WINDOW_STREAM  |PARTITIONED|
                     exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, 
total-cost: 0.0]
                     -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                      order (ASC, $$36) (ASC, $$39) [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
-                      -- STABLE_SORT [$$36(ASC), $$39(ASC)]  |PARTITIONED|
+                      order (ASC, $$41) (ASC, $$34) [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
+                      -- STABLE_SORT [$$41(ASC), $$34(ASC)]  |PARTITIONED|
                         exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 
0.0, total-cost: 0.0]
-                        -- HASH_PARTITION_EXCHANGE [$$36]  |PARTITIONED|
-                          select (gt($$39, 3)) [cardinality: 0.0, doc-size: 
0.0, op-cost: 0.0, total-cost: 0.0]
+                        -- HASH_PARTITION_EXCHANGE [$$41]  |PARTITIONED|
+                          select (gt($$34, 30)) [cardinality: 0.0, doc-size: 
0.0, op-cost: 0.0, total-cost: 0.0]
                           -- STREAM_SELECT  |PARTITIONED|
                             exchange [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
                             -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                              unnest-map [$$39, $$36] <- 
index-search("CustomerAge_idx", 0, "Default", "test", "Customers", false, 
false, 1, $$41, 0, false, true, false) [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                              unnest-map [$$34, $$41] <- 
index-search("age_idx", 0, "Default", "test", "DS", false, false, 1, $$39, 0, 
false, true, false) [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 [$$41] <- [3] [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
+                                  assign [$$39] <- [30] [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]
-            -- HASH_PARTITION_EXCHANGE [$$38]  |PARTITIONED|
-              assign [$$38] <- [$$o.getField(1)] project: [$$37, $$38] 
[cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
-              -- ASSIGN  |PARTITIONED|
+            -- HASH_PARTITION_EXCHANGE [$$37]  |PARTITIONED|
+              project ([$$37]) [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|
-                  data-scan []<-[$$37, $$o] <- test.Orders [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
+                  data-scan []<-[$$37, $$d2] <- test.DS2 [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
                   -- DATASOURCE_SCAN  |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/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results_less_parallelism/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
similarity index 100%
copy from 
asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
copy to 
asterixdb/asterix-app/src/test/resources/runtimets/results_less_parallelism/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results_less_parallelism/index-only-testcases/index-only-with-Meta/index-only-with-Meta.6.plan
similarity index 56%
copy from 
asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
copy to 
asterixdb/asterix-app/src/test/resources/runtimets/results_less_parallelism/index-only-testcases/index-only-with-Meta/index-only-with-Meta.6.plan
index 1c5408cf9c..5fbbba8174 100644
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/index-only-testcases/heterogeneous-index-only-compund-keys/heterogeneous-index-only-compund-keys.6.plan
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results_less_parallelism/index-only-testcases/index-only-with-Meta/index-only-with-Meta.6.plan
@@ -1,48 +1,48 @@
-distribute result [$$34] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+distribute result [$$33] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, 
total-cost: 0.0]
 -- DISTRIBUTE_RESULT  |PARTITIONED|
   exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-    assign [$$34] <- [{"cid": $$36, "oid": $$37}] project: [$$34] 
[cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
+    assign [$$33] <- [{"age": $$34}] project: [$$33] [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
     -- ASSIGN  |PARTITIONED|
-      project ([$$36, $$37]) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+      project ([$$34]) [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|
-          join (eq($$38, $$36)) [cardinality: 0.0, doc-size: 0.0, op-cost: 
0.0, total-cost: 0.0]
-          -- HYBRID_HASH_JOIN [$$36][$$38]  |PARTITIONED|
+          join (eq($$34, $$37)) [cardinality: 0.0, doc-size: 0.0, op-cost: 
0.0, total-cost: 0.0]
+          -- HYBRID_HASH_JOIN [$$34][$$37]  |PARTITIONED|
             exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, 
total-cost: 0.0]
-            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-              select ($$44) project: [$$36] [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+            -- HASH_PARTITION_EXCHANGE [$$34]  |PARTITIONED|
+              select ($$42) project: [$$34] [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
               -- STREAM_SELECT  |PARTITIONED|
-                project ([$$36, $$44]) [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                project ([$$34, $$42]) [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
                 -- STREAM_PROJECT  |PARTITIONED|
-                  window-aggregate [$$44] <- [win-mark-valid-tuple-impl($$39)] 
partition [$$36] order (ASC, $$39) [cardinality: 0.0, doc-size: 0.0, op-cost: 
0.0, total-cost: 0.0]
+                  window-aggregate [$$42] <- [win-mark-valid-tuple-impl($$34)] 
partition [$$41] order (ASC, $$34) [cardinality: 0.0, doc-size: 0.0, op-cost: 
0.0, total-cost: 0.0]
                   -- WINDOW_STREAM  |PARTITIONED|
                     exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, 
total-cost: 0.0]
                     -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                      order (ASC, $$36) (ASC, $$39) [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
-                      -- STABLE_SORT [$$36(ASC), $$39(ASC)]  |PARTITIONED|
+                      order (ASC, $$41) (ASC, $$34) [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
+                      -- STABLE_SORT [$$41(ASC), $$34(ASC)]  |PARTITIONED|
                         exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 
0.0, total-cost: 0.0]
-                        -- HASH_PARTITION_EXCHANGE [$$36]  |PARTITIONED|
-                          select (gt($$39, 3)) [cardinality: 0.0, doc-size: 
0.0, op-cost: 0.0, total-cost: 0.0]
+                        -- HASH_PARTITION_EXCHANGE [$$41]  |PARTITIONED|
+                          select (gt($$34, 30)) [cardinality: 0.0, doc-size: 
0.0, op-cost: 0.0, total-cost: 0.0]
                           -- STREAM_SELECT  |PARTITIONED|
                             exchange [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
                             -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                              unnest-map [$$39, $$36] <- 
index-search("CustomerAge_idx", 0, "Default", "test", "Customers", false, 
false, 1, $$41, 0, false, true, false) [cardinality: 0.0, doc-size: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                              unnest-map [$$34, $$41] <- 
index-search("age_idx", 0, "Default", "test", "DS", false, false, 1, $$39, 0, 
false, true, false) [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 [$$41] <- [3] [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
+                                  assign [$$39] <- [30] [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]
-            -- HASH_PARTITION_EXCHANGE [$$38]  |PARTITIONED|
-              assign [$$38] <- [$$o.getField(1)] project: [$$37, $$38] 
[cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
-              -- ASSIGN  |PARTITIONED|
+            -- HASH_PARTITION_EXCHANGE [$$37]  |PARTITIONED|
+              project ([$$37]) [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|
-                  data-scan []<-[$$37, $$o] <- test.Orders [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
+                  data-scan []<-[$$37, $$d2] <- test.DS2 [cardinality: 0.0, 
doc-size: 0.0, op-cost: 0.0, total-cost: 0.0]
                   -- DATASOURCE_SCAN  |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/sqlpp_queries.xml 
b/asterixdb/asterix-app/src/test/resources/runtimets/sqlpp_queries.xml
index 4b25455a0e..242238ff9a 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/sqlpp_queries.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/sqlpp_queries.xml
@@ -6763,6 +6763,11 @@
         <output-dir compare="Text">simple-index-only-rtree</output-dir>
       </compilation-unit>
     </test-case>
+    <test-case FilePath="index-only-testcases">
+      <compilation-unit name="index-only-with-Meta">
+        <output-dir compare="Text">index-only-with-Meta</output-dir>
+      </compilation-unit>
+    </test-case>
   </test-group>
   <test-group name="inverted-index-join">
     <test-case FilePath="inverted-index-join">

Reply via email to