SQL++ support in AsterixDB:
1. implemented SQL++ expression to logical plan translator;
2. refactored REST API to be agnostic of query languages;
3. disabled fuzzy join queries for SQL++ runtime tests;
4. fixed several rewriting rules.

Change-Id: I82919c4527b304325059519d819a2c30cf2902a9
Reviewed-on: https://asterix-gerrit.ics.uci.edu/479
Reviewed-by: Till Westmann <tillw@apache.org>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
diff --git a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/limit-issue353.sqlpp b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/limit-issue353.sqlpp
index e0b1b89..6900ac9 100644
--- a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/limit-issue353.sqlpp
+++ b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/limit-issue353.sqlpp
@@ -18,6 +18,10 @@
  */
 /*
  * Description  : This test case is to verify the fix for issue353
+ 				: https://code.google.com/p/asterixdb/issues/detail?id=353
+ * Expected Res : Success
+ * Date         : 28th April 2013
+ */
 
 drop  database tpch if exists;
 create  database tpch;
diff --git a/asterix-app/src/test/resources/optimizerts/results/disjunction-to-join-delete-1.plan b/asterix-app/src/test/resources/optimizerts/results/disjunction-to-join-delete-1.plan
index 563a75b..c65c71c 100644
--- a/asterix-app/src/test/resources/optimizerts/results/disjunction-to-join-delete-1.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/disjunction-to-join-delete-1.plan
@@ -12,12 +12,10 @@
                       -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                         -- ASSIGN  |PARTITIONED|
                           -- STREAM_PROJECT  |PARTITIONED|
-                            -- ASSIGN  |PARTITIONED|
-                              -- STREAM_PROJECT  |PARTITIONED|
+                            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                              -- BTREE_SEARCH  |PARTITIONED|
                                 -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                  -- BTREE_SEARCH  |PARTITIONED|
-                                    -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                      -- STABLE_SORT [$$15(ASC)]  |PARTITIONED|
-                                        -- HASH_PARTITION_EXCHANGE [$$15]  |PARTITIONED|
-                                          -- UNNEST  |UNPARTITIONED|
-                                            -- EMPTY_TUPLE_SOURCE  |UNPARTITIONED|
+                                  -- STABLE_SORT [$$11(ASC)]  |PARTITIONED|
+                                    -- HASH_PARTITION_EXCHANGE [$$11]  |PARTITIONED|
+                                      -- UNNEST  |UNPARTITIONED|
+                                        -- EMPTY_TUPLE_SOURCE  |UNPARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/disjunction-to-join-delete-2.plan b/asterix-app/src/test/resources/optimizerts/results/disjunction-to-join-delete-2.plan
index ba4c536..25b3396 100644
--- a/asterix-app/src/test/resources/optimizerts/results/disjunction-to-join-delete-2.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/disjunction-to-join-delete-2.plan
@@ -12,19 +12,16 @@
                       -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                         -- ASSIGN  |PARTITIONED|
                           -- STREAM_PROJECT  |PARTITIONED|
-                            -- ASSIGN  |PARTITIONED|
+                            -- STREAM_SELECT  |PARTITIONED|
                               -- STREAM_PROJECT  |PARTITIONED|
-                                -- STREAM_SELECT  |PARTITIONED|
-                                  -- ASSIGN  |PARTITIONED|
-                                    -- STREAM_PROJECT  |PARTITIONED|
-                                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                        -- BTREE_SEARCH  |PARTITIONED|
-                                          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                            -- STABLE_SORT [$$19(ASC)]  |PARTITIONED|
-                                              -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                                -- STREAM_PROJECT  |PARTITIONED|
-                                                  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                                    -- BTREE_SEARCH  |PARTITIONED|
-                                                      -- BROADCAST_EXCHANGE  |PARTITIONED|
-                                                        -- UNNEST  |UNPARTITIONED|
-                                                          -- EMPTY_TUPLE_SOURCE  |UNPARTITIONED|
+                                -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                  -- BTREE_SEARCH  |PARTITIONED|
+                                    -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                      -- STABLE_SORT [$$13(ASC)]  |PARTITIONED|
+                                        -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                          -- STREAM_PROJECT  |PARTITIONED|
+                                            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                              -- BTREE_SEARCH  |PARTITIONED|
+                                                -- BROADCAST_EXCHANGE  |PARTITIONED|
+                                                  -- UNNEST  |UNPARTITIONED|
+                                                    -- EMPTY_TUPLE_SOURCE  |UNPARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/disjunction-to-join-delete-3.plan b/asterix-app/src/test/resources/optimizerts/results/disjunction-to-join-delete-3.plan
index 55fc23c..37ccaf2 100644
--- a/asterix-app/src/test/resources/optimizerts/results/disjunction-to-join-delete-3.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/disjunction-to-join-delete-3.plan
@@ -9,20 +9,18 @@
                 -- INSERT_DELETE  |PARTITIONED|
                   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                     -- MATERIALIZE  |PARTITIONED|
-                      -- HASH_PARTITION_EXCHANGE [$$12]  |PARTITIONED|
+                      -- HASH_PARTITION_EXCHANGE [$$10]  |PARTITIONED|
                         -- ASSIGN  |PARTITIONED|
                           -- STREAM_PROJECT  |PARTITIONED|
-                            -- ASSIGN  |PARTITIONED|
-                              -- STREAM_PROJECT  |PARTITIONED|
-                                -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                  -- HYBRID_HASH_JOIN [$$15][$$13]  |PARTITIONED|
-                                    -- HASH_PARTITION_EXCHANGE [$$15]  |PARTITIONED|
-                                      -- UNNEST  |UNPARTITIONED|
-                                        -- EMPTY_TUPLE_SOURCE  |UNPARTITIONED|
-                                    -- HASH_PARTITION_EXCHANGE [$$13]  |PARTITIONED|
-                                      -- STREAM_PROJECT  |PARTITIONED|
-                                        -- ASSIGN  |PARTITIONED|
+                            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                              -- HYBRID_HASH_JOIN [$$11][$$9]  |PARTITIONED|
+                                -- HASH_PARTITION_EXCHANGE [$$11]  |PARTITIONED|
+                                  -- UNNEST  |UNPARTITIONED|
+                                    -- EMPTY_TUPLE_SOURCE  |UNPARTITIONED|
+                                -- HASH_PARTITION_EXCHANGE [$$9]  |PARTITIONED|
+                                  -- STREAM_PROJECT  |PARTITIONED|
+                                    -- ASSIGN  |PARTITIONED|
+                                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                        -- DATASOURCE_SCAN  |PARTITIONED|
                                           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                            -- DATASOURCE_SCAN  |PARTITIONED|
-                                              -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                                -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                                            -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/scan-delete-all.plan b/asterix-app/src/test/resources/optimizerts/results/scan-delete-all.plan
index c2173fb..5b1d2f8 100644
--- a/asterix-app/src/test/resources/optimizerts/results/scan-delete-all.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/scan-delete-all.plan
@@ -7,8 +7,7 @@
             -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
               -- ASSIGN  |PARTITIONED|
                 -- STREAM_PROJECT  |PARTITIONED|
-                  -- ASSIGN  |PARTITIONED|
-                    -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                      -- DATASOURCE_SCAN  |PARTITIONED|
-                        -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                          -- EMPTY_TUPLE_SOURCE  |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/scan-delete-rtree-secondary-index.plan b/asterix-app/src/test/resources/optimizerts/results/scan-delete-rtree-secondary-index.plan
index 691761d..ca4a6c2 100644
--- a/asterix-app/src/test/resources/optimizerts/results/scan-delete-rtree-secondary-index.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/scan-delete-rtree-secondary-index.plan
@@ -25,9 +25,8 @@
                           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                             -- ASSIGN  |PARTITIONED|
                               -- STREAM_PROJECT  |PARTITIONED|
-                                -- ASSIGN  |PARTITIONED|
-                                  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                    -- BTREE_SEARCH  |PARTITIONED|
-                                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                        -- ASSIGN  |PARTITIONED|
-                                          -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                                -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                  -- BTREE_SEARCH  |PARTITIONED|
+                                    -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                      -- ASSIGN  |PARTITIONED|
+                                        -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/scan-delete.plan b/asterix-app/src/test/resources/optimizerts/results/scan-delete.plan
index cfe5d35..790ac4f 100644
--- a/asterix-app/src/test/resources/optimizerts/results/scan-delete.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/scan-delete.plan
@@ -6,11 +6,9 @@
           -- MATERIALIZE  |PARTITIONED|
             -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
               -- ASSIGN  |PARTITIONED|
-                -- STREAM_PROJECT  |PARTITIONED|
-                  -- ASSIGN  |PARTITIONED|
-                    -- STREAM_SELECT  |PARTITIONED|
-                      -- ASSIGN  |PARTITIONED|
+                -- STREAM_SELECT  |PARTITIONED|
+                  -- STREAM_PROJECT  |PARTITIONED|
+                    -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                      -- DATASOURCE_SCAN  |PARTITIONED|
                         -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                          -- DATASOURCE_SCAN  |PARTITIONED|
-                            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                              -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                          -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/skip-index/dont-skip-primary-index-search-in-delete.plan b/asterix-app/src/test/resources/optimizerts/results/skip-index/dont-skip-primary-index-search-in-delete.plan
index e2e6dff..bc9f1d1 100644
--- a/asterix-app/src/test/resources/optimizerts/results/skip-index/dont-skip-primary-index-search-in-delete.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/skip-index/dont-skip-primary-index-search-in-delete.plan
@@ -7,9 +7,8 @@
             -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
               -- ASSIGN  |PARTITIONED|
                 -- STREAM_PROJECT  |PARTITIONED|
-                  -- ASSIGN  |PARTITIONED|
-                    -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                      -- BTREE_SEARCH  |PARTITIONED|
-                        -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                          -- ASSIGN  |PARTITIONED|
-                            -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                    -- BTREE_SEARCH  |PARTITIONED|
+                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                        -- ASSIGN  |PARTITIONED|
+                          -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/skip-index/skip-ngram-index-search-in-delete.plan b/asterix-app/src/test/resources/optimizerts/results/skip-index/skip-ngram-index-search-in-delete.plan
index c882d81..31de832 100644
--- a/asterix-app/src/test/resources/optimizerts/results/skip-index/skip-ngram-index-search-in-delete.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/skip-index/skip-ngram-index-search-in-delete.plan
@@ -11,11 +11,9 @@
                     -- MATERIALIZE  |PARTITIONED|
                       -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                         -- ASSIGN  |PARTITIONED|
-                          -- STREAM_PROJECT  |PARTITIONED|
-                            -- ASSIGN  |PARTITIONED|
-                              -- STREAM_SELECT  |PARTITIONED|
-                                -- ASSIGN  |PARTITIONED|
+                          -- STREAM_SELECT  |PARTITIONED|
+                            -- STREAM_PROJECT  |PARTITIONED|
+                              -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                -- DATASOURCE_SCAN  |PARTITIONED|
                                   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                    -- DATASOURCE_SCAN  |PARTITIONED|
-                                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                        -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                                    -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/skip-index/skip-rtree-index-search-in-delete.plan b/asterix-app/src/test/resources/optimizerts/results/skip-index/skip-rtree-index-search-in-delete.plan
index b69dfa3..0c406e2 100644
--- a/asterix-app/src/test/resources/optimizerts/results/skip-index/skip-rtree-index-search-in-delete.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/skip-index/skip-rtree-index-search-in-delete.plan
@@ -13,11 +13,9 @@
                         -- MATERIALIZE  |PARTITIONED|
                           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                             -- ASSIGN  |PARTITIONED|
-                              -- STREAM_PROJECT  |PARTITIONED|
-                                -- ASSIGN  |PARTITIONED|
-                                  -- STREAM_SELECT  |PARTITIONED|
-                                    -- ASSIGN  |PARTITIONED|
+                              -- STREAM_SELECT  |PARTITIONED|
+                                -- STREAM_PROJECT  |PARTITIONED|
+                                  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                    -- DATASOURCE_SCAN  |PARTITIONED|
                                       -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                        -- DATASOURCE_SCAN  |PARTITIONED|
