merged r1426:1454 asterix_stabilization --> asterix_lsm_stabilization

git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_lsm_stabilization@1467 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-app/data/custord-tiny/customer-tiny-neg.adm b/asterix-app/data/custord-tiny/customer-tiny-neg.adm
new file mode 100644
index 0000000..4e8e9ab
--- /dev/null
+++ b/asterix-app/data/custord-tiny/customer-tiny-neg.adm
@@ -0,0 +1,10 @@
+{  "cid": 4440,  "name": "Renea Lavelett",  "age": 72,  "address": {  "number": 8963,  "street": "Oak St.",  "city": "Mountain View" },  "lastorder": {  "oid": 20520,  "total": 6.198883E-4f } }
+{  "cid": 530,  "name": "Clint Coil",  "age": 79,  "address": {  "number": 4491,  "street": "7th St.",  "city": "San Jose" },  "lastorder": {  "oid": 530,  "total": 7.5879574f } }
+{  "cid": 76,  "name": "Marvella Loud",  "age": 72,  "address": {  "number": 6988,  "street": "7th St.",  "city": "Sunnyvale" },  "lastorder": {  "oid": 76,  "total": 12.811708f } }
+{  "cid": 586,  "name": "Tamie Pollara",  "age": 89,  "address": {  "number": 7424,  "street": "Oak St.",  "city": "Sunnyvale" },  "lastorder": {  "oid": 586,  "total": 22.163845f } }
+{  "cid": 59,  "name": "Lance Pracht",  "age": 27,  "address": {  "number": 342,  "street": "Washington St.",  "city": "Mountain View" },  "lastorder": {  "oid": 59,  "total": 26.975239f } }
+{  "cid": 939,  "name": "Larry Gothier",  "age": 34,  "address": {  "number": 1786,  "street": "Park St.",  "city": "Mountain View" },  "lastorder": {  "oid": 939,  "total": 33.49055f } }
+{  "cid": 996,  "name": "Obdulia Dicosmo",  "age": 14,  "address": {  "number": 9237,  "street": "Cedar St.",  "city": "Los Angeles" },  "lastorder": {  "oid": 996,  "total": 94.23889f } }
+{  "cid": 953,  "name": "Elias Leonardo",  "age": 62,  "address": {  "number": 7831,  "street": "Main St.",  "city": "San Jose" },  "lastorder": {  "oid": 953,  "total": 79.990875f } }
+{  "cid": 74,  "name": "Myrtice Cubias",  "age": 11,  "address": {  "number": 9048,  "street": "Park St.",  "city": "San Jose" },  "lastorder": {  "oid": 74,  "total": 47.675938f } }
+{  "cid": 758,  "name": "Curt Savage",  "age": 81,  "address": {  "number": 5651,  "street": "Main St.",  "city": "Seattle" },  "lastorder": {  "oid": 758,  "total": 45.33596f } }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key/btree-index-composite-key.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key/btree-index-composite-key.1.ddl.aql
index 2e951e2..5103c09 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key/btree-index-composite-key.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key/btree-index-composite-key.1.ddl.aql
@@ -21,5 +21,3 @@
 
 create dataset employee(Emp) primary key id;
 
-create index idx_employee_f_l_name on employee(fname,lname);
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key/btree-index-composite-key.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key/btree-index-composite-key.3.ddl.aql
new file mode 100644
index 0000000..8a7bafe
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key/btree-index-composite-key.3.ddl.aql
@@ -0,0 +1,6 @@
+
+use dataverse test;
+
+// create secondary index
+
+create index idx_employee_f_l_name on employee(fname,lname);
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key/btree-index-composite-key.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key/btree-index-composite-key.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key/btree-index-composite-key.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key/btree-index-composite-key.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.1.ddl.aql
index aeb8652c..4ed0993 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.1.ddl.aql
@@ -24,5 +24,3 @@
 
 create dataset Orders(OrderType) primary key o_orderkey;
 
