Gave tests more descriptive names. Reorganized existing tests.

git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_fix_issue_224@1121 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-01.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-01.aql
deleted file mode 100644
index 2f8d7d6..0000000
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-01.aql
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Description  : Notice the query hint to use an indexed nested-loops join plan.
- *              : We expect a plan that hash-exchanges internal dataset DsTwo, then probes internal dataset DsOne’s primary index.
- * Expected Res : Success
- * Date         : 29th November 2012
- */
-
-
-drop dataverse test1 if exists;
-create dataverse test1;
-
-create type test1.TestType as open {
-          key1: int32,
-          key2: int32,
-          fname : string,
-          lname : string
-}
-
-create dataset test1.DsOne(TestType) partitioned by key key1;
-create dataset test1.DsTwo(TestType) partitioned by key key1;
-
-for $x in dataset('test1.DsOne')
-for $y in dataset('test1.DsTwo')
-where $x.key1 /*+ indexnl */ = $y.key2
-return $x
-
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-02.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-02.aql
deleted file mode 100644
index 6961559..0000000
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-02.aql
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Description  : Notice the query hint to use an indexed nested-loops join plan. 
- *              : We expect a plan that hash-exchanges internal dataset DsTwo, then probes internal dataset DsOne’s primary index. 
- * Expected Res : Success
- * Date         : 29th November 2012
- */
-
-drop dataverse test1 if exists;
-create dataverse test1;
-
-create type test1.TestType as open {
-          key1: int32,
-          key2: int32,
-          fname : string,
-          lname : string
-}
-
-create dataset test1.DsOne(TestType) partitioned by key key1;
-create dataset test1.DsTwo(TestType) partitioned by key key1;
-
-// Please note content enclosed in the comment in the predicate is the HINT to the optimizer
-
-for $x in dataset('test1.DsOne')
-for $y in dataset('test1.DsTwo')
-where $x.key2 /*+ indexnl */ = $y.key1
-return $x
-
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-07.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-07.aql
deleted file mode 100644
index a93fbc3..0000000
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-07.aql
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Description  : Notice the query hint to use an indexed nested-loops join plan. 
- *              : We expect a plan that hash-exchanges internal dataset DsTwo, then probes internal dataset DsOne’s primary index. 
- * Expected Res : Success
- * Date         : 29th November 2012
- */
-
-/*
- * Note : Index selection is arbitrary as of today, see creation date above.
- *      : There will be a time when the optimizer becomes more intelligent and deals with costs.  
- */
-
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-create type TestType as open {
-          key1: int32,
-          key2: int32,
-          fname : string,
-          lname : string
-}
-
-create dataset DsOne(TestType) partitioned by key key1;
-create dataset DsTwo(TestType) partitioned by key key1;
-
-// create secondary B-Tree indexes on fname and lname attributes
-
-create index idx1 if not exists on DsOne(fname);
-create index idx2 if not exists on DsTwo(lname);
-
-for $x in dataset('DsOne')
-for $y in dataset('DsTwo')
-where $x.fname /*+ indexnl */ = $y.lname
-return $x
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-11.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-11.aql
deleted file mode 100644
index 30a509d..0000000
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-11.aql
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Description  : Notice the query hint to use an indexed nested-loops join plan.
- *              : We expect a plan that hash-exchanges internal dataset DsTwo, then probes internal dataset DsOne’s primary index.
- *              : The two internal datasets are in two different dataverses.
- * Expected Res : Success
- * Date         : 29th November 2012
- */
-
-
-drop dataverse test1 if exists;
-create dataverse test1;
-
-drop dataverse test2 if exists;
-create dataverse test2;
-
-create type test1.TestType as open {
-          key1: int32,
-          key2: int32,
-          fname : string,
-          lname : string
-}
-
-create type test2.TestType as open {
-          key1: int32,
-          key2: int32,
-          fname : string,
-          lname : string
-}
-
-create dataset test1.DsOne(TestType) partitioned by key key1;
-create dataset test2.DsTwo(TestType) partitioned by key key1;
-
-for $x in dataset('test1.DsOne')
-for $y in dataset('test2.DsTwo')
-where $x.key2 /*+ indexnl */ = $y.key1
-return $x
-
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-22.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-22.aql
deleted file mode 100644
index 6961559..0000000
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-22.aql
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Description  : Notice the query hint to use an indexed nested-loops join plan. 
- *              : We expect a plan that hash-exchanges internal dataset DsTwo, then probes internal dataset DsOne’s primary index. 
- * Expected Res : Success
- * Date         : 29th November 2012
- */
-
-drop dataverse test1 if exists;
-create dataverse test1;
-
-create type test1.TestType as open {
-          key1: int32,
-          key2: int32,
-          fname : string,
-          lname : string
-}
-
-create dataset test1.DsOne(TestType) partitioned by key key1;
-create dataset test1.DsTwo(TestType) partitioned by key key1;
-
-// Please note content enclosed in the comment in the predicate is the HINT to the optimizer
-
-for $x in dataset('test1.DsOne')
-for $y in dataset('test1.DsTwo')
-where $x.key2 /*+ indexnl */ = $y.key1
-return $x
-
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-08.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join-neg_01.aql
similarity index 100%
rename from asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-08.aql
rename to asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join-neg_01.aql
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-88.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join-neg_02.aql
similarity index 100%
rename from asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-88.aql
rename to asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join-neg_02.aql
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_01.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_01.aql
index f7f8d6c..c1c6174 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_01.aql
@@ -1,46 +1,27 @@
 /*
- * Description    : Equi joins two datasets, Customers and Orders, based on the customer id.
- *                  Given the 'indexnl' hint we expect the join to be transformed
- *                  into an indexed nested-loop join using Customers' primary index.
- * Success        : Yes
+ * Description  : Notice the query hint to use an indexed nested-loops join plan.
+ *              : We expect a plan that hash-exchanges internal dataset DsTwo, then probes internal dataset DsOne’s primary index.
+ * Expected Res : Success
+ * Date         : 29th November 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
+drop dataverse test1 if exists;
+create dataverse test1;
 
-create type AddressType as closed {
-  number: int32, 
-  street: string,
-  city: string
+create type test1.TestType as open {
+          key1: int32,
+          key2: int32,
+          fname : string,
+          lname : string
 }
 
-create type CustomerType as closed {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  lastorder: {
-    oid: int32,
-    total: float
-  }
-}
+create dataset test1.DsOne(TestType) partitioned by key key1;
+create dataset test1.DsTwo(TestType) partitioned by key key1;
 
-create type OrderType as closed {
-  oid: int32,
-  cid: int32,
-  orderstatus: string,
-  orderpriority: string,
-  clerk: string,
-  total: float
-}
+// Please note content enclosed in the comment in the predicate is a HINT to the optimizer
 
-create dataset Customers(CustomerType) partitioned by key cid;
-create dataset Orders(OrderType) partitioned by key oid;
+for $x in dataset('test1.DsOne')
+for $y in dataset('test1.DsTwo')
+where $x.key1 /*+ indexnl */ = $y.key2
+return $x
 