-                                          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                            -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
\ No newline at end of file
+                                        -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/skip-index/skip-secondary-btree-index-search-in-delete.plan b/asterix-app/src/test/resources/optimizerts/results/skip-index/skip-secondary-btree-index-search-in-delete.plan
index c882d81..31de832 100644
--- a/asterix-app/src/test/resources/optimizerts/results/skip-index/skip-secondary-btree-index-search-in-delete.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/skip-index/skip-secondary-btree-index-search-in-delete.plan
@@ -11,11 +11,9 @@
                     -- MATERIALIZE  |PARTITIONED|
                       -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                         -- ASSIGN  |PARTITIONED|
-                          -- STREAM_PROJECT  |PARTITIONED|
-                            -- ASSIGN  |PARTITIONED|
-                              -- STREAM_SELECT  |PARTITIONED|
-                                -- ASSIGN  |PARTITIONED|
+                          -- STREAM_SELECT  |PARTITIONED|
+                            -- STREAM_PROJECT  |PARTITIONED|
+                              -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                -- DATASOURCE_SCAN  |PARTITIONED|
                                   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                    -- DATASOURCE_SCAN  |PARTITIONED|
-                                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                        -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                                    -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/skip-index/skip-word-index-search-in-delete.plan b/asterix-app/src/test/resources/optimizerts/results/skip-index/skip-word-index-search-in-delete.plan
index c882d81..31de832 100644
--- a/asterix-app/src/test/resources/optimizerts/results/skip-index/skip-word-index-search-in-delete.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/skip-index/skip-word-index-search-in-delete.plan
@@ -11,11 +11,9 @@
                     -- MATERIALIZE  |PARTITIONED|
                       -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                         -- ASSIGN  |PARTITIONED|
-                          -- STREAM_PROJECT  |PARTITIONED|
-                            -- ASSIGN  |PARTITIONED|
-                              -- STREAM_SELECT  |PARTITIONED|
-                                -- ASSIGN  |PARTITIONED|
+                          -- STREAM_SELECT  |PARTITIONED|
+                            -- STREAM_PROJECT  |PARTITIONED|
+                              -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                -- DATASOURCE_SCAN  |PARTITIONED|
                                   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                    -- DATASOURCE_SCAN  |PARTITIONED|
-                                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                        -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                                    -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
diff --git a/asterix-app/src/test/resources/optimizerts/results/sort-cust.plan b/asterix-app/src/test/resources/optimizerts/results/sort-cust.plan
index 5452f6f..66e6049 100644
--- a/asterix-app/src/test/resources/optimizerts/results/sort-cust.plan
+++ b/asterix-app/src/test/resources/optimizerts/results/sort-cust.plan
@@ -8,10 +8,9 @@
               -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                 -- STABLE_SORT [$$7(ASC)]  |PARTITIONED|
                   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                    -- STREAM_PROJECT  |PARTITIONED|
-                      -- ASSIGN  |PARTITIONED|
-                        -- STREAM_PROJECT  |PARTITIONED|
-                          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                            -- DATASOURCE_SCAN  |PARTITIONED|
-                              -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                -- EMPTY_TUPLE_SOURCE  |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_parser_sqlpp/consolidate-selects-complex.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/consolidate-selects-complex.ast
index 787d03f..d9e03df 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/consolidate-selects-complex.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/consolidate-selects-complex.ast
@@ -69,12 +69,12 @@
   OperatorExpr [
     IndexAccessor [
       Variable [ Name=jacca ]
-      Index:       Variable [ Name=jacca ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     IndexAccessor [
       Variable [ Name=jaccb ]
-      Index:       Variable [ Name=jaccb ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/const-folding.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/const-folding.ast
index 7b38d56..7422c7d 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/const-folding.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/const-folding.ast
@@ -20,10 +20,7 @@
           LiteralExpr [STRING] [foo]
           LiteralExpr [STRING] [bar]
         ]
-        Index:         OrderedListConstructor [
-          LiteralExpr [STRING] [foo]
-          LiteralExpr [STRING] [bar]
-        ]
+        Index:         LiteralExpr [LONG] [0]
       ]
     )
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/fj-phase1.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/fj-phase1.ast
index dc23607..61ad10d 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/fj-phase1.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/fj-phase1.ast
@@ -79,9 +79,6 @@
           With
           Variable [ Name=lottery_number ]
           Variable [ Name=user ]
-          Variable [ Name=lottery_number ]
-          Variable [ Name=tokens ]
-          Variable [ Name=user ]
 
         LetVariable [ Name=count ]
           :=
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/fj-phase2-with-hints.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/fj-phase2-with-hints.ast
index 48fcb34..8abbf79 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/fj-phase2-with-hints.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/fj-phase2-with-hints.ast
@@ -78,8 +78,6 @@
           With
           Variable [ Name=paper ]
           Variable [ Name=token ]
-          Variable [ Name=token ]
-          Variable [ Name=tokensDBLP ]
           Variable [ Name=unrankedTokensDBLP ]
           Variable [ Name=paperDBLP ]
 
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance-check-panic.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance-check-panic.ast
index 80ed456..67ddf2b 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance-check-panic.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance-check-panic.ast
@@ -33,5 +33,5 @@
 Where
   IndexAccessor [
     Variable [ Name=ed ]
-    Index:     Variable [ Name=ed ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance-check.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance-check.ast
index 8ba659b..376c1ca 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance-check.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-edit-distance-check.ast
@@ -30,12 +30,5 @@
       LiteralExpr [STRING] [Amihay Motro]
       LiteralExpr [LONG] [1]
     ]
-    Index:     FunctionCall test.edit-distance-check@3[
-      FieldAccessor [
-        Variable [ Name=o ]
-        Field=authors
-      ]
-      LiteralExpr [STRING] [Amihay Motro]
-      LiteralExpr [LONG] [1]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-jaccard-check.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-jaccard-check.ast
index 3a2e43d..29e43e3 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-jaccard-check.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ngram-jaccard-check.ast
@@ -39,20 +39,5 @@
       ]
       LiteralExpr [FLOAT] [0.5]
     ]
-    Index:     FunctionCall test.similarity-jaccard-check@3[
-      FunctionCall test.gram-tokens@3[
-        FieldAccessor [
-          Variable [ Name=o ]
-          Field=title
-        ]
-        LiteralExpr [LONG] [3]
-        LiteralExpr [FALSE]
-      ]
-      FunctionCall test.gram-tokens@3[
-        LiteralExpr [STRING] [Transactions for Cooperative Environments]
-        LiteralExpr [LONG] [3]
-        LiteralExpr [FALSE]
-      ]
-      LiteralExpr [FLOAT] [0.5]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance-check-panic.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance-check-panic.ast
index 6137ce8..906bdbe 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance-check-panic.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance-check-panic.ast
@@ -48,18 +48,7 @@
       ]
       LiteralExpr [LONG] [3]
     ]
-    Index:     FunctionCall test.edit-distance-check@3[
-      FieldAccessor [
-        Variable [ Name=c ]
-        Field=interests
-      ]
-      OrderedListConstructor [
-        LiteralExpr [STRING] [computers]
-        LiteralExpr [STRING] [wine]
-        LiteralExpr [STRING] [walking]
-      ]
-      LiteralExpr [LONG] [3]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
 Orderby
   FieldAccessor [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance-check.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance-check.ast
index e893033..831e8ae 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance-check.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-edit-distance-check.ast
@@ -48,18 +48,7 @@
       ]
       LiteralExpr [LONG] [1]
     ]
-    Index:     FunctionCall test.edit-distance-check@3[
-      FieldAccessor [
-        Variable [ Name=c ]
-        Field=interests
-      ]
-      OrderedListConstructor [
-        LiteralExpr [STRING] [computers]
-        LiteralExpr [STRING] [wine]
-        LiteralExpr [STRING] [walking]
-      ]
-      LiteralExpr [LONG] [1]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
 Orderby
   FieldAccessor [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-jaccard-check.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-jaccard-check.ast
index 6df827e..c515756 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-jaccard-check.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/olist-jaccard-check.ast
@@ -48,16 +48,5 @@
       ]
       LiteralExpr [FLOAT] [0.7]
     ]
-    Index:     FunctionCall test.similarity-jaccard-check@3[
-      FieldAccessor [
-        Variable [ Name=c ]
-        Field=interests
-      ]
-      OrderedListConstructor [
-        LiteralExpr [STRING] [databases]
-        LiteralExpr [STRING] [computers]
-        LiteralExpr [STRING] [wine]
-      ]
-      LiteralExpr [FLOAT] [0.7]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ulist-jaccard-check.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ulist-jaccard-check.ast
index 352c27b..feaf424 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ulist-jaccard-check.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/ulist-jaccard-check.ast
@@ -48,16 +48,5 @@
       ]
       LiteralExpr [FLOAT] [0.7]
     ]
-    Index:     FunctionCall test.similarity-jaccard-check@3[
-      FieldAccessor [
-        Variable [ Name=c ]
-        Field=interests
-      ]
-      UnorderedListConstructor [
-        LiteralExpr [STRING] [computers]
-        LiteralExpr [STRING] [wine]
-        LiteralExpr [STRING] [databases]
-      ]
-      LiteralExpr [FLOAT] [0.7]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/word-jaccard-check.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/word-jaccard-check.ast
index 721ba2f..f2fff63 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/word-jaccard-check.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-basic/word-jaccard-check.ast
@@ -34,16 +34,5 @@
       ]
       LiteralExpr [FLOAT] [0.5]
     ]