-create index idx_Orders_Custkey on Orders(o_custkey);
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.ddl.aql
new file mode 100644
index 0000000..2489b15
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.ddl.aql
@@ -0,0 +1,6 @@
+
+use dataverse tpch;
+
+// create secondary index on Orders(o_custkey)
+
+create index idx_Orders_Custkey on Orders(o_custkey);
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/cust-index-age-nullable/cust-index-age-nullable.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/cust-index-age-nullable/cust-index-age-nullable.1.ddl.aql
index 82c835d..80e9b17 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/cust-index-age-nullable/cust-index-age-nullable.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/cust-index-age-nullable/cust-index-age-nullable.1.ddl.aql
@@ -19,5 +19,3 @@
 
 create dataset Customers(CustomerType) primary key cid;
 
-create index age_index on Customers(age);
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/cust-index-age-nullable/cust-index-age-nullable.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/cust-index-age-nullable/cust-index-age-nullable.3.ddl.aql
new file mode 100644
index 0000000..7548774
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/cust-index-age-nullable/cust-index-age-nullable.3.ddl.aql
@@ -0,0 +1,6 @@
+
+use dataverse test;
+
+// create secondary index on Customers(age)
+
+create index age_index on Customers(age);
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/cust-index-age-nullable/cust-index-age-nullable.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/cust-index-age-nullable/cust-index-age-nullable.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/index-selection/cust-index-age-nullable/cust-index-age-nullable.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/index-selection/cust-index-age-nullable/cust-index-age-nullable.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.1.ddl.aql
index 7e7ae8c..49c6b3b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.1.ddl.aql
@@ -15,5 +15,3 @@
 create dataset DBLP(DBLPType) 
   primary key id on group1;
 
-create index ngram_index on DBLP(title) type ngram(3);
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.ddl.aql
new file mode 100644
index 0000000..4fbadcd
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.ddl.aql
@@ -0,0 +1,6 @@
+
+use dataverse test;
+
+// create secondary index of type ngram on DBLP(title)
+
+create index ngram_index on DBLP(title) type ngram(3);
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.1.ddl.aql
index d2ef8c8..49c6b3b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.1.ddl.aql
@@ -15,5 +15,3 @@
 create dataset DBLP(DBLPType) 
   primary key id on group1;
 
-create index ngram_index on DBLP(authors) type ngram(3);
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.ddl.aql
new file mode 100644
index 0000000..ad6365d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.ddl.aql
@@ -0,0 +1,4 @@
+
+use dataverse test;
+
+create index ngram_index on DBLP(authors) type ngram(3);
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.1.ddl.aql
index d2ef8c8..49c6b3b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.1.ddl.aql
@@ -15,5 +15,3 @@
 create dataset DBLP(DBLPType) 
   primary key id on group1;
 
-create index ngram_index on DBLP(authors) type ngram(3);
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.3.ddl.aql
new file mode 100644
index 0000000..2a43a57
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.3.ddl.aql
@@ -0,0 +1,3 @@
+use dataverse test;
+
+create index ngram_index on DBLP(authors) type ngram(3);
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.1.ddl.aql
index 7e7ae8c..49c6b3b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.1.ddl.aql
@@ -15,5 +15,3 @@
 create dataset DBLP(DBLPType) 
   primary key id on group1;
 
-create index ngram_index on DBLP(title) type ngram(3);
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.3.ddl.aql
new file mode 100644
index 0000000..4209874
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.3.ddl.aql
@@ -0,0 +1,3 @@
+use dataverse test;
+
+create index ngram_index on DBLP(title) type ngram(3);
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance-panic/inverted-index-olist-edit-distance-panic.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance-panic/inverted-index-olist-edit-distance-panic.1.ddl.aql
index 207c8ec..b2dc701 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance-panic/inverted-index-olist-edit-distance-panic.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance-panic/inverted-index-olist-edit-distance-panic.1.ddl.aql
@@ -20,5 +20,3 @@
 create dataset Customers(CustomerType) 
   primary key cid on group1;
 