-write output to nc1:"rttest/btree-index-join_primary-equi-join_01.adm";
-
-for $c in dataset('Customers')
-for $o in dataset('Orders')
-where $c.cid /*+ indexnl */ = $o.cid
-return {"customer":$c, "order": $o} 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_02.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_02.aql
index 9ac6140..e0ebdbb 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_02.aql
@@ -1,46 +1,27 @@
 /*
- * Description    : Equi joins two datasets, Customers and Orders, based on the customer id.
- *                  Given the 'indexnl' hint we expect the join to be transformed
- *                  into an indexed nested-loop join using Customers' primary index.
- * Success        : Yes
+ * Description  : Notice the query hint to use an indexed nested-loops join plan. 
+ *              : We expect a plan that hash-exchanges internal dataset DsTwo, then probes internal dataset DsOne’s primary index. 
+ * Expected Res : Success
+ * Date         : 29th November 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
+drop dataverse test1 if exists;
+create dataverse test1;
 
-create type AddressType as closed {
-  number: int32, 
-  street: string,
-  city: string
+create type test1.TestType as open {
+          key1: int32,
+          key2: int32,
+          fname : string,
+          lname : string
 }
 
-create type CustomerType as closed {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  lastorder: {
-    oid: int32,
-    total: float
-  }
-}
+create dataset test1.DsOne(TestType) partitioned by key key1;
+create dataset test1.DsTwo(TestType) partitioned by key key1;
 
-create type OrderType as closed {
-  oid: int32,
-  cid: int32,
-  orderstatus: string,
-  orderpriority: string,
-  clerk: string,
-  total: float
-}
+// Please note content enclosed in the comment in the predicate is a HINT to the optimizer
 
-create dataset Customers(CustomerType) partitioned by key cid;
-create dataset Orders(OrderType) partitioned by key oid;
+for $x in dataset('test1.DsOne')
+for $y in dataset('test1.DsTwo')
+where $x.key2 /*+ indexnl */ = $y.key1
+return $x
 