-    Index:     FunctionCall test.similarity-jaccard-check@3[
-      FunctionCall test.word-tokens@1[
-        FieldAccessor [
-          Variable [ Name=o ]
-          Field=title
-        ]
-      ]
-      FunctionCall test.word-tokens@1[
-        LiteralExpr [STRING] [Transactions for Cooperative Environments]
-      ]
-      LiteralExpr [FLOAT] [0.5]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.ast
index 7fd4d5e..252f82d 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.ast
@@ -44,11 +44,11 @@
   OperatorExpr [
     IndexAccessor [
       Variable [ Name=eda ]
-      Index:       Variable [ Name=eda ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     IndexAccessor [
       Variable [ Name=edb ]
-      Index:       Variable [ Name=edb ]
+      Index:       LiteralExpr [LONG] [0]
     ]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.ast
index ed8919f..6b707a0 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.ast
@@ -44,11 +44,11 @@
   OperatorExpr [
     IndexAccessor [
       Variable [ Name=edb ]
-      Index:       Variable [ Name=edb ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     IndexAccessor [
       Variable [ Name=eda ]
-      Index:       Variable [ Name=eda ]
+      Index:       LiteralExpr [LONG] [0]
     ]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let-panic.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let-panic.ast
index 0c3a146..4c375a0 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let-panic.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let-panic.ast
@@ -33,5 +33,5 @@
 Where
   IndexAccessor [
     Variable [ Name=ed ]
-    Index:     Variable [ Name=ed ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let.ast
index e33ade2..c0dc5f7 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-let.ast
@@ -33,5 +33,5 @@
 Where
   IndexAccessor [
     Variable [ Name=ed ]
-    Index:     Variable [ Name=ed ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-substring.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-substring.ast
index c02435c..c77c881 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-substring.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-substring.ast
@@ -51,16 +51,5 @@
       LiteralExpr [STRING] [datbase]
       LiteralExpr [LONG] [1]
     ]
-    Index:     FunctionCall test.edit-distance-check@3[
-      FunctionCall test.substring@3[
-        FieldAccessor [
-          Variable [ Name=paper ]
-          Field=title
-        ]
-        LiteralExpr [LONG] [0]
-        LiteralExpr [LONG] [8]
-      ]
-      LiteralExpr [STRING] [datbase]
-      LiteralExpr [LONG] [1]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-word-tokens.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-word-tokens.ast
index 8b24f37..0038f9b 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-word-tokens.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-edit-distance-check-word-tokens.ast
@@ -53,9 +53,5 @@
       LiteralExpr [STRING] [Multmedia]
       LiteralExpr [LONG] [1]
     ]
-    Index:     FunctionCall test.edit-distance-check@3[
-      Variable [ Name=word ]
-      LiteralExpr [STRING] [Multmedia]
-      LiteralExpr [LONG] [1]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-jaccard-check-let.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-jaccard-check-let.ast
index fe5751b..6ca88af 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-jaccard-check-let.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-jaccard-check-let.ast
@@ -42,5 +42,5 @@
 Where
   IndexAccessor [
     Variable [ Name=jacc ]
-    Index:     Variable [ Name=jacc ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-jaccard-check-multi-let.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-jaccard-check-multi-let.ast
index a2ce996..12cfef8 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-jaccard-check-multi-let.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ngram-jaccard-check-multi-let.ast
@@ -59,5 +59,5 @@
 Where
   IndexAccessor [
     Variable [ Name=jacc ]
-    Index:     Variable [ Name=jacc ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/olist-edit-distance-check-let-panic.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/olist-edit-distance-check-let-panic.ast
index d37e489..4e16c82 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/olist-edit-distance-check-let-panic.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/olist-edit-distance-check-let-panic.ast
@@ -51,7 +51,7 @@
 Where
   IndexAccessor [
     Variable [ Name=ed ]
-    Index:     Variable [ Name=ed ]
+    Index:     LiteralExpr [LONG] [0]
   ]
 Orderby
   FieldAccessor [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/olist-edit-distance-check-let.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/olist-edit-distance-check-let.ast
index 21b8dbb..98b185f 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/olist-edit-distance-check-let.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/olist-edit-distance-check-let.ast
@@ -51,7 +51,7 @@
 Where
   IndexAccessor [
     Variable [ Name=ed ]
-    Index:     Variable [ Name=ed ]
+    Index:     LiteralExpr [LONG] [0]
   ]
 Orderby
   FieldAccessor [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/olist-jaccard-check-let.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/olist-jaccard-check-let.ast
index 3bd622b..fc14ab3 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/olist-jaccard-check-let.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/olist-jaccard-check-let.ast
@@ -51,5 +51,5 @@
 Where
   IndexAccessor [
     Variable [ Name=jacc ]
-    Index:     Variable [ Name=jacc ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ulist-jaccard-check-let.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ulist-jaccard-check-let.ast
index f0bf820..d682832 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ulist-jaccard-check-let.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/ulist-jaccard-check-let.ast
@@ -51,5 +51,5 @@
 Where
   IndexAccessor [
     Variable [ Name=jacc ]
-    Index:     Variable [ Name=jacc ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/word-jaccard-check-let.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/word-jaccard-check-let.ast
index 6e32d34..8f294b1 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/word-jaccard-check-let.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/word-jaccard-check-let.ast
@@ -37,5 +37,5 @@
 Where
   IndexAccessor [
     Variable [ Name=jacc ]
-    Index:     Variable [ Name=jacc ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/word-jaccard-check-multi-let.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/word-jaccard-check-multi-let.ast
index 22ccaf9..55d0faa 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/word-jaccard-check-multi-let.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-complex/word-jaccard-check-multi-let.ast
@@ -54,5 +54,5 @@
 Where
   IndexAccessor [
     Variable [ Name=jacc ]
-    Index:     Variable [ Name=jacc ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/issue741.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/issue741.ast
index 25459dc..2840a58 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/issue741.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/issue741.ast
@@ -66,7 +66,7 @@
         OperatorExpr [
           IndexAccessor [
             Variable [ Name=sim ]
-            Index:             Variable [ Name=sim ]
+            Index:             LiteralExpr [LONG] [0]
           ]
           and
           OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.ast
index a3b4ee5..d3ed6f8 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.ast
@@ -96,7 +96,7 @@
         OperatorExpr [
           IndexAccessor [
             Variable [ Name=sim ]
-            Index:             Variable [ Name=sim ]
+            Index:             LiteralExpr [LONG] [0]
           ]
           and
           OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/leftouterjoin-probe-pidx-with-join-jaccard-check-idx_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/leftouterjoin-probe-pidx-with-join-jaccard-check-idx_01.ast
index d280beb..dfc11d5 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/leftouterjoin-probe-pidx-with-join-jaccard-check-idx_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/leftouterjoin-probe-pidx-with-join-jaccard-check-idx_01.ast
@@ -96,7 +96,7 @@
         OperatorExpr [
           IndexAccessor [
             Variable [ Name=sim ]
-            Index:             Variable [ Name=sim ]
+            Index:             LiteralExpr [LONG] [0]
           ]
           and
           OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-edit-distance-check_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-edit-distance-check_01.ast
index fe0a5ae..622076f 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-edit-distance-check_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-edit-distance-check_01.ast
@@ -61,17 +61,7 @@
         ]
         LiteralExpr [LONG] [3]
       ]
-      Index:       FunctionCall test.edit-distance-check@3[
-        FieldAccessor [
-          Variable [ Name=a ]
-          Field=authors
-        ]
-        FieldAccessor [
-          Variable [ Name=b ]
-          Field=authors
-        ]
-        LiteralExpr [LONG] [3]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-edit-distance-check_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-edit-distance-check_02.ast
index 226ef2da..9db438d 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-edit-distance-check_02.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-edit-distance-check_02.ast
@@ -61,17 +61,7 @@
         ]
         LiteralExpr [LONG] [3]
       ]
-      Index:       FunctionCall test.edit-distance-check@3[
-        FieldAccessor [
-          Variable [ Name=a ]
-          Field=authors
-        ]
-        FieldAccessor [
-          Variable [ Name=b ]
-          Field=authors
-        ]
-        LiteralExpr [LONG] [3]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-edit-distance-check_03.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-edit-distance-check_03.ast
index 22a1b5c..1a8e0d9 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-edit-distance-check_03.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-edit-distance-check_03.ast
@@ -51,17 +51,7 @@
         ]
         LiteralExpr [LONG] [3]
       ]
-      Index:       FunctionCall test.edit-distance-check@3[
-        FieldAccessor [
-          Variable [ Name=a ]
-          Field=authors
-        ]
-        FieldAccessor [
-          Variable [ Name=b ]
-          Field=authors
-        ]
-        LiteralExpr [LONG] [3]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-edit-distance-check_04.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-edit-distance-check_04.ast
index 5dd91f7..4429a97 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-edit-distance-check_04.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-edit-distance-check_04.ast
@@ -28,7 +28,7 @@
     :
     IndexAccessor [
       Variable [ Name=ed ]
-      Index:       Variable [ Name=ed ]
+      Index:       LiteralExpr [LONG] [1]
     ]
   )
 ]
@@ -62,7 +62,7 @@
   OperatorExpr [
     IndexAccessor [
       Variable [ Name=ed ]
-      Index:       Variable [ Name=ed ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-edit-distance-contains.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-edit-distance-contains.ast
index 2f33777..d099c60 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-edit-distance-contains.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-edit-distance-contains.ast
@@ -61,17 +61,7 @@
         ]
         LiteralExpr [LONG] [3]
       ]
-      Index:       FunctionCall test.edit-distance-contains@3[
-        FieldAccessor [
-          Variable [ Name=a ]
-          Field=authors
-        ]
-        FieldAccessor [
-          Variable [ Name=b ]
-          Field=authors
-        ]
-        LiteralExpr [LONG] [3]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-jaccard-check_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-jaccard-check_01.ast
index d0217af..f548b62 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-jaccard-check_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-jaccard-check_01.ast
@@ -70,25 +70,7 @@
         ]
         LiteralExpr [FLOAT] [0.5]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FunctionCall test.gram-tokens@3[
-          FieldAccessor [
-            Variable [ Name=a ]
-            Field=title
-          ]
-          LiteralExpr [LONG] [3]
-          LiteralExpr [FALSE]
-        ]
-        FunctionCall test.gram-tokens@3[
-          FieldAccessor [
-            Variable [ Name=b ]
-            Field=title
-          ]
-          LiteralExpr [LONG] [3]
-          LiteralExpr [FALSE]
-        ]
-        LiteralExpr [FLOAT] [0.5]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-jaccard-check_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-jaccard-check_02.ast
index 0fd14a4..9b46f1e 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-jaccard-check_02.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-jaccard-check_02.ast
@@ -70,25 +70,7 @@
         ]
         LiteralExpr [FLOAT] [0.5]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FunctionCall test.gram-tokens@3[
-          FieldAccessor [
-            Variable [ Name=a ]
-            Field=title
-          ]
-          LiteralExpr [LONG] [3]
-          LiteralExpr [FALSE]
-        ]
-        FunctionCall test.gram-tokens@3[
-          FieldAccessor [
-            Variable [ Name=b ]
-            Field=title
-          ]
-          LiteralExpr [LONG] [3]
-          LiteralExpr [FALSE]
-        ]
-        LiteralExpr [FLOAT] [0.5]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-jaccard-check_03.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-jaccard-check_03.ast
index b816313..37c880b 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-jaccard-check_03.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-jaccard-check_03.ast
@@ -60,25 +60,7 @@
         ]
         LiteralExpr [FLOAT] [0.5]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FunctionCall test.gram-tokens@3[
-          FieldAccessor [
-            Variable [ Name=a ]
-            Field=title
-          ]
-          LiteralExpr [LONG] [3]
-          LiteralExpr [FALSE]
-        ]
-        FunctionCall test.gram-tokens@3[
-          FieldAccessor [
-            Variable [ Name=b ]
-            Field=title
-          ]
-          LiteralExpr [LONG] [3]
-          LiteralExpr [FALSE]
-        ]
-        LiteralExpr [FLOAT] [0.5]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-jaccard-check_04.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-jaccard-check_04.ast
index 4695a2c..e270861 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-jaccard-check_04.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ngram-jaccard-check_04.ast
@@ -29,7 +29,7 @@
     :
     IndexAccessor [
       Variable [ Name=jacc ]
-      Index:       Variable [ Name=jacc ]
+      Index:       LiteralExpr [LONG] [1]
     ]
   )
 ]
@@ -71,7 +71,7 @@
   OperatorExpr [
     IndexAccessor [
       Variable [ Name=jacc ]
-      Index:       Variable [ Name=jacc ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-edit-distance-check_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-edit-distance-check_01.ast
index 50e0cac..4454367 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-edit-distance-check_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-edit-distance-check_01.ast
@@ -66,17 +66,7 @@
         ]
         LiteralExpr [LONG] [3]
       ]
-      Index:       FunctionCall test.edit-distance-check@3[
-        FieldAccessor [
-          Variable [ Name=a ]
-          Field=interests
-        ]
-        FieldAccessor [
-          Variable [ Name=b ]
-          Field=interests
-        ]
-        LiteralExpr [LONG] [3]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-edit-distance-check_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-edit-distance-check_02.ast
index a0714e9..3847e59 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-edit-distance-check_02.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-edit-distance-check_02.ast
@@ -66,17 +66,7 @@
         ]
         LiteralExpr [LONG] [3]
       ]
-      Index:       FunctionCall test.edit-distance-check@3[
-        FieldAccessor [
-          Variable [ Name=a ]
-          Field=interests
-        ]
-        FieldAccessor [
-          Variable [ Name=b ]
-          Field=interests
-        ]
-        LiteralExpr [LONG] [3]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-edit-distance-check_03.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-edit-distance-check_03.ast
index c76a987..35508b4 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-edit-distance-check_03.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-edit-distance-check_03.ast
@@ -65,17 +65,7 @@
         ]
         LiteralExpr [LONG] [3]
       ]
-      Index:       FunctionCall test.edit-distance-check@3[
-        FieldAccessor [
-          Variable [ Name=a ]
-          Field=interests
-        ]
-        FieldAccessor [
-          Variable [ Name=b ]
-          Field=interests
-        ]
-        LiteralExpr [LONG] [3]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-edit-distance-check_04.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-edit-distance-check_04.ast
index da43e50..18921c8 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-edit-distance-check_04.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-edit-distance-check_04.ast
@@ -42,7 +42,7 @@
     :
     IndexAccessor [
       Variable [ Name=ed ]
-      Index:       Variable [ Name=ed ]
+      Index:       LiteralExpr [LONG] [1]
     ]
   )
 ]
@@ -76,7 +76,7 @@
   OperatorExpr [
     IndexAccessor [
       Variable [ Name=ed ]
-      Index:       Variable [ Name=ed ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-jaccard-check_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-jaccard-check_01.ast
index 6047077..9a1841e 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-jaccard-check_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-jaccard-check_01.ast
@@ -66,17 +66,7 @@
         ]
         LiteralExpr [FLOAT] [0.7]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FieldAccessor [
-          Variable [ Name=a ]
-          Field=interests
-        ]
-        FieldAccessor [
-          Variable [ Name=b ]
-          Field=interests
-        ]
-        LiteralExpr [FLOAT] [0.7]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-jaccard-check_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-jaccard-check_02.ast
index 201c5b1..e41041e 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-jaccard-check_02.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-jaccard-check_02.ast
@@ -66,17 +66,7 @@
         ]
         LiteralExpr [FLOAT] [0.7]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FieldAccessor [
-          Variable [ Name=a ]
-          Field=interests
-        ]
-        FieldAccessor [
-          Variable [ Name=b ]
-          Field=interests
-        ]
-        LiteralExpr [FLOAT] [0.7]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-jaccard-check_03.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-jaccard-check_03.ast
index 2b79710..f6d1fdc 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-jaccard-check_03.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-jaccard-check_03.ast
@@ -65,17 +65,7 @@
         ]
         LiteralExpr [FLOAT] [0.7]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FieldAccessor [
-          Variable [ Name=a ]
-          Field=interests
-        ]
-        FieldAccessor [
-          Variable [ Name=b ]
-          Field=interests
-        ]
-        LiteralExpr [FLOAT] [0.7]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-jaccard-check_04.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-jaccard-check_04.ast
index e54b565..3f00899 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-jaccard-check_04.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/olist-jaccard-check_04.ast
@@ -42,7 +42,7 @@
     :
     IndexAccessor [
       Variable [ Name=jacc ]
-      Index:       Variable [ Name=jacc ]
+      Index:       LiteralExpr [LONG] [1]
     ]
   )
 ]
@@ -76,7 +76,7 @@
   OperatorExpr [
     IndexAccessor [
       Variable [ Name=jacc ]
-      Index:       Variable [ Name=jacc ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ulist-jaccard-check_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ulist-jaccard-check_01.ast
index 5522ff1..f7a9bb1 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ulist-jaccard-check_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ulist-jaccard-check_01.ast
@@ -66,17 +66,7 @@
         ]
         LiteralExpr [FLOAT] [0.7]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FieldAccessor [
-          Variable [ Name=a ]
-          Field=interests
-        ]
-        FieldAccessor [
-          Variable [ Name=b ]
-          Field=interests
-        ]
-        LiteralExpr [FLOAT] [0.7]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ulist-jaccard-check_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ulist-jaccard-check_02.ast
index ad4806a..b45a362 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ulist-jaccard-check_02.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ulist-jaccard-check_02.ast
@@ -66,17 +66,7 @@
         ]
         LiteralExpr [FLOAT] [0.7]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FieldAccessor [
-          Variable [ Name=a ]
-          Field=interests
-        ]
-        FieldAccessor [
-          Variable [ Name=b ]
-          Field=interests
-        ]
-        LiteralExpr [FLOAT] [0.7]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ulist-jaccard-check_03.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ulist-jaccard-check_03.ast
index fe395ab..27b6bc9 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ulist-jaccard-check_03.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ulist-jaccard-check_03.ast
@@ -65,17 +65,7 @@
         ]
         LiteralExpr [FLOAT] [0.7]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FieldAccessor [
-          Variable [ Name=a ]
-          Field=interests
-        ]
-        FieldAccessor [
-          Variable [ Name=b ]
-          Field=interests
-        ]
-        LiteralExpr [FLOAT] [0.7]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ulist-jaccard-check_04.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ulist-jaccard-check_04.ast
index 20a87d3..866c60b 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ulist-jaccard-check_04.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/ulist-jaccard-check_04.ast
@@ -42,7 +42,7 @@
     :
     IndexAccessor [
       Variable [ Name=jacc ]
-      Index:       Variable [ Name=jacc ]
+      Index:       LiteralExpr [LONG] [1]
     ]
   )
 ]
@@ -76,7 +76,7 @@
   OperatorExpr [
     IndexAccessor [
       Variable [ Name=jacc ]
-      Index:       Variable [ Name=jacc ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check-after-btree-access.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check-after-btree-access.ast
index 5b4c193..6e39512 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check-after-btree-access.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check-after-btree-access.ast
@@ -48,7 +48,7 @@
     :
     IndexAccessor [
       Variable [ Name=sim ]
-      Index:       Variable [ Name=sim ]
+      Index:       LiteralExpr [LONG] [1]
     ]
   )
 ]
@@ -86,7 +86,7 @@
   OperatorExpr [
     IndexAccessor [
       Variable [ Name=sim ]
-      Index:       Variable [ Name=sim ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_01.ast
index 6586148..96946f6 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_01.ast
@@ -65,21 +65,7 @@
         ]
         LiteralExpr [FLOAT] [0.5]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FunctionCall test.word-tokens@1[
-          FieldAccessor [
-            Variable [ Name=a ]
-            Field=title
-          ]
-        ]
-        FunctionCall test.word-tokens@1[
-          FieldAccessor [
-            Variable [ Name=b ]
-            Field=title
-          ]
-        ]
-        LiteralExpr [FLOAT] [0.5]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_02.ast
index 0b50ff8..08b886f 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_02.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_02.ast
@@ -65,21 +65,7 @@
         ]
         LiteralExpr [FLOAT] [0.5]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FunctionCall test.word-tokens@1[
-          FieldAccessor [
-            Variable [ Name=a ]
-            Field=title
-          ]
-        ]
-        FunctionCall test.word-tokens@1[
-          FieldAccessor [
-            Variable [ Name=b ]
-            Field=title
-          ]
-        ]
-        LiteralExpr [FLOAT] [0.5]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_03.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_03.ast
index 3c74848..63ee670 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_03.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_03.ast
@@ -55,21 +55,7 @@
         ]
         LiteralExpr [FLOAT] [0.5]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FunctionCall test.word-tokens@1[
-          FieldAccessor [
-            Variable [ Name=a ]
-            Field=title
-          ]
-        ]
-        FunctionCall test.word-tokens@1[
-          FieldAccessor [
-            Variable [ Name=b ]
-            Field=title
-          ]
-        ]
-        LiteralExpr [FLOAT] [0.5]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_04.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_04.ast
index 711c89a..50cf119 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_04.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/inverted-index-join/word-jaccard-check_04.ast
@@ -28,7 +28,7 @@
     :
     IndexAccessor [
       Variable [ Name=jacc ]
-      Index:       Variable [ Name=jacc ]
+      Index:       LiteralExpr [LONG] [1]
     ]
   )
 ]
@@ -66,7 +66,7 @@
   OperatorExpr [
     IndexAccessor [
       Variable [ Name=jacc ]
-      Index:       Variable [ Name=jacc ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/limit-issue353.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/limit-issue353.ast
index e69de29..86944f0 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/limit-issue353.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/limit-issue353.ast
@@ -0,0 +1,60 @@
+DataverseUse tpch
+TypeDecl LineItemType [
+  closed RecordType {
+    l_orderkey : int32,
+    l_partkey : int32,
+    l_suppkey : int32,
+    l_linenumber : int32,
+    l_quantity : double,
+    l_extendedprice : double,
+    l_discount : double,
+    l_tax : double,
+    l_returnflag : string,
+    l_linestatus : string,
+    l_shipdate : string,
+    l_commitdate : string,
+    l_receiptdate : string,
+    l_shipinstruct : string,
+    l_shipmode : string,
+    l_comment : string
+  }
+]
+DatasetDecl LineItem(LineItemType) partitioned by [[l_orderkey], [l_linenumber]]
+WriteOutputTo nc1:/tmp/push_limit.adm
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [l_returnflag]
+    :
+    FieldAccessor [
+      Variable [ Name=l ]
+      Field=l_returnflag
+    ]
+  )
+  (
+    LiteralExpr [STRING] [l_linestatus]
+    :
+    FieldAccessor [
+      Variable [ Name=l ]
+      Field=l_linestatus
+    ]
+  )
+  (
+    LiteralExpr [STRING] [l_shipmode]
+    :
+    FieldAccessor [
+      Variable [ Name=l ]
+      Field=l_shipmode
+    ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [LineItem]
+  ]
+  AS
+  Variable [ Name=l ]
+]
+Limit
+  LiteralExpr [LONG] [2]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/ngram-edit-distance-check-panic.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/ngram-edit-distance-check-panic.ast
index fb96e6c..6e4f00c 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/ngram-edit-distance-check-panic.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/ngram-edit-distance-check-panic.ast
@@ -41,5 +41,5 @@
 Where
   IndexAccessor [
     Variable [ Name=ed ]
-    Index:     Variable [ Name=ed ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/ngram-edit-distance-check.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/ngram-edit-distance-check.ast
index cab1fc3..9d115d0 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/ngram-edit-distance-check.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/ngram-edit-distance-check.ast
@@ -38,15 +38,5 @@
       LiteralExpr [STRING] [Amihay Motro]
       LiteralExpr [LONG] [1]
     ]
-    Index:     FunctionCall test.edit-distance-check@3[
-      FieldAccessor [
-        FieldAccessor [
-          Variable [ Name=o ]
-          Field=nested
-        ]
-        Field=authors
-      ]
-      LiteralExpr [STRING] [Amihay Motro]
-      LiteralExpr [LONG] [1]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/ngram-jaccard-check.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/ngram-jaccard-check.ast
index a62993b..9910e13 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/ngram-jaccard-check.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/ngram-jaccard-check.ast
@@ -47,23 +47,5 @@
       ]
       LiteralExpr [FLOAT] [0.5]
     ]
-    Index:     FunctionCall test.similarity-jaccard-check@3[
-      FunctionCall test.gram-tokens@3[
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=o ]
-            Field=nested
-          ]
-          Field=title
-        ]
-        LiteralExpr [LONG] [3]
-        LiteralExpr [FALSE]
-      ]
-      FunctionCall test.gram-tokens@3[
-        LiteralExpr [STRING] [Transactions for Cooperative Environments]
-        LiteralExpr [LONG] [3]
-        LiteralExpr [FALSE]
-      ]
-      LiteralExpr [FLOAT] [0.5]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/olist-edit-distance-check-panic.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/olist-edit-distance-check-panic.ast
index c4b3feb..45299e4 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/olist-edit-distance-check-panic.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/olist-edit-distance-check-panic.ast
@@ -57,21 +57,7 @@
       ]
       LiteralExpr [LONG] [3]
     ]
-    Index:     FunctionCall test.edit-distance-check@3[
-      FieldAccessor [
-        FieldAccessor [
-          Variable [ Name=c ]
-          Field=nested
-        ]
-        Field=interests
-      ]
-      OrderedListConstructor [
-        LiteralExpr [STRING] [computers]
-        LiteralExpr [STRING] [wine]
-        LiteralExpr [STRING] [walking]
-      ]
-      LiteralExpr [LONG] [3]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
 Orderby
   FieldAccessor [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/olist-edit-distance-check.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/olist-edit-distance-check.ast
index 49cb6f6..ba55373 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/olist-edit-distance-check.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/olist-edit-distance-check.ast
@@ -57,21 +57,7 @@
       ]
       LiteralExpr [LONG] [1]
     ]
-    Index:     FunctionCall test.edit-distance-check@3[
-      FieldAccessor [
-        FieldAccessor [
-          Variable [ Name=c ]
-          Field=nested
-        ]
-        Field=interests
-      ]
-      OrderedListConstructor [
-        LiteralExpr [STRING] [computers]
-        LiteralExpr [STRING] [wine]
-        LiteralExpr [STRING] [walking]
-      ]
-      LiteralExpr [LONG] [1]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
 Orderby
   FieldAccessor [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/olist-jaccard-check.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/olist-jaccard-check.ast
index c5d132d..8fdb849 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/olist-jaccard-check.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/olist-jaccard-check.ast
@@ -56,19 +56,5 @@
       ]
       LiteralExpr [FLOAT] [0.7]
     ]
-    Index:     FunctionCall test.similarity-jaccard-check@3[
-      FieldAccessor [
-        FieldAccessor [
-          Variable [ Name=c ]
-          Field=nested
-        ]
-        Field=interests
-      ]
-      OrderedListConstructor [
-        LiteralExpr [STRING] [databases]
-        LiteralExpr [STRING] [computers]
-        LiteralExpr [STRING] [wine]
-      ]
-      LiteralExpr [FLOAT] [0.7]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/ulist-jaccard-check.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/ulist-jaccard-check.ast
index 6d2fa02..05ef457 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/ulist-jaccard-check.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/ulist-jaccard-check.ast
@@ -57,19 +57,5 @@
       ]
       LiteralExpr [FLOAT] [0.7]
     ]
-    Index:     FunctionCall test.similarity-jaccard-check@3[
-      FieldAccessor [
-        FieldAccessor [
-          Variable [ Name=c ]
-          Field=nested
-        ]
-        Field=interests
-      ]
-      UnorderedListConstructor [
-        LiteralExpr [STRING] [computers]
-        LiteralExpr [STRING] [wine]
-        LiteralExpr [STRING] [databases]
-      ]
-      LiteralExpr [FLOAT] [0.7]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/word-jaccard-check.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/word-jaccard-check.ast
index a56a462..48041ed 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/word-jaccard-check.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-basic/word-jaccard-check.ast
@@ -42,19 +42,5 @@
       ]
       LiteralExpr [FLOAT] [0.5]
     ]
-    Index:     FunctionCall test.similarity-jaccard-check@3[
-      FunctionCall test.word-tokens@1[
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=o ]
-            Field=nested
-          ]
-          Field=title
-        ]
-      ]
-      FunctionCall test.word-tokens@1[
-        LiteralExpr [STRING] [Transactions for Cooperative Environments]
-      ]
-      LiteralExpr [FLOAT] [0.5]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.ast
index 6440f7e..0a742cf 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.ast
@@ -55,11 +55,11 @@
   OperatorExpr [
     IndexAccessor [
       Variable [ Name=eda ]
-      Index:       Variable [ Name=eda ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     IndexAccessor [
       Variable [ Name=edb ]
-      Index:       Variable [ Name=edb ]
+      Index:       LiteralExpr [LONG] [0]
     ]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.ast
index a3648fe..d22d189 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.ast
@@ -55,11 +55,11 @@
   OperatorExpr [
     IndexAccessor [
       Variable [ Name=edb ]
-      Index:       Variable [ Name=edb ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     IndexAccessor [
       Variable [ Name=eda ]
-      Index:       Variable [ Name=eda ]
+      Index:       LiteralExpr [LONG] [0]
     ]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-edit-distance-check-let-panic.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-edit-distance-check-let-panic.ast
index 9e51d97..b5d0555 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-edit-distance-check-let-panic.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-edit-distance-check-let-panic.ast
@@ -41,5 +41,5 @@
 Where
   IndexAccessor [
     Variable [ Name=ed ]
-    Index:     Variable [ Name=ed ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-edit-distance-check-let.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-edit-distance-check-let.ast
index 025aa20..bb08854 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-edit-distance-check-let.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-edit-distance-check-let.ast
@@ -41,5 +41,5 @@
 Where
   IndexAccessor [
     Variable [ Name=ed ]
-    Index:     Variable [ Name=ed ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-edit-distance-check-substring.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-edit-distance-check-substring.ast
index 83c6b9b..4b3c837 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-edit-distance-check-substring.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-edit-distance-check-substring.ast
@@ -65,19 +65,5 @@
       LiteralExpr [STRING] [datbase]
       LiteralExpr [LONG] [1]
     ]
-    Index:     FunctionCall test.edit-distance-check@3[
-      FunctionCall test.substring@3[
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=paper ]
-            Field=nested
-          ]
-          Field=title
-        ]
-        LiteralExpr [LONG] [0]
-        LiteralExpr [LONG] [8]
-      ]
-      LiteralExpr [STRING] [datbase]
-      LiteralExpr [LONG] [1]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-edit-distance-check-word-tokens.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-edit-distance-check-word-tokens.ast
index 4108c72..126477e 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-edit-distance-check-word-tokens.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-edit-distance-check-word-tokens.ast
@@ -67,9 +67,5 @@
       LiteralExpr [STRING] [Multmedia]
       LiteralExpr [LONG] [1]
     ]
-    Index:     FunctionCall test.edit-distance-check@3[
-      Variable [ Name=word ]
-      LiteralExpr [STRING] [Multmedia]
-      LiteralExpr [LONG] [1]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-jaccard-check-let.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-jaccard-check-let.ast
index 1fe0c3a..3127dde 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-jaccard-check-let.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-jaccard-check-let.ast
@@ -50,5 +50,5 @@
 Where
   IndexAccessor [
     Variable [ Name=jacc ]
-    Index:     Variable [ Name=jacc ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-jaccard-check-multi-let.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-jaccard-check-multi-let.ast
index e772f9f..1d5b117 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-jaccard-check-multi-let.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ngram-jaccard-check-multi-let.ast
@@ -67,5 +67,5 @@
 Where
   IndexAccessor [
     Variable [ Name=jacc ]
-    Index:     Variable [ Name=jacc ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/olist-edit-distance-check-let-panic.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/olist-edit-distance-check-let-panic.ast
index d54ef57..7ef0af8 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/olist-edit-distance-check-let-panic.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/olist-edit-distance-check-let-panic.ast
@@ -60,7 +60,7 @@
 Where
   IndexAccessor [
     Variable [ Name=ed ]
-    Index:     Variable [ Name=ed ]
+    Index:     LiteralExpr [LONG] [0]
   ]
 Orderby
   FieldAccessor [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/olist-edit-distance-check-let.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/olist-edit-distance-check-let.ast
index 29ce26d..2d29e6e 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/olist-edit-distance-check-let.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/olist-edit-distance-check-let.ast
@@ -60,7 +60,7 @@
 Where
   IndexAccessor [
     Variable [ Name=ed ]
-    Index:     Variable [ Name=ed ]
+    Index:     LiteralExpr [LONG] [0]
   ]
 Orderby
   FieldAccessor [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/olist-jaccard-check-let.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/olist-jaccard-check-let.ast
index 6fe8f83..922f9e1 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/olist-jaccard-check-let.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/olist-jaccard-check-let.ast
@@ -59,5 +59,5 @@
 Where
   IndexAccessor [
     Variable [ Name=jacc ]
-    Index:     Variable [ Name=jacc ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ulist-jaccard-check-let.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ulist-jaccard-check-let.ast
index ba67057..2ba4856 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ulist-jaccard-check-let.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/ulist-jaccard-check-let.ast
@@ -60,5 +60,5 @@
 Where
   IndexAccessor [
     Variable [ Name=jacc ]
-    Index:     Variable [ Name=jacc ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/word-jaccard-check-let.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/word-jaccard-check-let.ast
index 48e978f..8bed5bb 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/word-jaccard-check-let.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/word-jaccard-check-let.ast
@@ -45,5 +45,5 @@
 Where
   IndexAccessor [
     Variable [ Name=jacc ]
-    Index:     Variable [ Name=jacc ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/word-jaccard-check-multi-let.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/word-jaccard-check-multi-let.ast
index a6c08fa..d7c363b 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/word-jaccard-check-multi-let.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-complex/word-jaccard-check-multi-let.ast
@@ -62,5 +62,5 @@
 Where
   IndexAccessor [
     Variable [ Name=jacc ]
-    Index:     Variable [ Name=jacc ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.ast
index cadc921..406e9a2 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.ast
@@ -119,7 +119,7 @@
         OperatorExpr [
           IndexAccessor [
             Variable [ Name=sim ]
-            Index:             Variable [ Name=sim ]
+            Index:             LiteralExpr [LONG] [0]
           ]
           and
           OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/leftouterjoin-probe-pidx-with-join-jaccard-check-idx_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/leftouterjoin-probe-pidx-with-join-jaccard-check-idx_01.ast
index a698a84..80c231c 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/leftouterjoin-probe-pidx-with-join-jaccard-check-idx_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/leftouterjoin-probe-pidx-with-join-jaccard-check-idx_01.ast
@@ -119,7 +119,7 @@
         OperatorExpr [
           IndexAccessor [
             Variable [ Name=sim ]
-            Index:             Variable [ Name=sim ]
+            Index:             LiteralExpr [LONG] [0]
           ]
           and
           OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/ngram-edit-distance-check_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/ngram-edit-distance-check_01.ast
index 088d1ec..0d7ebe8 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/ngram-edit-distance-check_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/ngram-edit-distance-check_01.ast
@@ -77,23 +77,7 @@
         ]
         LiteralExpr [LONG] [3]
       ]
-      Index:       FunctionCall test.edit-distance-check@3[
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=a ]
-            Field=nested
-          ]
-          Field=authors
-        ]
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=b ]
-            Field=nested
-          ]
-          Field=authors
-        ]
-        LiteralExpr [LONG] [3]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/ngram-edit-distance-contains.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/ngram-edit-distance-contains.ast
index 24ca38a..1b61ffb 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/ngram-edit-distance-contains.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/ngram-edit-distance-contains.ast
@@ -77,23 +77,7 @@
         ]
         LiteralExpr [LONG] [3]
       ]
-      Index:       FunctionCall test.edit-distance-contains@3[
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=a ]
-            Field=nested
-          ]
-          Field=authors
-        ]
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=b ]
-            Field=nested
-          ]
-          Field=authors
-        ]
-        LiteralExpr [LONG] [3]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/ngram-jaccard-check_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/ngram-jaccard-check_01.ast
index 852ddc8..6de60d8 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/ngram-jaccard-check_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/ngram-jaccard-check_01.ast
@@ -86,31 +86,7 @@
         ]
         LiteralExpr [FLOAT] [0.5]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FunctionCall test.gram-tokens@3[
-          FieldAccessor [
-            FieldAccessor [
-              Variable [ Name=a ]
-              Field=nested
-            ]
-            Field=title
-          ]
-          LiteralExpr [LONG] [3]
-          LiteralExpr [FALSE]
-        ]
-        FunctionCall test.gram-tokens@3[
-          FieldAccessor [
-            FieldAccessor [
-              Variable [ Name=b ]
-              Field=nested
-            ]
-            Field=title
-          ]
-          LiteralExpr [LONG] [3]
-          LiteralExpr [FALSE]
-        ]
-        LiteralExpr [FLOAT] [0.5]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/olist-edit-distance-check_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/olist-edit-distance-check_01.ast
index 7cc0e31..a10f0dc 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/olist-edit-distance-check_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/olist-edit-distance-check_01.ast
@@ -77,23 +77,7 @@
         ]
         LiteralExpr [LONG] [3]
       ]
-      Index:       FunctionCall test.edit-distance-check@3[
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=a ]
-            Field=nested
-          ]
-          Field=interests
-        ]
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=b ]
-            Field=nested
-          ]
-          Field=interests
-        ]
-        LiteralExpr [LONG] [3]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/olist-jaccard-check_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/olist-jaccard-check_01.ast
index 280f534..c2c1017 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/olist-jaccard-check_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/olist-jaccard-check_01.ast
@@ -77,23 +77,7 @@
         ]
         LiteralExpr [FLOAT] [0.7]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=a ]
-            Field=nested
-          ]
-          Field=interests
-        ]
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=b ]
-            Field=nested
-          ]
-          Field=interests
-        ]
-        LiteralExpr [FLOAT] [0.7]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/ulist-jaccard-check_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/ulist-jaccard-check_01.ast
index 2f0cb06..ddbca88 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/ulist-jaccard-check_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/ulist-jaccard-check_01.ast
@@ -77,23 +77,7 @@
         ]
         LiteralExpr [FLOAT] [0.7]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=a ]