-create index interests_index on Customers(interests) type keyword;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance-panic/inverted-index-olist-edit-distance-panic.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance-panic/inverted-index-olist-edit-distance-panic.3.ddl.aql
new file mode 100644
index 0000000..5356b79
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance-panic/inverted-index-olist-edit-distance-panic.3.ddl.aql
@@ -0,0 +1,4 @@
+
+use dataverse test;
+
+create index interests_index on Customers(interests) type keyword;
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance-panic/inverted-index-olist-edit-distance-panic.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance-panic/inverted-index-olist-edit-distance-panic.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance-panic/inverted-index-olist-edit-distance-panic.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance-panic/inverted-index-olist-edit-distance-panic.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance/inverted-index-olist-edit-distance.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance/inverted-index-olist-edit-distance.1.ddl.aql
index e5774db..dfc0f4e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance/inverted-index-olist-edit-distance.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance/inverted-index-olist-edit-distance.1.ddl.aql
@@ -22,5 +22,3 @@
 create dataset Customers(CustomerType) 
   primary key cid on group1;
 
-create index interests_index on Customers(interests) type keyword;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance/inverted-index-olist-edit-distance.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance/inverted-index-olist-edit-distance.3.ddl.aql
new file mode 100644
index 0000000..6d7c0cb
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance/inverted-index-olist-edit-distance.3.ddl.aql
@@ -0,0 +1,3 @@
+use dataverse test;
+
+create index interests_index on Customers(interests) type keyword;
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance/inverted-index-olist-edit-distance.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance/inverted-index-olist-edit-distance.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance/inverted-index-olist-edit-distance.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance/inverted-index-olist-edit-distance.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-jaccard/inverted-index-olist-jaccard.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-jaccard/inverted-index-olist-jaccard.1.ddl.aql
index e5774db..dfc0f4e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-jaccard/inverted-index-olist-jaccard.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-jaccard/inverted-index-olist-jaccard.1.ddl.aql
@@ -22,5 +22,3 @@
 create dataset Customers(CustomerType) 
   primary key cid on group1;
 
-create index interests_index on Customers(interests) type keyword;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-jaccard/inverted-index-olist-jaccard.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-jaccard/inverted-index-olist-jaccard.3.ddl.aql
new file mode 100644
index 0000000..5356b79
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-jaccard/inverted-index-olist-jaccard.3.ddl.aql
@@ -0,0 +1,4 @@
+
+use dataverse test;
+
+create index interests_index on Customers(interests) type keyword;
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-jaccard/inverted-index-olist-jaccard.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-jaccard/inverted-index-olist-jaccard.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-jaccard/inverted-index-olist-jaccard.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-jaccard/inverted-index-olist-jaccard.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard/inverted-index-ulist-jaccard.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard/inverted-index-ulist-jaccard.1.ddl.aql
index a7177ba..a350a46 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard/inverted-index-ulist-jaccard.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard/inverted-index-ulist-jaccard.1.ddl.aql
@@ -22,5 +22,3 @@
 create dataset Customers(CustomerType) 
   primary key cid on group1;
 
-create index interests_index on Customers(interests) type keyword;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard/inverted-index-ulist-jaccard.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard/inverted-index-ulist-jaccard.3.ddl.aql
new file mode 100644
index 0000000..5356b79
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard/inverted-index-ulist-jaccard.3.ddl.aql
@@ -0,0 +1,4 @@
+
+use dataverse test;
+
+create index interests_index on Customers(interests) type keyword;
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard/inverted-index-ulist-jaccard.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard/inverted-index-ulist-jaccard.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard/inverted-index-ulist-jaccard.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard/inverted-index-ulist-jaccard.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-contains/inverted-index-word-contains.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-contains/inverted-index-word-contains.1.ddl.aql
index bad04b6..49c6b3b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-contains/inverted-index-word-contains.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-contains/inverted-index-word-contains.1.ddl.aql
@@ -15,5 +15,3 @@
 create dataset DBLP(DBLPType) 
   primary key id on group1;
 
