http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-secondary-index-non-indexonly-plan-01/btree-secondary-index-non-indexonly-plan-01.2.update.sqlpp
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-secondary-index-non-indexonly-plan-01/btree-secondary-index-non-indexonly-plan-01.2.update.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-secondary-index-non-indexonly-plan-01/btree-secondary-index-non-indexonly-plan-01.2.update.sqlpp
new file mode 100644
index 0000000..37358b5
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-secondary-index-non-indexonly-plan-01/btree-secondary-index-non-indexonly-plan-01.2.update.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;
+
+load dataset MyData
+using localfs
+(("path"="asterix_nc1://data/spatial/spatialData2.json"),("format"="adm"));
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-secondary-index-non-indexonly-plan-01/btree-secondary-index-non-indexonly-plan-01.3.query.sqlpp
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-secondary-index-non-indexonly-plan-01/btree-secondary-index-non-indexonly-plan-01.3.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-secondary-index-non-indexonly-plan-01/btree-secondary-index-non-indexonly-plan-01.3.query.sqlpp
new file mode 100644
index 0000000..33888ee
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-secondary-index-non-indexonly-plan-01/btree-secondary-index-non-indexonly-plan-01.3.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 value count(*) from (
+select element {"pk":o.id, "sk":o.point}
+from MyData o
+where o.docid < 10 and o.val1 < 3) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.1.ddl.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.1.ddl.sqlpp
new file mode 100644
index 0000000..fe845b8
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.1.ddl.sqlpp
@@ -0,0 +1,107 @@
+/*
+ * 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.
+ */
+
+/*
+ *  Description     : Secondary RTree Index index-only selection plan 
verification test
+ *                  : The test is intended to verify that the secondary RTree 
index is used in the optimized query plan.
+ *                  : In this plan, we fetch PK and SK based on a select 
condition that utilizes a secondary index.
+ *                  : The plan should have two paths after the secondary 
index-lookup.
+ *                  : The left path:
+ *                      ... -> unnest-map (sidx) -> split -> unnest-map (pidx) 
-> select -> union -> ...
+ *                  : The right path:
+ *                      ... -> unnest-map (sidx) -> split ->                   
             union -> ...
+ *  Expected Result : Success
+ *
+*/
+
+drop dataverse test if exists;
+create dataverse test;
+use test;
+
+/* For raw Fragile data */
+create type FragileTypeRaw as closed {
+  row_id: int32,
+  sid: int32,
+  date: string,
+  day: int32,
+  time: string,
+  bpm: int32,
+  RR: float,
+  /* new string field and location field*/
+  text: string,
+  location: point,
+  text2: string
+
+};
+
+/* For cleaned Fragile data */
+create type FragileType as closed {
+  row_id: int32,
+  sid: int32,
+  date: date,
+  day: int32,
+  time: time,
+  bpm: int32,
+  RR: float,
+
+  /* new string field and location field*/
+  text: string,
+  location: point,
+  text2: string
+};
+
+/* Create dataset for loading raw Fragile data */
+create dataset Fragile_raw (FragileTypeRaw)
+primary key row_id;
+
+/* Create dataset for cleaned Fragile data */
+create dataset Fragile (FragileType)
+primary key row_id;
+
+
+/* Create rtree secondary index on dataset clean Fragile */
+create index cfLocation on Fragile(location) type rtree;
+create index cfLocation on Fragile_raw(location) type rtree;
+
+create type MyRecord as closed {
+  id: int64,
+  docid: int64,
+  val1: int64,
+  title: string,
+  point: point,
+  kwds: string,
+  line1: line,
+  line2: line,
+  poly1: polygon,
+  poly2: polygon,
+  rec: rectangle,
+  circle: circle
+};
+
+create dataset MyData(MyRecord)
+  primary key id;
+
+create index btree_index_docid on MyData(docid) type btree;
+create index btree_index_val1 on MyData(val1) type btree;
+create index rtree_index_point on MyData(point) type rtree;
+create index rtree_index_rec on MyData(rec) type rtree;
+create index ngram_index_title on MyData(title) type ngram(3);
+create index keyword_index_title on MyData(title) type keyword;
+
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.10.query.sqlpp
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.10.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.10.query.sqlpp
new file mode 100644
index 0000000..234ec09
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.10.query.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+use test;
+
+with area as (test.`create-rectangle`(point("0.0,0.0"), point("4.0,4.0")))
+select value count(*) from (
+select o
+from MyData as o
+where test.`spatial-intersect`(o.point, area)
+order by o.id) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.11.query.sqlpp
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.11.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.11.query.sqlpp
new file mode 100644
index 0000000..d83edac
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.11.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;
+
+with area as (test.`create-circle`(test.`create-point`(4.0,3.0), 5.0))
+select element {"id":o.id}
+from MyData as o
+where test.`spatial-intersect`(o.point, area)
+order by o.id;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.2.update.sqlpp
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.2.update.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.2.update.sqlpp
new file mode 100644
index 0000000..aad34ef
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.2.update.sqlpp
@@ -0,0 +1,29 @@
+/*
+ * 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;
+
+
+load dataset Fragile_raw using localfs
+(("path"="asterix_nc1://data/csv/fragile_02.adm"),("format"="adm")) pre-sorted;
+
+load dataset MyData
+using localfs
+(("path"="asterix_nc1://data/spatial/spatialData2.json"),("format"="adm"));
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.3.query.sqlpp
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.3.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.3.query.sqlpp
new file mode 100644
index 0000000..437adc8
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.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 value count(*) from (
+select x
+from  Fragile_raw as x
+where test.`spatial-intersect`(x.location, test.`create-polygon`([0.0,0.0, 
2.0,2.0, 0.0,2.0, 2.0,0.0]))
+) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.4.query.sqlpp
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.4.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.4.query.sqlpp
new file mode 100644
index 0000000..b01f08f
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.4.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;
+
+with area as (test.`create-rectangle`(point("0.0,0.0"), point("4.0,4.0")))
+select element {"id":o.id}
+from MyData as o
+where test.`spatial-intersect`(o.point, area)
+order by o.id;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.5.query.sqlpp
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.5.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.5.query.sqlpp
new file mode 100644
index 0000000..c6bc5ae
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.5.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;
+
+with area as (test.`create-rectangle`(point("0.0,0.0"), point("4.0,4.0")))
+select element {"point":o.point}
+from MyData as o
+where test.`spatial-intersect`(o.point, area)
+order by o.id;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.6.query.sqlpp
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.6.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.6.query.sqlpp
new file mode 100644
index 0000000..2e38a96
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.6.query.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+use test;
+
+with area as (test.`create-rectangle`(point("0.0,0.0"), point("4.0,4.0")))
+select value count(*) from (
+select element {"id":o.id, "point":o.point}
+from MyData as o
+where test.`spatial-intersect`(o.point, area)
+order by o.id) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.7.query.sqlpp
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.7.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.7.query.sqlpp
new file mode 100644
index 0000000..fa5d2e0
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.7.query.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+use test;
+
+with area as (test.`create-rectangle`(point("0.0,0.0"), point("4.0,4.0")))
+select value count(*) from (
+select element {"id":o.id}
+from MyData as o
+where test.`spatial-intersect`(o.point, area)
+order by o.id) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.8.query.sqlpp
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.8.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.8.query.sqlpp
new file mode 100644
index 0000000..6bee297
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.8.query.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+use test;
+
+with area as (test.`create-rectangle`(point("0.0,0.0"), point("4.0,4.0")))
+select value count(*) from (
+select element {"point":o.point}
+from MyData as o
+where test.`spatial-intersect`(o.point, area)
+order by o.id) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.9.query.sqlpp
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.9.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.9.query.sqlpp
new file mode 100644
index 0000000..da070e6
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-secondary-index-indexonly-plan-01.9.query.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+use test;
+
+with area as (test.`create-rectangle`(point("0.0,0.0"), point("4.0,4.0")))
+select value count(*) from (
+select element {"rec":o, "id":o.id}
+from MyData as o
+where test.`spatial-intersect`(o.point, area)
+order by o.id) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-01/rtree-secondary-index-non-indexonly-plan-01.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-01/rtree-secondary-index-non-indexonly-plan-01.1.ddl.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-01/rtree-secondary-index-non-indexonly-plan-01.1.ddl.sqlpp
new file mode 100644
index 0000000..f5230ab
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-01/rtree-secondary-index-non-indexonly-plan-01.1.ddl.sqlpp
@@ -0,0 +1,56 @@
+/*
+ * 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.
+ */
+
+/*
+ *  Description     : Secondary full-text index index-only selection plan 
verification test
+ *                  : The test is intended to verify that the secondary RTree 
index is used in the optimized query plan.
+ *                  : In this plan, we have multiple conditions that one index 
can cover.
+ *                  : Thus, index-only plan is not possible.
+ *  Expected Result : Success
+ *
+*/
+
+drop dataverse test if exists;
+create dataverse test;
+use test;
+
+create type MyRecord as closed {
+  id: int64,
+  docid: int64,
+  val1: int64,
+  title: string,
+  point: point,
+  kwds: string,
+  line1: line,
+  line2: line,
+  poly1: polygon,
+  poly2: polygon,
+  rec: rectangle,
+  circle: circle
+};
+
+create dataset MyData(MyRecord)
+  primary key id;
+
+create index btree_index_docid on MyData(docid) type btree;
+create index btree_index_val1 on MyData(val1) type btree;
+create index rtree_index_point on MyData(point) type rtree;
+create index rtree_index_rec on MyData(rec) type rtree;
+create index ngram_index_title on MyData(title) type ngram(3);
+create index keyword_index_title on MyData(title) type keyword;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-01/rtree-secondary-index-non-indexonly-plan-01.2.update.sqlpp
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-01/rtree-secondary-index-non-indexonly-plan-01.2.update.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-01/rtree-secondary-index-non-indexonly-plan-01.2.update.sqlpp
new file mode 100644
index 0000000..bc705b2
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-01/rtree-secondary-index-non-indexonly-plan-01.2.update.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;
+
+load dataset MyData
+using localfs
+(("path"="asterix_nc1://data/spatial/spatialData2.json"),("format"="adm"));
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-01/rtree-secondary-index-non-indexonly-plan-01.3.query.sqlpp
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-01/rtree-secondary-index-non-indexonly-plan-01.3.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-01/rtree-secondary-index-non-indexonly-plan-01.3.query.sqlpp
new file mode 100644
index 0000000..8c1b943
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-01/rtree-secondary-index-non-indexonly-plan-01.3.query.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+use test;
+
+with area as (test.`create-rectangle`(point("0.0,0.0"), point("4.0,4.0")))
+select value count(*) from (
+select element {"id":o.id, "point":o.point}
+from MyData as o
+where test.`spatial-intersect`(o.point, area) and o.val1 < 30
+) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-secondary-index-non-indexonly-plan-02.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-secondary-index-non-indexonly-plan-02.1.ddl.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-secondary-index-non-indexonly-plan-02.1.ddl.sqlpp
new file mode 100644
index 0000000..f8a0b48
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-secondary-index-non-indexonly-plan-02.1.ddl.sqlpp
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+
+/*
+ *  Description     : Secondary full-text index index-only selection plan 
verification test
+ *                  : The test is intended to verify that the secondary RTree 
index is used in the optimized query plan.
+ *                  : In this plan, we have a condition that uses a R-Tree 
index on polygon fields.
+ *                  : Thus, index-only plan is not possible.
+ *  Expected Result : Success
+ *
+*/
+
+drop dataverse test if exists;
+create dataverse test;
+use test;
+
+create type MyRecord as closed {
+  id: int64,
+  docid: int64,
+  val1: int64,
+  title: string,
+  point: point,
+  kwds: string,
+  line1: line,
+  line2: line,
+  poly1: polygon,
+  poly2: polygon,
+  rec: rectangle,
+  circle: circle
+};
+
+create dataset MyData(MyRecord)
+  primary key id;
+
+create index btree_index_docid on MyData(docid) type btree;
+create index btree_index_val1 on MyData(val1) type btree;
+create index rtree_index_point on MyData(point) type rtree;
+create index rtree_index_rec on MyData(rec) type rtree;
+create index rtree_index_polygon on MyData(poly1) type rtree;
+create index ngram_index_title on MyData(title) type ngram(3);
+create index keyword_index_title on MyData(title) type keyword;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-secondary-index-non-indexonly-plan-02.2.update.sqlpp
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-secondary-index-non-indexonly-plan-02.2.update.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-secondary-index-non-indexonly-plan-02.2.update.sqlpp
new file mode 100644
index 0000000..bc705b2
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-secondary-index-non-indexonly-plan-02.2.update.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;
+
+load dataset MyData
+using localfs
+(("path"="asterix_nc1://data/spatial/spatialData2.json"),("format"="adm"));
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-secondary-index-non-indexonly-plan-02.3.query.sqlpp
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-secondary-index-non-indexonly-plan-02.3.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-secondary-index-non-indexonly-plan-02.3.query.sqlpp
new file mode 100644
index 0000000..35c4850
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-secondary-index-non-indexonly-plan-02.3.query.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+use test;
+
+with ps as [test.`point`("1.0,1.0"), test.`point`("3.0,3.0")]
+select value count(*) from (
+select element {"id":o.id, "point":o.point}
+from ps as p, MyData as o
+where test.`spatial-intersect`(p, o.poly1)
+) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/results/filters/load-with-secondary-btree-index-only/load-with-secondary-btree-index-only.1.adm
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/filters/load-with-secondary-btree-index-only/load-with-secondary-btree-index-only.1.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/filters/load-with-secondary-btree-index-only/load-with-secondary-btree-index-only.1.adm
new file mode 100644
index 0000000..39b8897
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/filters/load-with-secondary-btree-index-only/load-with-secondary-btree-index-only.1.adm
@@ -0,0 +1,15 @@
+{ "message-id": 1, "author-id": 3 }
+{ "message-id": 2, "author-id": 1 }
+{ "message-id": 3, "author-id": 2 }
+{ "message-id": 4, "author-id": 1 }
+{ "message-id": 5, "author-id": 6 }
+{ "message-id": 6, "author-id": 2 }
+{ "message-id": 7, "author-id": 5 }
+{ "message-id": 8, "author-id": 1 }
+{ "message-id": 9, "author-id": 3 }
+{ "message-id": 10, "author-id": 1 }
+{ "message-id": 11, "author-id": 1 }
+{ "message-id": 12, "author-id": 10 }
+{ "message-id": 13, "author-id": 10 }
+{ "message-id": 14, "author-id": 9 }
+{ "message-id": 15, "author-id": 7 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/btree-primary-to-secondary-indexonly-plan-equi-join_01/btree-primary-to-secondary-indexonly-plan-equi-join_01.1.adm
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/btree-primary-to-secondary-indexonly-plan-equi-join_01/btree-primary-to-secondary-indexonly-plan-equi-join_01.1.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/btree-primary-to-secondary-indexonly-plan-equi-join_01/btree-primary-to-secondary-indexonly-plan-equi-join_01.1.adm
new file mode 100644
index 0000000..00750ed
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/btree-primary-to-secondary-indexonly-plan-equi-join_01/btree-primary-to-secondary-indexonly-plan-equi-join_01.1.adm
@@ -0,0 +1 @@
+3

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/btree-secondary-equi-join_04/btree-secondary-equi-join_04.1.adm
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/btree-secondary-equi-join_04/btree-secondary-equi-join_04.1.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/btree-secondary-equi-join_04/btree-secondary-equi-join_04.1.adm
new file mode 100644
index 0000000..e706c60
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/btree-secondary-equi-join_04/btree-secondary-equi-join_04.1.adm
@@ -0,0 +1,5 @@
+{ "aid": 5, "bid": 98, "title": "Active Database Systems" }
+{ "aid": 34, "bid": 57, "title": "Java in Next-Generation Database Systems" }
+{ "aid": 54, "bid": 91, "title": "A Shared View of Sharing  The Treaty of 
Orlando" }
+{ "aid": 68, "bid": 57, "title": "Java in Next-Generation Database Systems" }
+{ "aid": 69, "bid": 57, "title": "Java in Next-Generation Database Systems" }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/btree-secondary-indexonly-plan-to-primary-equi-join_01/btree-secondary-indexonly-plan-to-primary-equi-join_01.1.adm
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/btree-secondary-indexonly-plan-to-primary-equi-join_01/btree-secondary-indexonly-plan-to-primary-equi-join_01.1.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/btree-secondary-indexonly-plan-to-primary-equi-join_01/btree-secondary-indexonly-plan-to-primary-equi-join_01.1.adm
new file mode 100644
index 0000000..00750ed
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/btree-secondary-indexonly-plan-to-primary-equi-join_01/btree-secondary-indexonly-plan-to-primary-equi-join_01.1.adm
@@ -0,0 +1 @@
+3

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/btree-secondary-indexonly-plan-to-secondary-indexonly-plan-equi-join_01/btree-secondary-indexonly-plan-to-secondary-indexonly-plan-equi-join_01.1.adm
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/btree-secondary-indexonly-plan-to-secondary-indexonly-plan-equi-join_01/btree-secondary-indexonly-plan-to-secondary-indexonly-plan-equi-join_01.1.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/btree-secondary-indexonly-plan-to-secondary-indexonly-plan-equi-join_01/btree-secondary-indexonly-plan-to-secondary-indexonly-plan-equi-join_01.1.adm
new file mode 100644
index 0000000..00750ed
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/btree-secondary-indexonly-plan-to-secondary-indexonly-plan-equi-join_01/btree-secondary-indexonly-plan-to-secondary-indexonly-plan-equi-join_01.1.adm
@@ -0,0 +1 @@
+3

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/btree-secondary-non-indexonly-plan-to-primary-equi-join_01/btree-secondary-non-indexonly-plan-to-primary-equi-join_01.1.adm
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/btree-secondary-non-indexonly-plan-to-primary-equi-join_01/btree-secondary-non-indexonly-plan-to-primary-equi-join_01.1.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/btree-secondary-non-indexonly-plan-to-primary-equi-join_01/btree-secondary-non-indexonly-plan-to-primary-equi-join_01.1.adm
new file mode 100644
index 0000000..00750ed
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/btree-secondary-non-indexonly-plan-to-primary-equi-join_01/btree-secondary-non-indexonly-plan-to-primary-equi-join_01.1.adm
@@ -0,0 +1 @@
+3

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/btree-secondary-non-indexonly-plan-to-secondary-indexonly-plan-equi-join_01/btree-secondary-non-indexonly-plan-to-secondary-indexonly-plan-equi-join_01.1.adm
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/btree-secondary-non-indexonly-plan-to-secondary-indexonly-plan-equi-join_01/btree-secondary-non-indexonly-plan-to-secondary-indexonly-plan-equi-join_01.1.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/btree-secondary-non-indexonly-plan-to-secondary-indexonly-plan-equi-join_01/btree-secondary-non-indexonly-plan-to-secondary-indexonly-plan-equi-join_01.1.adm
new file mode 100644
index 0000000..00750ed
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/btree-secondary-non-indexonly-plan-to-secondary-indexonly-plan-equi-join_01/btree-secondary-non-indexonly-plan-to-secondary-indexonly-plan-equi-join_01.1.adm
@@ -0,0 +1 @@
+3

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.adm
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.adm
deleted file mode 100644
index d0c6981..0000000
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.adm
+++ /dev/null
@@ -1,44 +0,0 @@
-{ "aid": 1, "bid": 17, "apt": point("4.1,7.0"), "bp": point("4.1,7.0") }
-{ "aid": 3, "bid": 4, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 3, "bid": 5, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 3, "bid": 6, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 3, "bid": 7, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 3, "bid": 8, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 4, "bid": 3, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 4, "bid": 5, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 4, "bid": 6, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 4, "bid": 7, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 4, "bid": 8, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 5, "bid": 3, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 5, "bid": 4, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 5, "bid": 6, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 5, "bid": 7, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 5, "bid": 8, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 6, "bid": 3, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 6, "bid": 4, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 6, "bid": 5, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 6, "bid": 7, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 6, "bid": 8, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 7, "bid": 3, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 7, "bid": 4, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 7, "bid": 5, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 7, "bid": 6, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 7, "bid": 8, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 8, "bid": 3, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 8, "bid": 4, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 8, "bid": 5, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 8, "bid": 6, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 8, "bid": 7, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
-{ "aid": 15, "bid": 16, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
-{ "aid": 15, "bid": 18, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
-{ "aid": 15, "bid": 19, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
-{ "aid": 16, "bid": 15, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
-{ "aid": 16, "bid": 18, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
-{ "aid": 16, "bid": 19, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
-{ "aid": 17, "bid": 1, "apt": point("4.1,7.0"), "bp": point("4.1,7.0") }
-{ "aid": 18, "bid": 15, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
-{ "aid": 18, "bid": 16, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
-{ "aid": 18, "bid": 19, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
-{ "aid": 19, "bid": 15, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
-{ "aid": 19, "bid": 16, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
-{ "aid": 19, "bid": 18, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/rtree-spatial-intersect-point_01/rtree-spatial-intersect-point_01.1.adm
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/rtree-spatial-intersect-point_01/rtree-spatial-intersect-point_01.1.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/rtree-spatial-intersect-point_01/rtree-spatial-intersect-point_01.1.adm
new file mode 100644
index 0000000..d0c6981
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/rtree-spatial-intersect-point_01/rtree-spatial-intersect-point_01.1.adm
@@ -0,0 +1,44 @@
+{ "aid": 1, "bid": 17, "apt": point("4.1,7.0"), "bp": point("4.1,7.0") }
+{ "aid": 3, "bid": 4, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 3, "bid": 5, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 3, "bid": 6, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 3, "bid": 7, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 3, "bid": 8, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 4, "bid": 3, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 4, "bid": 5, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 4, "bid": 6, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 4, "bid": 7, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 4, "bid": 8, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 5, "bid": 3, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 5, "bid": 4, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 5, "bid": 6, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 5, "bid": 7, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 5, "bid": 8, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 6, "bid": 3, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 6, "bid": 4, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 6, "bid": 5, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 6, "bid": 7, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 6, "bid": 8, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 7, "bid": 3, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 7, "bid": 4, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 7, "bid": 5, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 7, "bid": 6, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 7, "bid": 8, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 8, "bid": 3, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 8, "bid": 4, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 8, "bid": 5, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 8, "bid": 6, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 8, "bid": 7, "apt": point("43.5083,-79.3007"), "bp": 
point("43.5083,-79.3007") }
+{ "aid": 15, "bid": 16, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
+{ "aid": 15, "bid": 18, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
+{ "aid": 15, "bid": 19, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
+{ "aid": 16, "bid": 15, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
+{ "aid": 16, "bid": 18, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
+{ "aid": 16, "bid": 19, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
+{ "aid": 17, "bid": 1, "apt": point("4.1,7.0"), "bp": point("4.1,7.0") }
+{ "aid": 18, "bid": 15, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
+{ "aid": 18, "bid": 16, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
+{ "aid": 18, "bid": 19, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
+{ "aid": 19, "bid": 15, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
+{ "aid": 19, "bid": 16, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }
+{ "aid": 19, "bid": 18, "apt": point("-2.0,3.0"), "bp": point("-2.0,3.0") }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/rtree-spatial-intersect-point_02/rtree-spatial-intersect-point_02.1.adm
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/rtree-spatial-intersect-point_02/rtree-spatial-intersect-point_02.1.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/rtree-spatial-intersect-point_02/rtree-spatial-intersect-point_02.1.adm
new file mode 100644
index 0000000..1503808
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/rtree-spatial-intersect-point_02/rtree-spatial-intersect-point_02.1.adm
@@ -0,0 +1,65 @@
+{ "aid": 1, "bid": 1, "apoint": point("4.1,7.0"), "bpoint": point("4.1,7.0") }
+{ "aid": 1, "bid": 17, "apoint": point("4.1,7.0"), "bpoint": point("4.1,7.0") }
+{ "aid": 2, "bid": 2, "apoint": point("40.2152,-75.0449"), "bpoint": 
point("40.2152,-75.0449") }
+{ "aid": 3, "bid": 3, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 3, "bid": 4, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 3, "bid": 5, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 3, "bid": 6, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 3, "bid": 7, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 3, "bid": 8, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 4, "bid": 3, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 4, "bid": 4, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 4, "bid": 5, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 4, "bid": 6, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 4, "bid": 7, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 4, "bid": 8, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 5, "bid": 3, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 5, "bid": 4, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 5, "bid": 5, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 5, "bid": 6, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 5, "bid": 7, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 5, "bid": 8, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 6, "bid": 3, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 6, "bid": 4, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 6, "bid": 5, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 6, "bid": 6, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 6, "bid": 7, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 6, "bid": 8, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 7, "bid": 3, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 7, "bid": 4, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 7, "bid": 5, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 7, "bid": 6, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 7, "bid": 7, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 7, "bid": 8, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 8, "bid": 3, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 8, "bid": 4, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 8, "bid": 5, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 8, "bid": 6, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 8, "bid": 7, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 8, "bid": 8, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 9, "bid": 9, "apoint": point("5.0,1.0"), "bpoint": point("5.0,1.0") }
+{ "aid": 10, "bid": 10, "apoint": point("2.0,3.0"), "bpoint": point("2.0,3.0") 
}
+{ "aid": 11, "bid": 11, "apoint": point("4.9,0.0"), "bpoint": point("4.9,0.0") 
}
+{ "aid": 12, "bid": 12, "apoint": point("6.0,3.0"), "bpoint": point("6.0,3.0") 
}
+{ "aid": 13, "bid": 13, "apoint": point("5.0,5.0"), "bpoint": point("5.0,5.0") 
}
+{ "aid": 14, "bid": 14, "apoint": point("5.1,5.1"), "bpoint": point("5.1,5.1") 
}
+{ "aid": 15, "bid": 15, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 15, "bid": 16, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 15, "bid": 18, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 15, "bid": 19, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 16, "bid": 15, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 16, "bid": 16, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 16, "bid": 18, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 16, "bid": 19, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 17, "bid": 1, "apoint": point("4.1,7.0"), "bpoint": point("4.1,7.0") }
+{ "aid": 17, "bid": 17, "apoint": point("4.1,7.0"), "bpoint": point("4.1,7.0") 
}
+{ "aid": 18, "bid": 15, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 18, "bid": 16, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 18, "bid": 18, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 18, "bid": 19, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 19, "bid": 15, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 19, "bid": 16, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 19, "bid": 18, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 19, "bid": 19, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 20, "bid": 20, "apoint": point("4.0,3.0"), "bpoint": point("4.0,3.0") 
}
+{ "aid": 21, "bid": 21, "apoint": point("0.0,5.0"), "bpoint": point("0.0,5.0") 
}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/rtree-spatial-intersect-point_03/rtree-spatial-intersect-point_03.1.adm
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/rtree-spatial-intersect-point_03/rtree-spatial-intersect-point_03.1.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/rtree-spatial-intersect-point_03/rtree-spatial-intersect-point_03.1.adm
new file mode 100644
index 0000000..1503808
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/rtree-spatial-intersect-point_03/rtree-spatial-intersect-point_03.1.adm
@@ -0,0 +1,65 @@
+{ "aid": 1, "bid": 1, "apoint": point("4.1,7.0"), "bpoint": point("4.1,7.0") }
+{ "aid": 1, "bid": 17, "apoint": point("4.1,7.0"), "bpoint": point("4.1,7.0") }
+{ "aid": 2, "bid": 2, "apoint": point("40.2152,-75.0449"), "bpoint": 
point("40.2152,-75.0449") }
+{ "aid": 3, "bid": 3, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 3, "bid": 4, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 3, "bid": 5, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 3, "bid": 6, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 3, "bid": 7, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 3, "bid": 8, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 4, "bid": 3, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 4, "bid": 4, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 4, "bid": 5, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 4, "bid": 6, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 4, "bid": 7, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 4, "bid": 8, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 5, "bid": 3, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 5, "bid": 4, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 5, "bid": 5, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 5, "bid": 6, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 5, "bid": 7, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 5, "bid": 8, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 6, "bid": 3, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 6, "bid": 4, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 6, "bid": 5, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 6, "bid": 6, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 6, "bid": 7, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 6, "bid": 8, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 7, "bid": 3, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 7, "bid": 4, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 7, "bid": 5, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 7, "bid": 6, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 7, "bid": 7, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 7, "bid": 8, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 8, "bid": 3, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 8, "bid": 4, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 8, "bid": 5, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 8, "bid": 6, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 8, "bid": 7, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 8, "bid": 8, "apoint": point("43.5083,-79.3007"), "bpoint": 
point("43.5083,-79.3007") }
+{ "aid": 9, "bid": 9, "apoint": point("5.0,1.0"), "bpoint": point("5.0,1.0") }
+{ "aid": 10, "bid": 10, "apoint": point("2.0,3.0"), "bpoint": point("2.0,3.0") 
}
+{ "aid": 11, "bid": 11, "apoint": point("4.9,0.0"), "bpoint": point("4.9,0.0") 
}
+{ "aid": 12, "bid": 12, "apoint": point("6.0,3.0"), "bpoint": point("6.0,3.0") 
}
+{ "aid": 13, "bid": 13, "apoint": point("5.0,5.0"), "bpoint": point("5.0,5.0") 
}
+{ "aid": 14, "bid": 14, "apoint": point("5.1,5.1"), "bpoint": point("5.1,5.1") 
}
+{ "aid": 15, "bid": 15, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 15, "bid": 16, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 15, "bid": 18, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 15, "bid": 19, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 16, "bid": 15, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 16, "bid": 16, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 16, "bid": 18, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 16, "bid": 19, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 17, "bid": 1, "apoint": point("4.1,7.0"), "bpoint": point("4.1,7.0") }
+{ "aid": 17, "bid": 17, "apoint": point("4.1,7.0"), "bpoint": point("4.1,7.0") 
}
+{ "aid": 18, "bid": 15, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 18, "bid": 16, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 18, "bid": 18, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 18, "bid": 19, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 19, "bid": 15, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 19, "bid": 16, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 19, "bid": 18, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 19, "bid": 19, "apoint": point("-2.0,3.0"), "bpoint": 
point("-2.0,3.0") }
+{ "aid": 20, "bid": 20, "apoint": point("4.0,3.0"), "bpoint": point("4.0,3.0") 
}
+{ "aid": 21, "bid": 21, "apoint": point("0.0,5.0"), "bpoint": point("0.0,5.0") 
}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3c23574/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/rtree-spatial-intersect-point_04/rtree-spatial-intersect-point_04.1.adm
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/rtree-spatial-intersect-point_04/rtree-spatial-intersect-point_04.1.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/rtree-spatial-intersect-point_04/rtree-spatial-intersect-point_04.1.adm
new file mode 100644
index 0000000..5e2281b
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/index-join/rtree-spatial-intersect-point_04/rtree-spatial-intersect-point_04.1.adm
@@ -0,0 +1,20 @@
+{ "aid": 1, "bid": 10, "apoly1": polygon("1.0,1.0 1.0,4.0 3.0,4.0 3.0,1.0"), 
"bpoint": point("2.0,3.0") }
+{ "aid": 2, "bid": 10, "apoly1": polygon("1.0,1.0 1.0,4.0 3.0,4.0 3.0,1.0"), 
"bpoint": point("2.0,3.0") }
+{ "aid": 3, "bid": 10, "apoly1": polygon("1.0,1.0 1.0,4.0 3.0,4.0 3.0,1.0"), 
"bpoint": point("2.0,3.0") }
+{ "aid": 4, "bid": 10, "apoly1": polygon("1.0,1.0 1.0,4.0 3.0,4.0 3.0,1.0 
2.0,1.0 1.0,0.0"), "bpoint": point("2.0,3.0") }
+{ "aid": 6, "bid": 10, "apoly1": polygon("1.0,1.0 1.0,4.0 3.0,4.0 3.0,1.0"), 
"bpoint": point("2.0,3.0") }
+{ "aid": 9, "bid": 10, "apoly1": polygon("1.0,1.0 1.0,4.0 3.0,4.0 3.0,1.0"), 
"bpoint": point("2.0,3.0") }
+{ "aid": 11, "bid": 9, "apoly1": polygon("4.9,0.1 4.9,4.0 12.0,4.0 12.0,1.0"), 
"bpoint": point("5.0,1.0") }
+{ "aid": 11, "bid": 12, "apoly1": polygon("4.9,0.1 4.9,4.0 12.0,4.0 
12.0,1.0"), "bpoint": point("6.0,3.0") }
+{ "aid": 12, "bid": 12, "apoly1": polygon("4.0,1.0 4.0,4.0 12.0,4.0 
12.0,1.0"), "bpoint": point("6.0,3.0") }
+{ "aid": 12, "bid": 20, "apoly1": polygon("4.0,1.0 4.0,4.0 12.0,4.0 
12.0,1.0"), "bpoint": point("4.0,3.0") }
+{ "aid": 13, "bid": 12, "apoly1": polygon("6.0,1.0 6.0,4.0 12.0,4.0 
12.0,1.0"), "bpoint": point("6.0,3.0") }
+{ "aid": 14, "bid": 12, "apoly1": polygon("5.0,1.0 5.0,4.0 12.0,4.0 
12.0,1.0"), "bpoint": point("6.0,3.0") }
+{ "aid": 15, "bid": 12, "apoly1": polygon("5.1,1.0 5.1,4.0 12.0,4.0 
12.0,1.0"), "bpoint": point("6.0,3.0") }
+{ "aid": 16, "bid": 12, "apoly1": polygon("5.0,1.0 5.0,4.0 7.0,4.0 7.0,1.0"), 
"bpoint": point("6.0,3.0") }
+{ "aid": 17, "bid": 10, "apoly1": polygon("0.0,6.0 0.0,0.0 3.0,0.0 4.0,1.0 
6.0,1.0 8.0,0.0 12.0,0.0 13.0,2.0 8.0,2.0 8.0,4.0 11.0,4.0 11.0,6.0 6.0,6.0 
4.0,3.0 2.0,6.0"), "bpoint": point("2.0,3.0") }
+{ "aid": 17, "bid": 12, "apoly1": polygon("0.0,6.0 0.0,0.0 3.0,0.0 4.0,1.0 
6.0,1.0 8.0,0.0 12.0,0.0 13.0,2.0 8.0,2.0 8.0,4.0 11.0,4.0 11.0,6.0 6.0,6.0 
4.0,3.0 2.0,6.0"), "bpoint": point("6.0,3.0") }
+{ "aid": 17, "bid": 20, "apoly1": polygon("0.0,6.0 0.0,0.0 3.0,0.0 4.0,1.0 
6.0,1.0 8.0,0.0 12.0,0.0 13.0,2.0 8.0,2.0 8.0,4.0 11.0,4.0 11.0,6.0 6.0,6.0 
4.0,3.0 2.0,6.0"), "bpoint": point("4.0,3.0") }
+{ "aid": 17, "bid": 21, "apoly1": polygon("0.0,6.0 0.0,0.0 3.0,0.0 4.0,1.0 
6.0,1.0 8.0,0.0 12.0,0.0 13.0,2.0 8.0,2.0 8.0,4.0 11.0,4.0 11.0,6.0 6.0,6.0 
4.0,3.0 2.0,6.0"), "bpoint": point("0.0,5.0") }
+{ "aid": 20, "bid": 12, "apoly1": polygon("4.0,1.0 4.0,4.0 12.0,4.0 
12.0,1.0"), "bpoint": point("6.0,3.0") }
+{ "aid": 20, "bid": 20, "apoly1": polygon("4.0,1.0 4.0,4.0 12.0,4.0 
12.0,1.0"), "bpoint": point("4.0,3.0") }

Reply via email to