-            Field=nested
-          ]
-          Field=interests
-        ]
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=b ]
-            Field=nested
-          ]
-          Field=interests
-        ]
-        LiteralExpr [FLOAT] [0.7]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/word-jaccard-check-after-btree-access.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/word-jaccard-check-after-btree-access.ast
index 317caba..f2a55db 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/word-jaccard-check-after-btree-access.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/word-jaccard-check-after-btree-access.ast
@@ -59,7 +59,7 @@
     :
     IndexAccessor [
       Variable [ Name=sim ]
-      Index:       Variable [ Name=sim ]
+      Index:       LiteralExpr [LONG] [1]
     ]
   )
 ]
@@ -103,7 +103,7 @@
   OperatorExpr [
     IndexAccessor [
       Variable [ Name=sim ]
-      Index:       Variable [ Name=sim ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/word-jaccard-check_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/word-jaccard-check_01.ast
index 6daba98..d961d77 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/word-jaccard-check_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-index/inverted-index-join/word-jaccard-check_01.ast
@@ -81,27 +81,7 @@
         ]
         LiteralExpr [FLOAT] [0.5]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FunctionCall test.word-tokens@1[
-          FieldAccessor [
-            FieldAccessor [
-              Variable [ Name=a ]
-              Field=nested
-            ]
-            Field=title
-          ]
-        ]
-        FunctionCall test.word-tokens@1[
-          FieldAccessor [
-            FieldAccessor [
-              Variable [ Name=b ]
-              Field=nested
-            ]
-            Field=title
-          ]
-        ]
-        LiteralExpr [FLOAT] [0.5]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-basic/ngram-edit-distance-check-panic.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-basic/ngram-edit-distance-check-panic.ast
index d12ceed..79c8847 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-basic/ngram-edit-distance-check-panic.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-basic/ngram-edit-distance-check-panic.ast
@@ -40,5 +40,5 @@
 Where
   IndexAccessor [
     Variable [ Name=ed ]
-    Index:     Variable [ Name=ed ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-basic/ngram-edit-distance-check.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-basic/ngram-edit-distance-check.ast
index 4555873..bae732b 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-basic/ngram-edit-distance-check.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-basic/ngram-edit-distance-check.ast
@@ -37,15 +37,5 @@
       LiteralExpr [STRING] [Amihay Motro]
       LiteralExpr [LONG] [1]
     ]
-    Index:     FunctionCall test.edit-distance-check@3[
-      FieldAccessor [
-        FieldAccessor [
-          Variable [ Name=o ]
-          Field=nested
-        ]
-        Field=authors
-      ]
-      LiteralExpr [STRING] [Amihay Motro]
-      LiteralExpr [LONG] [1]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-basic/ngram-jaccard-check.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-basic/ngram-jaccard-check.ast
index 9b70e65..050941d 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-basic/ngram-jaccard-check.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-basic/ngram-jaccard-check.ast
@@ -46,23 +46,5 @@
       ]
       LiteralExpr [FLOAT] [0.5]
     ]
-    Index:     FunctionCall test.similarity-jaccard-check@3[
-      FunctionCall test.gram-tokens@3[
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=o ]
-            Field=nested
-          ]
-          Field=title
-        ]
-        LiteralExpr [LONG] [3]
-        LiteralExpr [FALSE]
-      ]
-      FunctionCall test.gram-tokens@3[
-        LiteralExpr [STRING] [Transactions for Cooperative Environments]
-        LiteralExpr [LONG] [3]
-        LiteralExpr [FALSE]
-      ]
-      LiteralExpr [FLOAT] [0.5]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-basic/word-jaccard-check.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-basic/word-jaccard-check.ast
index 4ce086b..9767039 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-basic/word-jaccard-check.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-basic/word-jaccard-check.ast
@@ -41,19 +41,5 @@
       ]
       LiteralExpr [FLOAT] [0.5]
     ]