-create index keyword_index on DBLP(title) type keyword;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-contains/inverted-index-word-contains.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-contains/inverted-index-word-contains.3.ddl.aql
new file mode 100644
index 0000000..c8db25b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-contains/inverted-index-word-contains.3.ddl.aql
@@ -0,0 +1,4 @@
+use dataverse test;
+
+create index keyword_index on DBLP(title) type keyword;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-contains/inverted-index-word-contains.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-contains/inverted-index-word-contains.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-contains/inverted-index-word-contains.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-contains/inverted-index-word-contains.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.1.ddl.aql
index bad04b6..49c6b3b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.1.ddl.aql
@@ -15,5 +15,3 @@
 create dataset DBLP(DBLPType) 
   primary key id on group1;
 
-create index keyword_index on DBLP(title) type keyword;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.3.ddl.aql
new file mode 100644
index 0000000..93b64c1
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.3.ddl.aql
@@ -0,0 +1,3 @@
+use dataverse test;
+
+create index keyword_index on DBLP(title) type keyword;
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive-open/orders-index-custkey-conjunctive-open.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive-open/orders-index-custkey-conjunctive-open.1.ddl.aql
index 51fdf24..2cfb39a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive-open/orders-index-custkey-conjunctive-open.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive-open/orders-index-custkey-conjunctive-open.1.ddl.aql
@@ -17,5 +17,3 @@
 create dataset Orders(OrderType)
   primary key o_orderkey;
 
-create index idx_Orders_Custkey on Orders(o_custkey) ;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive-open/orders-index-custkey-conjunctive-open.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive-open/orders-index-custkey-conjunctive-open.3.ddl.aql
new file mode 100644
index 0000000..a92308f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive-open/orders-index-custkey-conjunctive-open.3.ddl.aql
@@ -0,0 +1,3 @@
+use dataverse tpch;
+
+create index idx_Orders_Custkey on Orders(o_custkey) ;
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive-open/orders-index-custkey-conjunctive-open.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive-open/orders-index-custkey-conjunctive-open.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive-open/orders-index-custkey-conjunctive-open.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive-open/orders-index-custkey-conjunctive-open.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.1.ddl.aql
index 51fdf24..2cfb39a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.1.ddl.aql
@@ -17,5 +17,3 @@
 create dataset Orders(OrderType)
   primary key o_orderkey;
 
-create index idx_Orders_Custkey on Orders(o_custkey) ;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.3.ddl.aql
new file mode 100644
index 0000000..ed3fab0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.3.ddl.aql
@@ -0,0 +1,3 @@
+use dataverse tpch;
+
+create index idx_Orders_Custkey on Orders(o_custkey);
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-open/orders-index-custkey-open.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-open/orders-index-custkey-open.1.ddl.aql
index 4d38a74..b541c58 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-open/orders-index-custkey-open.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-open/orders-index-custkey-open.1.ddl.aql
@@ -20,5 +20,3 @@
 create dataset Orders(OrderType)
   primary key o_orderkey on group1;
 
-create index idx_Orders_Custkey on Orders(o_custkey);
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-open/orders-index-custkey-open.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-open/orders-index-custkey-open.3.ddl.aql
new file mode 100644
index 0000000..ed3fab0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-open/orders-index-custkey-open.3.ddl.aql
@@ -0,0 +1,3 @@
+use dataverse tpch;
+
+create index idx_Orders_Custkey on Orders(o_custkey);
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-open/orders-index-custkey-open.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-open/orders-index-custkey-open.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-open/orders-index-custkey-open.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-open/orders-index-custkey-open.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey/orders-index-custkey.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey/orders-index-custkey.1.ddl.aql
index 8b12616..2cfb39a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey/orders-index-custkey.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey/orders-index-custkey.1.ddl.aql
@@ -17,5 +17,3 @@
 create dataset Orders(OrderType)
   primary key o_orderkey;
 