-write output to nc1:"rttest/btree-index-join_primary-equi-join_02.adm";
-
-for $o in dataset('Orders')
-for $c in dataset('Customers')
-where $o.cid /*+ indexnl */ = $c.cid 
-return {"customer":$c, "order": $o} 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_03.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_03.aql
index e33e2a9..d60a8ac 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_03.aql
@@ -1,5 +1,5 @@
 /*
- * Description    : Self-equi joins a dataset, Customers, based on the customer id.
+ * Description    : Equi joins two datasets, Customers and Orders, based on the customer id.
  *                  Given the 'indexnl' hint we expect the join to be transformed
  *                  into an indexed nested-loop join using Customers' primary index.
  * Success        : Yes
@@ -26,11 +26,21 @@
   }
 }
 
+create type OrderType as closed {
+  oid: int32,
+  cid: int32,
+  orderstatus: string,
+  orderpriority: string,
+  clerk: string,
+  total: float
+}
+
 create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Orders(OrderType) partitioned by key oid;
 
-write output to nc1:"rttest/btree-index-join_primary-equi-join_03.adm";
+write output to nc1:"rttest/btree-index-join_primary-equi-join_04.adm";
 
-for $c1 in dataset('Customers')
-for $c2 in dataset('Customers')
-where $c1.cid /*+ indexnl */ = $c2.cid 
-return {"customer1":$c1, "customer2":$c2} 
+for $c in dataset('Customers')
+for $o in dataset('Orders')
+where $c.cid /*+ indexnl */ = $o.cid
+return {"customer":$c, "order": $o} 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_04.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_04.aql
new file mode 100644
index 0000000..56211e8
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_04.aql
@@ -0,0 +1,46 @@
+/*
+ * Description    : Equi joins two datasets, Customers and Orders, based on the customer id.
+ *                  Given the 'indexnl' hint we expect the join to be transformed
+ *                  into an indexed nested-loop join using Customers' primary index.
+ * Success        : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+  number: int32, 
+  street: string,
+  city: string
+}
+
+create type CustomerType as closed {
+  cid: int32, 
+  name: string,
+  age: int32?,
+  address: AddressType?,
+  lastorder: {
+    oid: int32,
+    total: float
+  }
+}
+
+create type OrderType as closed {
+  oid: int32,
+  cid: int32,
+  orderstatus: string,
+  orderpriority: string,
+  clerk: string,
+  total: float
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Orders(OrderType) partitioned by key oid;
+
+write output to nc1:"rttest/btree-index-join_primary-equi-join_05.adm";
+
+for $o in dataset('Orders')
+for $c in dataset('Customers')
+where $o.cid /*+ indexnl */ = $c.cid 
+return {"customer":$c, "order": $o} 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_05.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_05.aql
new file mode 100644
index 0000000..0e6efe8
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_05.aql
@@ -0,0 +1,36 @@
+/*
+ * Description    : Self-equi joins a dataset, Customers, based on the customer id.
+ *                  Given the 'indexnl' hint we expect the join to be transformed
+ *                  into an indexed nested-loop join using Customers' primary index.
+ * Success        : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as closed {
+  number: int32, 
+  street: string,
+  city: string
+}
+
+create type CustomerType as closed {
+  cid: int32, 
+  name: string,
+  age: int32?,
+  address: AddressType?,
+  lastorder: {
+    oid: int32,
+    total: float
+  }
+}
+
+create dataset Customers(CustomerType) partitioned by key cid;
+
+write output to nc1:"rttest/btree-index-join_primary-equi-join_06.adm";
+
+for $c1 in dataset('Customers')
+for $c2 in dataset('Customers')
+where $c1.cid /*+ indexnl */ = $c2.cid 
+return {"customer1":$c1, "customer2":$c2} 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-03.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-ge-join_01.aql
similarity index 83%
rename from asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-03.aql
rename to asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-ge-join_01.aql
index 2df7445..44bbbdd 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-ge-join_01.aql
@@ -1,6 +1,6 @@
 /*
  * Description  : Notice the query hint to use an indexed nested-loops join plan. 
- *              : We expect a plan that hash-exchanges internal dataset DsTwo, then probes internal dataset DsOne’s primary index. 
+ *              : We expect a plan that broadcasts internal dataset DsTwo, then probes internal dataset DsOne’s primary index. 
  * Expected Res : Success
  * Date         : 29th November 2012
  */
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-44.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-ge-join_02.aql
similarity index 83%
rename from asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-44.aql
rename to asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-ge-join_02.aql
index 37d0152..ab2ad7a 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-44.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-ge-join_02.aql
@@ -1,6 +1,6 @@
 /*
  * Description  : Notice the query hint to use an indexed nested-loops join plan. 
- *              : We expect a plan that hash-exchanges internal dataset DsTwo, then probes internal dataset DsOne’s primary index. 
+ *              : We expect a plan that broadcasts internal dataset DsTwo, then probes internal dataset DsOne’s primary index. 
  * Expected Res : Success
  * Date         : 29th November 2012
  */
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-05.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-gt-join_01.aql
similarity index 83%
rename from asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-05.aql
rename to asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-gt-join_01.aql
index b676cd5..9a82567 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-05.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-gt-join_01.aql
@@ -1,6 +1,6 @@
 /*
  * Description  : Notice the query hint to use an indexed nested-loops join plan. 
- *              : We expect a plan that hash-exchanges internal dataset DsTwo, then probes internal dataset DsOne’s primary index. 
+ *              : We expect a plan that broadcasts internal dataset DsTwo, then probes internal dataset DsOne’s primary index. 
  * Expected Res : Success
  * Date         : 29th November 2012
  */
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-66.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-gt-join_02.aql
similarity index 83%
rename from asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-66.aql
rename to asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-gt-join_02.aql
index ed5bc0f..7fe148b 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-66.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-gt-join_02.aql
@@ -1,6 +1,6 @@
 /*
  * Description  : Notice the query hint to use an indexed nested-loops join plan. 
- *              : We expect a plan that hash-exchanges internal dataset DsTwo, then probes internal dataset DsOne’s primary index. 
+ *              : We expect a plan that broadcasts internal dataset DsTwo, then probes internal dataset DsOne’s primary index. 
  * Expected Res : Success
  * Date         : 29th November 2012
  */
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-04.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-le-join_01.aql
similarity index 83%
rename from asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-04.aql
rename to asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-le-join_01.aql
index 8914c4c..3490588 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-04.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-le-join_01.aql
@@ -1,6 +1,6 @@
 /*
  * Description  : Notice the query hint to use an indexed nested-loops join plan. 
- *              : We expect a plan that hash-exchanges internal dataset DsTwo, then probes internal dataset DsOne’s primary index. 
+ *              : We expect a plan that broadcasts internal dataset DsTwo, then probes internal dataset DsOne’s primary index. 
  * Expected Res : Success
  * Date         : 29th November 2012
  */
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-33.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-le-join_02.aql
similarity index 83%
rename from asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-33.aql
rename to asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-le-join_02.aql
index 89cb65a..e9786b1 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-33.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-le-join_02.aql
@@ -1,6 +1,6 @@
 /*
  * Description  : Notice the query hint to use an indexed nested-loops join plan. 
- *              : We expect a plan that hash-exchanges internal dataset DsTwo, then probes internal dataset DsOne’s primary index. 
+ *              : We expect a plan that broadcasts internal dataset DsTwo, then probes internal dataset DsOne’s primary index. 
  * Expected Res : Success
  * Date         : 29th November 2012
  */
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-06.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-lt-join_01.aql
similarity index 83%
rename from asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-06.aql
rename to asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-lt-join_01.aql
index a6e5879..0f521f8 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-06.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-lt-join_01.aql
@@ -1,6 +1,6 @@
 /*
  * Description  : Notice the query hint to use an indexed nested-loops join plan. 
- *              : We expect a plan that hash-exchanges internal dataset DsTwo, then probes internal dataset DsOne’s primary index. 
+ *              : We expect a plan that broadcasts internal dataset DsTwo, then probes internal dataset DsOne’s primary index. 
  * Expected Res : Success
  * Date         : 29th November 2012
  */
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-55.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-lt-join_02.aql
similarity index 83%
rename from asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-55.aql
rename to asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-lt-join_02.aql
index dc553f5..3296d70 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/indexnl-55.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-lt-join_02.aql
@@ -1,6 +1,6 @@
 /*
  * Description  : Notice the query hint to use an indexed nested-loops join plan. 
- *              : We expect a plan that hash-exchanges internal dataset DsTwo, then probes internal dataset DsOne’s primary index. 
+ *              : We expect a plan that broadcasts internal dataset DsTwo, then probes internal dataset DsOne’s primary index. 
  * Expected Res : Success
  * Date         : 29th November 2012
  */
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index-join/primary-equi-join_01.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index-join/primary-equi-join_01.plan
deleted file mode 100644
index a83e0eb..0000000
--- a/asterix-app/src/test/resources/optimizerts/results/btree-index-join/primary-equi-join_01.plan
+++ /dev/null
@@ -1,16 +0,0 @@
--- SINK_WRITE  |PARTITIONED|
-  -- RANDOM_MERGE_EXCHANGE  |PARTITIONED|
-    -- STREAM_PROJECT  |PARTITIONED|
-      -- ASSIGN  |PARTITIONED|
-        -- STREAM_PROJECT  |PARTITIONED|
-          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-            -- BTREE_SEARCH  |PARTITIONED|
-              -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                -- STABLE_SORT [$$11(ASC)]  |PARTITIONED|
-                  -- HASH_PARTITION_EXCHANGE [$$11]  |PARTITIONED|
-                    -- ASSIGN  |PARTITIONED|
-                      -- STREAM_PROJECT  |PARTITIONED|
-                        -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                          -- DATASOURCE_SCAN  |PARTITIONED|
-                            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                              -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index-join/primary-equi-join_03.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index-join/primary-equi-join_03.plan
index c5c0f4f..a83e0eb 100644
--- a/asterix-app/src/test/resources/optimizerts/results/btree-index-join/primary-equi-join_03.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index-join/primary-equi-join_03.plan
@@ -6,6 +6,11 @@
           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
             -- BTREE_SEARCH  |PARTITIONED|
               -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                -- DATASOURCE_SCAN  |PARTITIONED|