-    Index:     FunctionCall test.similarity-jaccard-check@3[
-      FunctionCall test.word-tokens@1[
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=o ]
-            Field=nested
-          ]
-          Field=title
-        ]
-      ]
-      FunctionCall test.word-tokens@1[
-        LiteralExpr [STRING] [Transactions for Cooperative Environments]
-      ]
-      LiteralExpr [FLOAT] [0.5]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.ast
index 062e678..8a8f515 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.ast
@@ -54,11 +54,11 @@
   OperatorExpr [
     IndexAccessor [
       Variable [ Name=eda ]
-      Index:       Variable [ Name=eda ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     IndexAccessor [
       Variable [ Name=edb ]
-      Index:       Variable [ Name=edb ]
+      Index:       LiteralExpr [LONG] [0]
     ]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.ast
index b3d37bd..df1bc20 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.ast
@@ -54,11 +54,11 @@
   OperatorExpr [
     IndexAccessor [
       Variable [ Name=edb ]
-      Index:       Variable [ Name=edb ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     IndexAccessor [
       Variable [ Name=eda ]
-      Index:       Variable [ Name=eda ]
+      Index:       LiteralExpr [LONG] [0]
     ]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic.ast
index 83610a0..a0d5fb0 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic.ast
@@ -40,5 +40,5 @@
 Where
   IndexAccessor [
     Variable [ Name=ed ]
-    Index:     Variable [ Name=ed ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let.ast
index 04a8d06..a703ea7 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let.ast
@@ -40,5 +40,5 @@
 Where
   IndexAccessor [
     Variable [ Name=ed ]
-    Index:     Variable [ Name=ed ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-substring.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-substring.ast
index 36ca9fa..45a65dc 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-substring.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-substring.ast
@@ -64,19 +64,5 @@
       LiteralExpr [STRING] [datbase]
       LiteralExpr [LONG] [1]
     ]
-    Index:     FunctionCall test.edit-distance-check@3[
-      FunctionCall test.substring@3[
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=paper ]
-            Field=nested
-          ]
-          Field=title
-        ]
-        LiteralExpr [LONG] [0]
-        LiteralExpr [LONG] [8]
-      ]
-      LiteralExpr [STRING] [datbase]
-      LiteralExpr [LONG] [1]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-word-tokens.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-word-tokens.ast
index 00611cd..d594166 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-word-tokens.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-word-tokens.ast
@@ -66,9 +66,5 @@
       LiteralExpr [STRING] [Multmedia]
       LiteralExpr [LONG] [1]
     ]
-    Index:     FunctionCall test.edit-distance-check@3[
-      Variable [ Name=word ]
-      LiteralExpr [STRING] [Multmedia]
-      LiteralExpr [LONG] [1]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-jaccard-check-let.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-jaccard-check-let.ast
index 2289a82..9aad298 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-jaccard-check-let.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-jaccard-check-let.ast
@@ -49,5 +49,5 @@
 Where
   IndexAccessor [
     Variable [ Name=jacc ]
-    Index:     Variable [ Name=jacc ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-jaccard-check-multi-let.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-jaccard-check-multi-let.ast
index 2c41290..3dbce47 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-jaccard-check-multi-let.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/ngram-jaccard-check-multi-let.ast
@@ -66,5 +66,5 @@
 Where
   IndexAccessor [
     Variable [ Name=jacc ]
-    Index:     Variable [ Name=jacc ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/word-jaccard-check-let.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/word-jaccard-check-let.ast
index e2d7abe..313b91e 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/word-jaccard-check-let.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/word-jaccard-check-let.ast
@@ -44,5 +44,5 @@
 Where
   IndexAccessor [
     Variable [ Name=jacc ]
-    Index:     Variable [ Name=jacc ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/word-jaccard-check-multi-let.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/word-jaccard-check-multi-let.ast
index 37d4ee0..dd4889a 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/word-jaccard-check-multi-let.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-complex/word-jaccard-check-multi-let.ast
@@ -61,5 +61,5 @@
 Where
   IndexAccessor [
     Variable [ Name=jacc ]
-    Index:     Variable [ Name=jacc ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.ast
index 6bac05c..0fc1923 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.ast
@@ -118,7 +118,7 @@
         OperatorExpr [
           IndexAccessor [
             Variable [ Name=sim ]
-            Index:             Variable [ Name=sim ]
+            Index:             LiteralExpr [LONG] [0]
           ]
           and
           OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_01.ast
index a9c2373..f2e8971 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_01.ast
@@ -76,23 +76,7 @@
         ]
         LiteralExpr [LONG] [3]
       ]
-      Index:       FunctionCall test.edit-distance-check@3[
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=a ]
-            Field=nested
-          ]
-          Field=authors
-        ]
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=b ]
-            Field=nested
-          ]
-          Field=authors
-        ]
-        LiteralExpr [LONG] [3]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_02.ast
index 6c615b2..ecb4524 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_02.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_02.ast
@@ -76,23 +76,7 @@
         ]
         LiteralExpr [LONG] [3]
       ]
-      Index:       FunctionCall test.edit-distance-check@3[
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=a ]
-            Field=nested
-          ]
-          Field=authors
-        ]
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=b ]
-            Field=nested
-          ]
-          Field=authors
-        ]
-        LiteralExpr [LONG] [3]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_03.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_03.ast
index 567cac1..516b968 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_03.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_03.ast
@@ -61,23 +61,7 @@
         ]
         LiteralExpr [LONG] [3]
       ]