-create index idx_Orders_Custkey on Orders(o_custkey);
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey/orders-index-custkey.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey/orders-index-custkey.3.ddl.aql
new file mode 100644
index 0000000..ed3fab0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey/orders-index-custkey.3.ddl.aql
@@ -0,0 +1,3 @@
+use dataverse tpch;
+
+create index idx_Orders_Custkey on Orders(o_custkey);
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey/orders-index-custkey.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey/orders-index-custkey.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey/orders-index-custkey.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey/orders-index-custkey.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search-open/range-search-open.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search-open/range-search-open.1.ddl.aql
index 265e110..530d7a9 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search-open/range-search-open.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search-open/range-search-open.1.ddl.aql
@@ -25,6 +25,3 @@
 create dataset LineItem(LineItemType)
   primary key l_orderkey, l_linenumber;
 
-create index idx_LineItem_partkey on LineItem(l_linenumber);
-create index idx_LineItem_suppkey on LineItem(l_suppkey);
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search-open/range-search-open.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search-open/range-search-open.3.ddl.aql
new file mode 100644
index 0000000..a3572c4
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search-open/range-search-open.3.ddl.aql
@@ -0,0 +1,5 @@
+use dataverse test;
+
+create index idx_LineItem_partkey on LineItem(l_linenumber);
+create index idx_LineItem_suppkey on LineItem(l_suppkey);
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search-open/range-search-open.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search-open/range-search-open.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/index-selection/range-search-open/range-search-open.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/index-selection/range-search-open/range-search-open.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search/range-search.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search/range-search.1.ddl.aql
index 89eeec3..5281e04 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search/range-search.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search/range-search.1.ddl.aql
@@ -25,7 +25,3 @@
 create dataset LineItem(LineItemType)
   primary key l_orderkey, l_linenumber;
 
-
-create index idx_LineItem_partkey on LineItem(l_linenumber);
-create index idx_LineItem_suppkey on LineItem(l_suppkey);
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search/range-search.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search/range-search.3.ddl.aql
new file mode 100644
index 0000000..75edda0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search/range-search.3.ddl.aql
@@ -0,0 +1,4 @@
+use dataverse test;
+
+create index idx_LineItem_partkey on LineItem(l_linenumber);
+create index idx_LineItem_suppkey on LineItem(l_suppkey);
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search/range-search.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search/range-search.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/index-selection/range-search/range-search.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/index-selection/range-search/range-search.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-nullable/rtree-secondary-index-nullable.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-nullable/rtree-secondary-index-nullable.1.ddl.aql
index 088317c..77b9ef2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-nullable/rtree-secondary-index-nullable.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-nullable/rtree-secondary-index-nullable.1.ddl.aql
@@ -16,5 +16,3 @@
 create dataset MyData(MyRecord)
   primary key id;
 
-create index rtree_index_point on MyData(point) type rtree;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-nullable/rtree-secondary-index-nullable.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-nullable/rtree-secondary-index-nullable.3.ddl.aql
new file mode 100644
index 0000000..b6a123e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-nullable/rtree-secondary-index-nullable.3.ddl.aql
@@ -0,0 +1,3 @@
+use dataverse test;
+
+create index rtree_index_point on MyData(point) type rtree;
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-nullable/rtree-secondary-index-nullable.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-nullable/rtree-secondary-index-nullable.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-nullable/rtree-secondary-index-nullable.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-nullable/rtree-secondary-index-nullable.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-open/rtree-secondary-index-open.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-open/rtree-secondary-index-open.1.ddl.aql
index be8978c..9de9b5e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-open/rtree-secondary-index-open.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-open/rtree-secondary-index-open.1.ddl.aql
@@ -16,5 +16,3 @@
 create dataset MyData(MyRecord)
   primary key id;
 
-create index rtree_index_point on MyData(point) type rtree;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-open/rtree-secondary-index-open.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-open/rtree-secondary-index-open.3.ddl.aql
new file mode 100644
index 0000000..b6a123e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-open/rtree-secondary-index-open.3.ddl.aql
@@ -0,0 +1,3 @@
+use dataverse test;
+
+create index rtree_index_point on MyData(point) type rtree;
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-open/rtree-secondary-index-open.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-open/rtree-secondary-index-open.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-open/rtree-secondary-index-open.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-open/rtree-secondary-index-open.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index/rtree-secondary-index.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index/rtree-secondary-index.1.ddl.aql
index 41973e1..52fa76f 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index/rtree-secondary-index.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index/rtree-secondary-index.1.ddl.aql
@@ -17,5 +17,3 @@
 create dataset MyData(MyRecord)
   primary key id;
 