-                  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                    -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                -- STABLE_SORT [$$11(ASC)]  |PARTITIONED|
+                  -- HASH_PARTITION_EXCHANGE [$$11]  |PARTITIONED|
+                    -- ASSIGN  |PARTITIONED|
+                      -- STREAM_PROJECT  |PARTITIONED|
+                        -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                          -- DATASOURCE_SCAN  |PARTITIONED|
+                            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                              -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index-join/primary-equi-join_02.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index-join/primary-equi-join_04.plan
similarity index 100%
rename from asterix-app/src/test/resources/optimizerts/results/btree-index-join/primary-equi-join_02.plan
rename to asterix-app/src/test/resources/optimizerts/results/btree-index-join/primary-equi-join_04.plan
diff --git a/asterix-app/src/test/resources/optimizerts/results/btree-index-join/primary-equi-join_05.plan b/asterix-app/src/test/resources/optimizerts/results/btree-index-join/primary-equi-join_05.plan
new file mode 100644
index 0000000..c5c0f4f
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/btree-index-join/primary-equi-join_05.plan
@@ -0,0 +1,11 @@
+-- SINK_WRITE  |PARTITIONED|
+  -- RANDOM_MERGE_EXCHANGE  |PARTITIONED|
+    -- STREAM_PROJECT  |PARTITIONED|
+      -- ASSIGN  |PARTITIONED|
+        -- STREAM_PROJECT  |PARTITIONED|
+          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+            -- BTREE_SEARCH  |PARTITIONED|
+              -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                -- DATASOURCE_SCAN  |PARTITIONED|
+                  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                    -- EMPTY_TUPLE_SOURCE  |PARTITIONED|