-      Index:       FunctionCall test.edit-distance-check@3[
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=a ]
-            Field=nested
-          ]
-          Field=authors
-        ]
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=b ]
-            Field=nested
-          ]
-          Field=authors
-        ]
-        LiteralExpr [LONG] [3]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_04.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_04.ast
index b4e0ea6..4be1dbf 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_04.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_04.ast
@@ -75,23 +75,7 @@
         ]
         LiteralExpr [LONG] [3]
       ]
-      Index:       FunctionCall test.edit-distance-check@3[
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=a ]
-            Field=nested
-          ]
-          Field=authors
-        ]
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=b ]
-            Field=nested
-          ]
-          Field=authors
-        ]
-        LiteralExpr [LONG] [3]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_05.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_05.ast
index b4e0ea6..4be1dbf 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_05.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_05.ast
@@ -75,23 +75,7 @@
         ]
         LiteralExpr [LONG] [3]
       ]
-      Index:       FunctionCall test.edit-distance-check@3[
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=a ]
-            Field=nested
-          ]
-          Field=authors
-        ]
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=b ]
-            Field=nested
-          ]
-          Field=authors
-        ]
-        LiteralExpr [LONG] [3]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-contains.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-contains.ast
index ec7ea04..c31bb76 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-contains.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-contains.ast
@@ -76,23 +76,7 @@
         ]
         LiteralExpr [LONG] [3]
       ]
-      Index:       FunctionCall test.edit-distance-contains@3[
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=a ]
-            Field=nested
-          ]
-          Field=authors
-        ]
-        FieldAccessor [
-          FieldAccessor [
-            Variable [ Name=b ]
-            Field=nested
-          ]
-          Field=authors
-        ]
-        LiteralExpr [LONG] [3]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_01.ast
index 680f1a4..8e100f1 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_01.ast
@@ -85,31 +85,7 @@
         ]
         LiteralExpr [FLOAT] [0.5]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FunctionCall test.gram-tokens@3[
-          FieldAccessor [
-            FieldAccessor [
-              Variable [ Name=a ]
-              Field=nested
-            ]
-            Field=title
-          ]
-          LiteralExpr [LONG] [3]
-          LiteralExpr [FALSE]
-        ]
-        FunctionCall test.gram-tokens@3[
-          FieldAccessor [
-            FieldAccessor [
-              Variable [ Name=b ]
-              Field=nested
-            ]
-            Field=title
-          ]
-          LiteralExpr [LONG] [3]
-          LiteralExpr [FALSE]
-        ]
-        LiteralExpr [FLOAT] [0.5]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_02.ast
index c8c76ed..1b9f971 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_02.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_02.ast
@@ -85,31 +85,7 @@
         ]
         LiteralExpr [FLOAT] [0.5]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FunctionCall test.gram-tokens@3[
-          FieldAccessor [
-            FieldAccessor [
-              Variable [ Name=a ]
-              Field=nested
-            ]
-            Field=title
-          ]
-          LiteralExpr [LONG] [3]
-          LiteralExpr [FALSE]
-        ]
-        FunctionCall test.gram-tokens@3[
-          FieldAccessor [
-            FieldAccessor [
-              Variable [ Name=b ]
-              Field=nested
-            ]
-            Field=title
-          ]
-          LiteralExpr [LONG] [3]
-          LiteralExpr [FALSE]
-        ]
-        LiteralExpr [FLOAT] [0.5]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_03.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_03.ast
index 5c27747..d2f1b23 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_03.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_03.ast
@@ -70,31 +70,7 @@
         ]
         LiteralExpr [FLOAT] [0.5]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FunctionCall test.gram-tokens@3[
-          FieldAccessor [
-            FieldAccessor [
-              Variable [ Name=a ]
-              Field=nested
-            ]
-            Field=title
-          ]
-          LiteralExpr [LONG] [3]
-          LiteralExpr [FALSE]
-        ]
-        FunctionCall test.gram-tokens@3[
-          FieldAccessor [
-            FieldAccessor [
-              Variable [ Name=b ]
-              Field=nested
-            ]
-            Field=title
-          ]
-          LiteralExpr [LONG] [3]
-          LiteralExpr [FALSE]
-        ]
-        LiteralExpr [FLOAT] [0.5]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_04.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_04.ast
index 0aaba9d..214121f 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_04.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_04.ast
@@ -84,31 +84,7 @@
         ]
         LiteralExpr [FLOAT] [0.5]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FunctionCall test.gram-tokens@3[
-          FieldAccessor [
-            FieldAccessor [
-              Variable [ Name=a ]
-              Field=nested
-            ]
-            Field=title
-          ]
-          LiteralExpr [LONG] [3]
-          LiteralExpr [FALSE]
-        ]
-        FunctionCall test.gram-tokens@3[
-          FieldAccessor [
-            FieldAccessor [
-              Variable [ Name=b ]
-              Field=nested
-            ]
-            Field=title
-          ]
-          LiteralExpr [LONG] [3]
-          LiteralExpr [FALSE]
-        ]
-        LiteralExpr [FLOAT] [0.5]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check-after-btree-access.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check-after-btree-access.ast
index 6ea18ab..035e20b 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check-after-btree-access.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check-after-btree-access.ast
@@ -58,7 +58,7 @@
     :
     IndexAccessor [
       Variable [ Name=sim ]
-      Index:       Variable [ Name=sim ]
+      Index:       LiteralExpr [LONG] [1]
     ]
   )
 ]