-create index rtree_index_point on MyData(point) type rtree;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index/rtree-secondary-index.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index/rtree-secondary-index.3.ddl.aql
new file mode 100644
index 0000000..b6a123e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index/rtree-secondary-index.3.ddl.aql
@@ -0,0 +1,3 @@
+use dataverse test;
+
+create index rtree_index_point on MyData(point) type rtree;
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index/rtree-secondary-index.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index/rtree-secondary-index.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index/rtree-secondary-index.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index/rtree-secondary-index.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/load/issue289_query/issue289_query.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/load/issue289_query/issue289_query.1.ddl.aql
new file mode 100644
index 0000000..b9683dd
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/load/issue289_query/issue289_query.1.ddl.aql
@@ -0,0 +1,29 @@
+/*
+ * Description  : Load dataset with float numbers containing "E-4f"
+ * Expected Res : Success
+ * Date         : 01 Apr 2013
+ */
+ 
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as open {
+  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) 
+primary key cid;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/load/issue289_query/issue289_query.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/load/issue289_query/issue289_query.2.update.aql
new file mode 100644
index 0000000..f0671ca
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/load/issue289_query/issue289_query.2.update.aql
@@ -0,0 +1,11 @@
+/*
+ * Description  : Load dataset with float numbers containing "E-4f"
+ * Expected Res : Success
+ * Date         : 01 Apr 2013
+ */
+ 
+use dataverse test;
+
+load dataset Customers
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/custord-tiny/customer-tiny-neg.adm"),("format"="adm")) pre-sorted;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/load/issue289_query/issue289_query.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/load/issue289_query/issue289_query.3.query.aql
new file mode 100644
index 0000000..1d2c9b6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/load/issue289_query/issue289_query.3.query.aql
@@ -0,0 +1,12 @@
+/*
+ * Description  : Load dataset with float numbers containing "E-4f"
+ * Expected Res : Success
+ * Date         : 01 Apr 2013
+ */
+ 
+use dataverse test;
+
+count(
+for $l in dataset('Customers')
+return $l
+)
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/load/issue289_query/issue289_query.1.adm b/asterix-app/src/test/resources/runtimets/results/load/issue289_query/issue289_query.1.adm
new file mode 100644
index 0000000..9a03714
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/load/issue289_query/issue289_query.1.adm
@@ -0,0 +1 @@
+10
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterix-app/src/test/resources/runtimets/testsuite.xml
index af77e2f..4eb7b0f 100644
--- a/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -4046,6 +4046,11 @@
         <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error> 
       </compilation-unit>
     </test-case>
+    <test-case FilePath="load">
+      <compilation-unit name="issue289_query">
+        <output-dir compare="Text">issue289_query</output-dir>
+      </compilation-unit>
+    </test-case>
   </test-group>
   <test-group name="hints">
     <test-case FilePath="hints">
diff --git a/asterix-maven-plugins/lexer-generator-maven-plugin/src/main/java/edu/uci/ics/asterix/lexergenerator/rules/RulePartial.java b/asterix-maven-plugins/lexer-generator-maven-plugin/src/main/java/edu/uci/ics/asterix/lexergenerator/rules/RulePartial.java
index 89caf4f..045df58 100644
--- a/asterix-maven-plugins/lexer-generator-maven-plugin/src/main/java/edu/uci/ics/asterix/lexergenerator/rules/RulePartial.java
+++ b/asterix-maven-plugins/lexer-generator-maven-plugin/src/main/java/edu/uci/ics/asterix/lexergenerator/rules/RulePartial.java
@@ -61,8 +61,10 @@
     public String javaMatch(String action) {
         StringBuilder result = new StringBuilder();
         result.append("if (parse_" + partialName + "(currentChar)==TOKEN_" + partialName + "){");
+        result.append("currentChar = buffer[bufpos];");
         result.append(action);
         result.append("}");
+        result.append("else { currentChar = buffer[bufpos];}");
         return result.toString();
     }