@@ -102,7 +102,7 @@
   OperatorExpr [
     IndexAccessor [
       Variable [ Name=sim ]
-      Index:       Variable [ Name=sim ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_01.ast
index b87f210..37a6c4a 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_01.ast
@@ -80,27 +80,7 @@
         ]
         LiteralExpr [FLOAT] [0.5]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FunctionCall test.word-tokens@1[
-          FieldAccessor [
-            FieldAccessor [
-              Variable [ Name=a ]
-              Field=nested
-            ]
-            Field=title
-          ]
-        ]
-        FunctionCall test.word-tokens@1[
-          FieldAccessor [
-            FieldAccessor [
-              Variable [ Name=b ]
-              Field=nested
-            ]
-            Field=title
-          ]
-        ]
-        LiteralExpr [FLOAT] [0.5]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_02.ast
index 0941add..1192b39 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_02.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_02.ast
@@ -80,27 +80,7 @@
         ]
         LiteralExpr [FLOAT] [0.5]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FunctionCall test.word-tokens@1[
-          FieldAccessor [
-            FieldAccessor [
-              Variable [ Name=a ]
-              Field=nested
-            ]
-            Field=title
-          ]
-        ]
-        FunctionCall test.word-tokens@1[
-          FieldAccessor [
-            FieldAccessor [
-              Variable [ Name=b ]
-              Field=nested
-            ]
-            Field=title
-          ]
-        ]
-        LiteralExpr [FLOAT] [0.5]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_03.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_03.ast
index eee4066..998e6e6 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_03.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_03.ast
@@ -65,27 +65,7 @@
         ]
         LiteralExpr [FLOAT] [0.5]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FunctionCall test.word-tokens@1[
-          FieldAccessor [
-            FieldAccessor [
-              Variable [ Name=a ]
-              Field=nested
-            ]
-            Field=title
-          ]
-        ]
-        FunctionCall test.word-tokens@1[
-          FieldAccessor [
-            FieldAccessor [
-              Variable [ Name=b ]
-              Field=nested
-            ]
-            Field=title
-          ]
-        ]
-        LiteralExpr [FLOAT] [0.5]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_04.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_04.ast
index 10e9f85..45fe598 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_04.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_04.ast
@@ -79,27 +79,7 @@
         ]
         LiteralExpr [FLOAT] [0.5]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FunctionCall test.word-tokens@1[
-          FieldAccessor [
-            FieldAccessor [
-              Variable [ Name=a ]
-              Field=nested
-            ]
-            Field=title
-          ]
-        ]
-        FunctionCall test.word-tokens@1[
-          FieldAccessor [
-            FieldAccessor [
-              Variable [ Name=b ]
-              Field=nested
-            ]
-            Field=title
-          ]
-        ]
-        LiteralExpr [FLOAT] [0.5]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-basic/ngram-edit-distance-check-panic.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-basic/ngram-edit-distance-check-panic.ast
index 1bc655f..38ac11e 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-basic/ngram-edit-distance-check-panic.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-basic/ngram-edit-distance-check-panic.ast
@@ -32,5 +32,5 @@
 Where
   IndexAccessor [
     Variable [ Name=ed ]
-    Index:     Variable [ Name=ed ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-basic/ngram-edit-distance-check.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-basic/ngram-edit-distance-check.ast
index 535abc4..f940637 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-basic/ngram-edit-distance-check.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-basic/ngram-edit-distance-check.ast
@@ -29,12 +29,5 @@
       LiteralExpr [STRING] [Amihay Motro]
       LiteralExpr [LONG] [1]
     ]
-    Index:     FunctionCall test.edit-distance-check@3[
-      FieldAccessor [
-        Variable [ Name=o ]
-        Field=authors
-      ]
-      LiteralExpr [STRING] [Amihay Motro]
-      LiteralExpr [LONG] [1]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-basic/ngram-jaccard-check.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-basic/ngram-jaccard-check.ast
index a80c3b5..acd8e29 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-basic/ngram-jaccard-check.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-basic/ngram-jaccard-check.ast
@@ -38,20 +38,5 @@
       ]
       LiteralExpr [FLOAT] [0.5]
     ]
-    Index:     FunctionCall test.similarity-jaccard-check@3[
-      FunctionCall test.gram-tokens@3[
-        FieldAccessor [
-          Variable [ Name=o ]
-          Field=title
-        ]
-        LiteralExpr [LONG] [3]
-        LiteralExpr [FALSE]
-      ]
-      FunctionCall test.gram-tokens@3[
-        LiteralExpr [STRING] [Transactions for Cooperative Environments]
-        LiteralExpr [LONG] [3]
-        LiteralExpr [FALSE]
-      ]
-      LiteralExpr [FLOAT] [0.5]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-basic/word-jaccard-check.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-basic/word-jaccard-check.ast
index 4e94166..2d26dd9 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-basic/word-jaccard-check.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-basic/word-jaccard-check.ast
@@ -33,16 +33,5 @@
       ]
       LiteralExpr [FLOAT] [0.5]
     ]
-    Index:     FunctionCall test.similarity-jaccard-check@3[
-      FunctionCall test.word-tokens@1[
-        FieldAccessor [
-          Variable [ Name=o ]
-          Field=title
-        ]
-      ]
-      FunctionCall test.word-tokens@1[
-        LiteralExpr [STRING] [Transactions for Cooperative Environments]
-      ]
-      LiteralExpr [FLOAT] [0.5]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.ast
index b4ae60d..5e86c12 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.ast
@@ -43,11 +43,11 @@
   OperatorExpr [
     IndexAccessor [
       Variable [ Name=eda ]
-      Index:       Variable [ Name=eda ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     IndexAccessor [
       Variable [ Name=edb ]
-      Index:       Variable [ Name=edb ]
+      Index:       LiteralExpr [LONG] [0]
     ]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.ast
index 117c646..7c10bfa 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.ast
@@ -43,11 +43,11 @@
   OperatorExpr [
     IndexAccessor [
       Variable [ Name=edb ]
-      Index:       Variable [ Name=edb ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     IndexAccessor [
       Variable [ Name=eda ]
-      Index:       Variable [ Name=eda ]
+      Index:       LiteralExpr [LONG] [0]
     ]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic.ast
index 0dbfd47..5da4fe4 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic.ast
@@ -32,5 +32,5 @@
 Where
   IndexAccessor [
     Variable [ Name=ed ]
-    Index:     Variable [ Name=ed ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let.ast
index 6e36688..601b7cf 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let.ast
@@ -32,5 +32,5 @@
 Where
   IndexAccessor [
     Variable [ Name=ed ]
-    Index:     Variable [ Name=ed ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-substring.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-substring.ast
index 326ecfa..1887616 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-substring.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-substring.ast
@@ -50,16 +50,5 @@
       LiteralExpr [STRING] [datbase]
       LiteralExpr [LONG] [1]
     ]
-    Index:     FunctionCall test.edit-distance-check@3[
-      FunctionCall test.substring@3[
-        FieldAccessor [
-          Variable [ Name=paper ]
-          Field=title
-        ]
-        LiteralExpr [LONG] [0]
-        LiteralExpr [LONG] [8]
-      ]
-      LiteralExpr [STRING] [datbase]
-      LiteralExpr [LONG] [1]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-word-tokens.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-word-tokens.ast
index 146b5fb..665e2cb 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-word-tokens.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-word-tokens.ast
@@ -52,9 +52,5 @@
       LiteralExpr [STRING] [Multmedia]
       LiteralExpr [LONG] [1]
     ]
-    Index:     FunctionCall test.edit-distance-check@3[
-      Variable [ Name=word ]
-      LiteralExpr [STRING] [Multmedia]
-      LiteralExpr [LONG] [1]
-    ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-jaccard-check-let.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-jaccard-check-let.ast
index 50c1eee..570f695 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-jaccard-check-let.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-jaccard-check-let.ast
@@ -41,5 +41,5 @@
 Where
   IndexAccessor [
     Variable [ Name=jacc ]
-    Index:     Variable [ Name=jacc ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-jaccard-check-multi-let.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-jaccard-check-multi-let.ast
index a021ee6..f65f836 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-jaccard-check-multi-let.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/ngram-jaccard-check-multi-let.ast
@@ -58,5 +58,5 @@
 Where
   IndexAccessor [
     Variable [ Name=jacc ]
-    Index:     Variable [ Name=jacc ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/word-jaccard-check-let.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/word-jaccard-check-let.ast
index 572a3b5..fee2bac 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/word-jaccard-check-let.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/word-jaccard-check-let.ast
@@ -36,5 +36,5 @@
 Where
   IndexAccessor [
     Variable [ Name=jacc ]
-    Index:     Variable [ Name=jacc ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/word-jaccard-check-multi-let.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/word-jaccard-check-multi-let.ast
index 4e81a84..ee42128 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/word-jaccard-check-multi-let.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-complex/word-jaccard-check-multi-let.ast
@@ -53,5 +53,5 @@
 Where
   IndexAccessor [
     Variable [ Name=jacc ]
-    Index:     Variable [ Name=jacc ]
+    Index:     LiteralExpr [LONG] [0]
   ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.ast
index 7cb7620..fc462c7 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.ast
@@ -95,7 +95,7 @@
         OperatorExpr [
           IndexAccessor [
             Variable [ Name=sim ]
-            Index:             Variable [ Name=sim ]
+            Index:             LiteralExpr [LONG] [0]
           ]
           and
           OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_01.ast
index e2be001..497999b 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_01.ast
@@ -60,17 +60,7 @@
         ]
         LiteralExpr [LONG] [3]
       ]
-      Index:       FunctionCall test.edit-distance-check@3[
-        FieldAccessor [
-          Variable [ Name=a ]
-          Field=authors
-        ]
-        FieldAccessor [
-          Variable [ Name=b ]
-          Field=authors
-        ]
-        LiteralExpr [LONG] [3]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_02.ast
index ee772de..792a4e9 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_02.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_02.ast
@@ -60,17 +60,7 @@
         ]
         LiteralExpr [LONG] [3]
       ]
-      Index:       FunctionCall test.edit-distance-check@3[
-        FieldAccessor [
-          Variable [ Name=a ]
-          Field=authors
-        ]
-        FieldAccessor [
-          Variable [ Name=b ]
-          Field=authors
-        ]
-        LiteralExpr [LONG] [3]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_03.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_03.ast
index 2625826..d611005 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_03.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_03.ast
@@ -50,17 +50,7 @@
         ]
         LiteralExpr [LONG] [3]
       ]
-      Index:       FunctionCall test.edit-distance-check@3[
-        FieldAccessor [
-          Variable [ Name=a ]
-          Field=authors
-        ]
-        FieldAccessor [
-          Variable [ Name=b ]
-          Field=authors
-        ]
-        LiteralExpr [LONG] [3]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_04.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_04.ast
index c03fc57..205ee3e 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_04.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_04.ast
@@ -59,17 +59,7 @@
         ]
         LiteralExpr [LONG] [3]
       ]
-      Index:       FunctionCall test.edit-distance-check@3[
-        FieldAccessor [
-          Variable [ Name=a ]
-          Field=authors
-        ]
-        FieldAccessor [
-          Variable [ Name=b ]
-          Field=authors
-        ]
-        LiteralExpr [LONG] [3]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_05.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_05.ast
index c03fc57..205ee3e 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_05.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_05.ast
@@ -59,17 +59,7 @@
         ]
         LiteralExpr [LONG] [3]
       ]
-      Index:       FunctionCall test.edit-distance-check@3[
-        FieldAccessor [
-          Variable [ Name=a ]
-          Field=authors
-        ]
-        FieldAccessor [
-          Variable [ Name=b ]
-          Field=authors
-        ]
-        LiteralExpr [LONG] [3]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_inline_03.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_inline_03.ast
index 4f9f6f5..d0930e1 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_inline_03.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_inline_03.ast
@@ -27,7 +27,7 @@
     :
     IndexAccessor [
       Variable [ Name=ed ]
-      Index:       Variable [ Name=ed ]
+      Index:       LiteralExpr [LONG] [1]
     ]
   )
 ]
@@ -61,7 +61,7 @@
   OperatorExpr [
     IndexAccessor [
       Variable [ Name=ed ]
-      Index:       Variable [ Name=ed ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-contains.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-contains.ast
index 1078ccd..03d5c1d 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-contains.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-contains.ast
@@ -60,17 +60,7 @@
         ]
         LiteralExpr [LONG] [3]
       ]
-      Index:       FunctionCall test.edit-distance-contains@3[
-        FieldAccessor [
-          Variable [ Name=a ]
-          Field=authors
-        ]
-        FieldAccessor [
-          Variable [ Name=b ]
-          Field=authors
-        ]
-        LiteralExpr [LONG] [3]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_01.ast
index 36048d7..9b25b7e 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_01.ast
@@ -69,25 +69,7 @@
         ]
         LiteralExpr [FLOAT] [0.5]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FunctionCall test.gram-tokens@3[
-          FieldAccessor [
-            Variable [ Name=a ]
-            Field=title
-          ]
-          LiteralExpr [LONG] [3]
-          LiteralExpr [FALSE]
-        ]
-        FunctionCall test.gram-tokens@3[
-          FieldAccessor [
-            Variable [ Name=b ]
-            Field=title
-          ]
-          LiteralExpr [LONG] [3]
-          LiteralExpr [FALSE]
-        ]
-        LiteralExpr [FLOAT] [0.5]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_02.ast
index 6b235f1..bba3d50 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_02.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_02.ast
@@ -69,25 +69,7 @@
         ]
         LiteralExpr [FLOAT] [0.5]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FunctionCall test.gram-tokens@3[
-          FieldAccessor [
-            Variable [ Name=a ]
-            Field=title
-          ]
-          LiteralExpr [LONG] [3]
-          LiteralExpr [FALSE]
-        ]
-        FunctionCall test.gram-tokens@3[
-          FieldAccessor [
-            Variable [ Name=b ]
-            Field=title
-          ]
-          LiteralExpr [LONG] [3]
-          LiteralExpr [FALSE]
-        ]
-        LiteralExpr [FLOAT] [0.5]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_03.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_03.ast
index da9f690..ed59daf 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_03.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_03.ast
@@ -59,25 +59,7 @@
         ]
         LiteralExpr [FLOAT] [0.5]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FunctionCall test.gram-tokens@3[
-          FieldAccessor [
-            Variable [ Name=a ]
-            Field=title
-          ]
-          LiteralExpr [LONG] [3]
-          LiteralExpr [FALSE]
-        ]
-        FunctionCall test.gram-tokens@3[
-          FieldAccessor [
-            Variable [ Name=b ]
-            Field=title
-          ]
-          LiteralExpr [LONG] [3]
-          LiteralExpr [FALSE]
-        ]
-        LiteralExpr [FLOAT] [0.5]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_04.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_04.ast
index 3410831..5c9ca54 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_04.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_04.ast
@@ -68,25 +68,7 @@
         ]
         LiteralExpr [FLOAT] [0.5]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FunctionCall test.gram-tokens@3[
-          FieldAccessor [
-            Variable [ Name=a ]
-            Field=title
-          ]
-          LiteralExpr [LONG] [3]
-          LiteralExpr [FALSE]
-        ]
-        FunctionCall test.gram-tokens@3[
-          FieldAccessor [
-            Variable [ Name=b ]
-            Field=title
-          ]
-          LiteralExpr [LONG] [3]
-          LiteralExpr [FALSE]
-        ]
-        LiteralExpr [FLOAT] [0.5]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_inline_03.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_inline_03.ast
index b17c189..9cafc98 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_inline_03.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_inline_03.ast
@@ -28,7 +28,7 @@
     :
     IndexAccessor [
       Variable [ Name=jacc ]
-      Index:       Variable [ Name=jacc ]
+      Index:       LiteralExpr [LONG] [1]
     ]
   )
 ]
@@ -70,7 +70,7 @@
   OperatorExpr [
     IndexAccessor [
       Variable [ Name=jacc ]
-      Index:       Variable [ Name=jacc ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check-after-btree-access.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check-after-btree-access.ast
index 4d96b4c..06e4110 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check-after-btree-access.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check-after-btree-access.ast
@@ -47,7 +47,7 @@
     :
     IndexAccessor [
       Variable [ Name=sim ]
-      Index:       Variable [ Name=sim ]
+      Index:       LiteralExpr [LONG] [1]
     ]
   )
 ]
@@ -85,7 +85,7 @@
   OperatorExpr [
     IndexAccessor [
       Variable [ Name=sim ]
-      Index:       Variable [ Name=sim ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_01.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_01.ast
index 9312f4f..b7d9557 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_01.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_01.ast
@@ -64,21 +64,7 @@
         ]
         LiteralExpr [FLOAT] [0.5]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FunctionCall test.word-tokens@1[
-          FieldAccessor [
-            Variable [ Name=a ]
-            Field=title
-          ]
-        ]
-        FunctionCall test.word-tokens@1[
-          FieldAccessor [
-            Variable [ Name=b ]
-            Field=title
-          ]
-        ]
-        LiteralExpr [FLOAT] [0.5]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_02.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_02.ast
index c522135..1712032 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_02.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_02.ast
@@ -64,21 +64,7 @@
         ]
         LiteralExpr [FLOAT] [0.5]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FunctionCall test.word-tokens@1[
-          FieldAccessor [
-            Variable [ Name=a ]
-            Field=title
-          ]
-        ]
-        FunctionCall test.word-tokens@1[
-          FieldAccessor [
-            Variable [ Name=b ]
-            Field=title
-          ]
-        ]
-        LiteralExpr [FLOAT] [0.5]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_03.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_03.ast
index 3b51a56..90dd0c6 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_03.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_03.ast
@@ -54,21 +54,7 @@
         ]
         LiteralExpr [FLOAT] [0.5]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FunctionCall test.word-tokens@1[
-          FieldAccessor [
-            Variable [ Name=a ]
-            Field=title
-          ]
-        ]
-        FunctionCall test.word-tokens@1[
-          FieldAccessor [
-            Variable [ Name=b ]
-            Field=title
-          ]
-        ]
-        LiteralExpr [FLOAT] [0.5]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_04.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_04.ast
index ea0d477..b01bd36 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_04.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_04.ast
@@ -63,21 +63,7 @@
         ]
         LiteralExpr [FLOAT] [0.5]
       ]
-      Index:       FunctionCall test.similarity-jaccard-check@3[
-        FunctionCall test.word-tokens@1[
-          FieldAccessor [
-            Variable [ Name=a ]
-            Field=title
-          ]
-        ]
-        FunctionCall test.word-tokens@1[
-          FieldAccessor [
-            Variable [ Name=b ]
-            Field=title
-          ]
-        ]
-        LiteralExpr [FLOAT] [0.5]
-      ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_inline_03.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_inline_03.ast
index 8c9a4b7..8f672db 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_inline_03.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_inline_03.ast
@@ -27,7 +27,7 @@
     :
     IndexAccessor [
       Variable [ Name=jacc ]
-      Index:       Variable [ Name=jacc ]
+      Index:       LiteralExpr [LONG] [1]
     ]
   )
 ]
@@ -65,7 +65,7 @@
   OperatorExpr [
     IndexAccessor [
       Variable [ Name=jacc ]
-      Index:       Variable [ Name=jacc ]
+      Index:       LiteralExpr [LONG] [0]
     ]
     and
     OperatorExpr [
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/q2.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/q2.ast
index a7bc644..53ddcd23 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/q2.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/q2.ast
@@ -130,11 +130,11 @@
       ]
       With
       Variable [ Name=e ]
-      Variable [ Name=by_chapter ]
       Variable [ Name=sig_sponsorship_count ]
-      Variable [ Name=es ]
       Variable [ Name=sponsor ]
       Variable [ Name=event ]
+      Variable [ Name=es ]
+      Variable [ Name=sig_name ]
 
   )
 Orderby
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/query-issue785.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/query-issue785.ast
index 5b5cb9a..d8a415a 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/query-issue785.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/query-issue785.ast
@@ -186,7 +186,6 @@
       Variable [ Name=orders ]
       Variable [ Name=n ]
       Variable [ Name=customer ]
-      Variable [ Name=X ]
       Variable [ Name=t ]
 
     LetVariable [ Name=sum ]
diff --git a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/split-materialization-above-join.ast b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/split-materialization-above-join.ast
index 1369a6b..41669f9 100644
--- a/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/split-materialization-above-join.ast
+++ b/asterix-app/src/test/resources/optimizerts/results_parser_sqlpp/split-materialization-above-join.ast
@@ -63,7 +63,7 @@
         :
         IndexAccessor [
           Variable [ Name=sim ]
-          Index:           Variable [ Name=sim ]
+          Index:           LiteralExpr [LONG] [0]
         ]
       )
     ]
@@ -162,14 +162,11 @@
               Variable [ Name=paper ]
               Variable [ Name=token ]
               Variable [ Name=tokenUnranked ]
-              Variable [ Name=tokensLeft ]
               Variable [ Name=lenLeft ]
               Variable [ Name=paperLeft ]
               Variable [ Name=paperRight ]
               Variable [ Name=prefixTokenRight ]
               Variable [ Name=prefixTokenLeft ]
-              Variable [ Name=paperLeft ]
-              Variable [ Name=paperRight ]
 
             Orderby
               FunctionCall fuzzyjoin.count@1[
@@ -248,7 +245,6 @@
               Variable [ Name=paper ]
               Variable [ Name=token ]
               Variable [ Name=tokenUnranked ]
-              Variable [ Name=tokensRight ]
               Variable [ Name=lenRight ]
               Variable [ Name=tokensLeft ]
               Variable [ Name=lenLeft ]
@@ -256,8 +252,6 @@
               Variable [ Name=paperRight ]
               Variable [ Name=prefixTokenRight ]
               Variable [ Name=prefixTokenLeft ]
-              Variable [ Name=paperLeft ]
-              Variable [ Name=paperRight ]
 
             Orderby
               FunctionCall fuzzyjoin.count@1[
@@ -345,8 +339,6 @@
       Variable [ Name=paperRight ]
       Variable [ Name=prefixTokenRight ]
       Variable [ Name=prefixTokenLeft ]
-      Variable [ Name=paperLeft ]
-      Variable [ Name=paperRight ]
 
   )
   AS