config root man

Current Path : /home/usr.opt/mysql57/mysql-test/r/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //home/usr.opt/mysql57/mysql-test/r/explain_for_connection_rqg_json.result

"WL6369 Explain for Connection"
"WL6369 Explain for Connection"
QUERY: SELECT DISTINCT   alias2.col_int AS field1 , alias2.col_int AS field2 FROM  a1 AS alias1 LEFT  JOIN aa1 AS alias2 ON  alias1.pk =  alias2.pk WHERE ( alias1.col_int = 8 OR alias1 .pk <= alias1.col_int ) GROUP BY field1, field2  ORDER BY field1, field2 DESC
STATUS: EQUAL
QUERY: SELECT DISTINCT   alias1.pk AS field1 FROM  f1 AS alias1 LEFT  JOIN a2 AS alias2 ON  alias1.col_varchar_1024_latin1_key =  alias2 .col_varchar_10_utf8_key WHERE alias1.pk  IN (5, 5) GROUP BY field1 HAVING field1 <= 3
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -47,3 +47,4 @@
             "filtered": "100.00",
-            "index_condition": "(`test`.`alias1`.`pk` in (5,5))",
+            "index_condition": true,
+            "using_where": true,
             "cost_info": {
@@ -57,4 +58,3 @@
               "pk"
-            ],
-            "attached_condition": "(`field1` <= 3)"
+            ]
           }
QUERY: SELECT alias1.pk AS field1 FROM  h2 AS alias1 LEFT  JOIN aa3 AS alias2 ON  alias1.pk =  alias2.col_int_key WHERE alias1.pk <> 9 GROUP BY field1 ORDER BY field1 LIMIT 1 OFFSET 3
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -27,2 +27,3 @@
               "filtered": "100.00",
+              "using_where": true,
               "using_index": true,
@@ -36,4 +37,3 @@
                 "pk"
-              ],
-              "attached_condition": "(`test`.`alias1`.`pk` <> 9)"
+              ]
             }
QUERY: SELECT    alias1.pk AS field1 FROM  e1 AS alias1 RIGHT  JOIN cc2 AS alias2 ON  alias1.col_int =  alias2.col_int WHERE alias1.col_int_key  IN (8) 
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -44,4 +44,5 @@
           "rows_examined_per_scan": 2,
-          "rows_produced_per_join": 1,
-          "filtered": "50.00",
+          "rows_produced_per_join": 2,
+          "filtered": "100.00",
+          "using_where": true,
           "using_join_buffer": "Block Nested Loop",
@@ -49,5 +50,5 @@
             "read_cost": "1.00",
-            "eval_cost": "0.20",
+            "eval_cost": "0.40",
             "prefix_cost": "2.60",
-            "data_read_per_join": "8"
+            "data_read_per_join": "16"
           },
@@ -55,4 +56,3 @@
             "col_int"
-          ],
-          "attached_condition": "(`test`.`alias2`.`col_int` = `test`.`alias1`.`col_int`)"
+          ]
         }
QUERY: SELECT DISTINCT alias2.pk AS field1, alias2.pk AS field2, alias2.pk AS field3 FROM t1 AS alias1 RIGHT JOIN t2 AS alias2  ON  alias1.col_varchar_key =  alias2.col_varchar_key WHERE alias1.col_int >alias1.col_int HAVING field3 = 7 ORDER BY field1, field2, field3 LIMIT 10 OFFSET 1
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -27,2 +27,3 @@
               "filtered": "100.00",
+              "using_where": true,
               "cost_info": {
@@ -37,4 +38,3 @@
                 "col_varchar_key"
-              ],
-              "attached_condition": "((`test`.`alias1`.`col_int` > `test`.`alias1`.`col_int`) and (`test`.`alias1`.`col_varchar_key` is not null))"
+              ]
             }
QUERY: SELECT DISTINCT   alias2.col_time_key AS field1 , alias2.col_varchar_key AS field2 , alias2.col_varchar_key AS field3 , alias2.col_int_nokey AS field4 FROM ( c AS alias1 , ( view_a AS alias2 , c AS alias3 ) )   GROUP BY field1, field2, field3, field4 HAVING (field1 < 'w' OR field1 != 'ni') ORDER BY field3 
STATUS: EQUAL
QUERY: SELECT    alias1.col_int_key AS field1 , alias1.col_int_key AS field2 FROM ( ( SELECT   sq1_alias1.* FROM c AS sq1_alias1  ) AS alias1 RIGHT OUTER JOIN ( SELECT   sq2_alias1.* FROM ( bb AS sq2_alias1 STRAIGHT_JOIN c AS sq2_alias2 ON (sq2_alias2.pk = sq2_alias1.pk  ) )  ) AS alias2 ON (alias2.pk = alias1.col_int_key  ) ) WHERE  NOT EXISTS ( (SELECT   sq3_alias1.pk AS sq3_field1 FROM ( bb AS sq3_alias1 LEFT OUTER JOIN ( cc AS sq3_alias2 STRAIGHT_JOIN bb AS sq3_alias3 ON (sq3_alias3.pk = sq3_alias2.pk  ) ) ON (sq3_alias3.col_int_key = sq3_alias2.col_int_key  AND sq3_alias1.col_int_key > (SELECT   COUNT( DISTINCT c_sq1_alias1.col_int_nokey ) AS c_sq1_field1 FROM d AS c_sq1_alias1 WHERE c_sq1_alias1.col_int_nokey != c_sq1_alias1.pk ) ) )    ) )  GROUP BY field1, field2  ORDER BY alias1.col_date_key DESC , field1, field2 
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -56,2 +56,3 @@
                 "filtered": "100.00",
+                "using_where": true,
                 "using_index": true,
@@ -67,3 +68,2 @@
                 ],
-                "attached_condition": "<if>(is_not_null_compl(sq3_alias2..sq3_alias3), (`test`.`sq3_alias1`.`col_int_key` > (/* select#5 */ select count(distinct `test`.`c_sq1_alias1`.`col_int_nokey`) AS `c_sq1_field1` from `test`.`d` `c_sq1_alias1` where (`test`.`c_sq1_alias1`.`col_int_nokey` <> `test`.`c_sq1_alias1`.`pk`))), true)",
                 "attached_subqueries": [
@@ -83,2 +83,3 @@
                         "filtered": "90.00",
+                        "using_where": true,
                         "cost_info": {
@@ -92,4 +93,3 @@
                           "col_int_nokey"
-                        ],
-                        "attached_condition": "(`test`.`c_sq1_alias1`.`col_int_nokey` <> `test`.`c_sq1_alias1`.`pk`)"
+                        ]
                       }
@@ -119,2 +119,3 @@
                 "filtered": "100.00",
+                "using_where": true,
                 "cost_info": {
@@ -128,4 +129,3 @@
                   "col_int_key"
-                ],
-                "attached_condition": "<if>(is_not_null_compl(sq3_alias2..sq3_alias3), (`test`.`sq3_alias3`.`col_int_key` = `test`.`sq3_alias2`.`col_int_key`), true)"
+                ]
               }
QUERY: SELECT DISTINCT  SQL_SMALL_RESULT table2.col_date_key AS field1 FROM ( cc AS table1 INNER JOIN ( ( c AS table2 INNER JOIN bb AS table3 ON (table3.col_varchar_key = table2.col_varchar_key  ) ) ) ON (table3.col_varchar_key = table2.col_varchar_key  ) ) WHERE (   EXISTS ( (SELECT  SQL_SMALL_RESULT subquery1_t2.col_varchar_nokey AS subquery1_field1 FROM ( bb AS subquery1_t1 INNER JOIN cc AS subquery1_t2 ON (subquery1_t2.col_varchar_key = subquery1_t1.col_varchar_nokey  ) )   ) ) ) OR ( table1.col_varchar_key = 'q' AND table1.col_int_key = table2.col_int_key ) OR (  table2.col_varchar_key  IN (SELECT 'a' FROM dummy UNION SELECT 'p' FROM dummy ) OR table1.col_varchar_key IS  NULL ) 
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -27,2 +27,3 @@
             "filtered": "100.00",
+            "using_where": true,
             "using_index": true,
@@ -37,4 +38,3 @@
               "col_varchar_key"
-            ],
-            "attached_condition": "(`test`.`table3`.`col_varchar_key` is not null)"
+            ]
           }
@@ -127,2 +127,3 @@
                       "filtered": "100.00",
+                      "using_where": true,
                       "cost_info": {
@@ -132,4 +133,3 @@
                         "data_read_per_join": "8"
-                      },
-                      "attached_condition": "(<cache>(`test`.`table2`.`col_varchar_key`) = 'a')"
+                      }
                     }
@@ -151,2 +151,3 @@
                       "filtered": "100.00",
+                      "using_where": true,
                       "cost_info": {
@@ -156,4 +157,3 @@
                         "data_read_per_join": "8"
-                      },
-                      "attached_condition": "(<cache>(`test`.`table2`.`col_varchar_key`) = 'p')"
+                      }
                     }
@@ -181,2 +181,3 @@
                   "filtered": "100.00",
+                  "using_where": true,
                   "cost_info": {
@@ -189,4 +190,3 @@
                     "col_varchar_nokey"
-                  ],
-                  "attached_condition": "(`test`.`subquery1_t1`.`col_varchar_nokey` is not null)"
+                  ]
                 }
QUERY: SELECT    table2.col_time_key AS field1 FROM ( ( SELECT   subquery1_t1.* FROM ( c AS subquery1_t1 STRAIGHT_JOIN c AS subquery1_t2 ON (subquery1_t2.col_int_key = subquery1_t1.col_int_key  ) ) WHERE subquery1_t1.pk <= 7 ) AS table1 LEFT OUTER JOIN ( ( ( SELECT   subquery2_t1.* FROM b AS subquery2_t1 WHERE subquery2_t1.col_varchar_nokey <= 'l' ) AS table2 LEFT OUTER JOIN c AS table3 ON (table3.col_varchar_key = table2.col_varchar_key  ) ) ) ON (table3.pk = table2.pk  ) ) WHERE (   EXISTS ( (SELECT   subquery3_t1.col_varchar_nokey AS subquery3_field1 FROM ( bb AS subquery3_t1 LEFT  JOIN c AS subquery3_t2 ON (subquery3_t2.col_varchar_key = subquery3_t1.col_varchar_key  ) )   ) ) ) OR table1.col_int_key = 62 AND ( table1.col_int_key = table1.pk AND table2.col_varchar_nokey = table1.col_varchar_nokey ) ORDER BY table1.col_varchar_key DESC /*+JavaDB:Postgres: NULLS LAST */ , CONCAT( table3.col_varchar_key, table1.col_varchar_nokey ) /*+JavaDB:Postgres: NULLS FIRST*/ , table1.col_date_key /*+JavaDB:Postgres: NULLS FIRST*/ , table3 .pk DESC /*+JavaDB:Postgres: NULLS LAST */
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -27,2 +27,3 @@
             "filtered": "100.00",
+            "using_where": true,
             "cost_info": {
@@ -39,4 +40,3 @@
               "col_varchar_nokey"
-            ],
-            "attached_condition": "((`test`.`subquery1_t1`.`pk` <= 7) and (`test`.`subquery1_t1`.`col_int_key` is not null))"
+            ]
           }
@@ -85,2 +85,3 @@
             "filtered": "100.00",
+            "using_where": true,
             "cost_info": {
@@ -96,4 +97,3 @@
               "col_varchar_nokey"
-            ],
-            "attached_condition": "<if>(is_not_null_compl(subquery2_t1..table3), (`test`.`subquery2_t1`.`col_varchar_nokey` <= 'l'), true)"
+            ]
           }
@@ -119,2 +119,3 @@
             "filtered": "100.00",
+            "using_where": true,
             "cost_info": {
@@ -128,4 +129,3 @@
               "col_varchar_key"
-            ],
-            "attached_condition": "<if>(is_not_null_compl(subquery2_t1..table3), (`test`.`table3`.`col_varchar_key` = `test`.`subquery2_t1`.`col_varchar_key`), true)"
+            ]
           }
QUERY: SELECT    alias1.col_datetime_key AS field1 FROM ( view_cc AS alias1 , bb AS alias2 , cc AS alias3 ) WHERE  alias2.pk < ALL (SELECT   sq1_alias2.pk AS sq1_field1 FROM ( c AS sq1_alias1 , cc AS sq1_alias2 ) WHERE  sq1_alias1.col_varchar_nokey != (SELECT   COUNT(  c_sq1_alias1.col_varchar_key ) AS c_sq1_field1 FROM ( cc AS c_sq1_alias1 RIGHT OUTER JOIN ( ( cc AS c_sq1_alias2 INNER JOIN b AS c_sq1_alias3 ON (c_sq1_alias3.col_varchar_nokey = c_sq1_alias2.col_varchar_key ) ) ) ON (c_sq1_alias3.pk = c_sq1_alias2.pk ) ) WHERE c_sq1_alias1.col_varchar_key < 'm' )   )  GROUP BY field1 HAVING ((field1 <= 'USA' OR field1 < 2) AND field1 <> 'd') ORDER BY alias1.col_time_key DESC , field1 LIMIT 10 OFFSET 208
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -25,2 +25,3 @@
               "filtered": "100.00",
+              "using_where": true,
               "using_index": true,
@@ -35,3 +36,2 @@
               ],
-              "attached_condition": "<not>((`test`.`alias2`.`pk` >= (/* select#2 */ select min(`test`.`sq1_alias2`.`pk`) from `test`.`c` `sq1_alias1` join `test`.`cc` `sq1_alias2` where (`test`.`sq1_alias1`.`col_varchar_nokey` <> (/* select#3 */ select count(`test`.`c_sq1_alias1`.`col_varchar_key`) AS `c_sq1_field1` from `test`.`cc` `c_sq1_alias2` join `test`.`b` `c_sq1_alias3` join `test`.`cc` `c_sq1_alias1` where ((`test`.`c_sq1_alias2`.`col_varchar_key` = `test`.`c_sq1_alias3`.`col_varchar_nokey`) and (`test`.`c_sq1_alias2`.`pk` = `test`.`c_sq1_alias3`.`pk`) and (`test`.`c_sq1_alias1`.`col_varchar_key` < 'm')))))))",
               "attached_subqueries": [
@@ -53,2 +53,3 @@
                           "filtered": "90.00",
+                          "using_where": true,
                           "cost_info": {
@@ -62,3 +63,2 @@
                           ],
-                          "attached_condition": "(`test`.`sq1_alias1`.`col_varchar_nokey` <> (/* select#3 */ select count(`test`.`c_sq1_alias1`.`col_varchar_key`) AS `c_sq1_field1` from `test`.`cc` `c_sq1_alias2` join `test`.`b` `c_sq1_alias3` join `test`.`cc` `c_sq1_alias1` where ((`test`.`c_sq1_alias2`.`col_varchar_key` = `test`.`c_sq1_alias3`.`col_varchar_nokey`) and (`test`.`c_sq1_alias2`.`pk` = `test`.`c_sq1_alias3`.`pk`) and (`test`.`c_sq1_alias1`.`col_varchar_key` < 'm'))))",
                           "attached_subqueries": [
@@ -114,2 +114,3 @@
                                       "filtered": "6.67",
+                                      "using_where": true,
                                       "cost_info": {
@@ -123,4 +124,3 @@
                                         "col_varchar_key"
-                                      ],
-                                      "attached_condition": "(`test`.`c_sq1_alias2`.`col_varchar_key` = `test`.`c_sq1_alias3`.`col_varchar_nokey`)"
+                                      ]
                                     }
@@ -142,2 +142,3 @@
                                       "filtered": "100.00",
+                                      "using_where": true,
                                       "using_index": true,
@@ -152,4 +153,3 @@
                                         "col_varchar_key"
-                                      ],
-                                      "attached_condition": "(`test`.`c_sq1_alias1`.`col_varchar_key` < 'm')"
+                                      ]
                                     }
QUERY: SELECT DISTINCT   SUM( DISTINCT alias1.col_int_nokey ) AS field1 , MAX( DISTINCT alias2.col_varchar_key ) AS field2 FROM ( c AS alias1 , c AS alias2 , cc AS alias3 ) WHERE  alias2.col_int_key > (SELECT   COUNT(  sq1_alias1.col_int_key ) AS sq1_field1 FROM ( cc AS sq1_alias1 INNER JOIN view_c AS sq1_alias2 ON (sq1_alias2.col_varchar_key = sq1_alias1.col_varchar_nokey  ) ) WHERE sq1_alias2.col_varchar_nokey < sq1_alias1.col_varchar_key )  HAVING (field1 > 'zc' AND field2 >= 'q') ORDER BY alias1.col_time_key ASC , field1, field2 LIMIT 2 /*  */
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -24,2 +24,3 @@
           "filtered": "90.00",
+          "using_where": true,
           "using_index": true,
@@ -35,3 +36,2 @@
           ],
-          "attached_condition": "(`test`.`alias2`.`col_int_key` > (/* select#2 */ select count(`test`.`sq1_alias1`.`col_int_key`) AS `sq1_field1` from `test`.`cc` `sq1_alias1` join `test`.`c` where ((`test`.`c`.`col_varchar_key` = `test`.`sq1_alias1`.`col_varchar_nokey`) and (`test`.`c`.`col_varchar_nokey` < `test`.`sq1_alias1`.`col_varchar_key`))))",
           "attached_subqueries": [
@@ -56,2 +56,3 @@
                       "filtered": "100.00",
+                      "using_where": true,
                       "cost_info": {
@@ -66,4 +67,3 @@
                         "col_varchar_nokey"
-                      ],
-                      "attached_condition": "(`test`.`sq1_alias1`.`col_varchar_nokey` is not null)"
+                      ]
                     }
@@ -88,2 +88,3 @@
                       "filtered": "33.33",
+                      "using_where": true,
                       "cost_info": {
@@ -97,4 +98,3 @@
                         "col_varchar_nokey"
-                      ],
-                      "attached_condition": "(`test`.`c`.`col_varchar_nokey` < `test`.`sq1_alias1`.`col_varchar_key`)"
+                      ]
                     }
QUERY: SELECT    alias2.col_datetime_key AS field1 , alias1.col_varchar_key AS field2 , alias1.col_varchar_nokey AS field3 , alias2.col_varchar_key AS field4 , alias2.pk AS field5 , alias2.col_date_key AS field6 , alias1.col_date_key AS field7 , alias1.col_int_key AS field8 FROM ( cc AS alias1 LEFT  JOIN ( ( ( SELECT   sq1_alias1.* FROM c AS sq1_alias1  ) AS alias2 INNER JOIN ( SELECT   sq2_alias1.* FROM ( b AS sq2_alias1 , view_aa AS sq2_alias2 )  ) AS alias3 ON (alias3.col_varchar_nokey = alias2.col_varchar_key  ) ) ) ON (alias3.col_int_key = alias2.col_int_key  ) ) WHERE (   EXISTS ( (SELECT   sq3_alias1.col_varchar_nokey AS sq3_field1 FROM ( c AS sq3_alias1 , bb AS sq3_alias2 )   ) ) ) OR ( alias1.col_int_key NOT IN (55, 229) OR alias1.col_int_key > 28 AND alias1.col_int_key < ( 28 + 73 ) ) AND alias1.col_int_key != alias2.pk  HAVING field8 = 'v' ORDER BY field3 , field1, field2, field3, field4, field5, field6, field7, field8 
STATUS: EQUAL
QUERY: SELECT    alias1.col_datetime_key AS field1 , alias2.col_date_key AS field2 FROM ( c AS alias1 LEFT OUTER JOIN ( ( ( SELECT DISTINCT  sq1_alias1.* FROM bb AS sq1_alias1  ) AS alias2 INNER JOIN c AS alias3 ON (alias3.col_int_key = alias2.col_int_key  ) ) ) ON (alias3.pk = alias2.col_int_key  ) ) WHERE (   EXISTS ( (SELECT 9 FROM DUAL ) ) ) OR alias1.col_varchar_key LIKE CONCAT( 'b' , '%')  GROUP BY field1, field2 HAVING field2 != 6 
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -118,2 +118,3 @@
             "filtered": "100.00",
+            "using_where": true,
             "cost_info": {
@@ -127,4 +128,3 @@
               "col_int_key"
-            ],
-            "attached_condition": "<if>(is_not_null_compl(alias2..alias3), (`test`.`alias3`.`col_int_key` = `alias2`.`col_int_key`), true)"
+            ]
           }
QUERY: SELECT  STRAIGHT_JOIN  table1.pk AS field1 , table2.col_int_key AS field2 , table1.col_int_nokey AS field3 , table2.col_varchar_key AS field4 FROM ( ( SELECT   subquery1_t1.* FROM cc AS subquery1_t1 WHERE ( subquery1_t1.col_int_nokey = subquery1_t1.col_int_nokey AND   EXISTS ( (SELECT   child_subquery1_t2.pk AS child_subquery1_field1 FROM ( c AS child_subquery1_t1 RIGHT  JOIN c AS child_subquery1_t2 ON (child_subquery1_t2.col_int_key = child_subquery1_t1.col_int_key ) ) WHERE child_subquery1_t2.col_int_key != 7   ) ) ) ) AS table1 INNER JOIN cc AS table2 ON (table2.col_varchar_nokey = table1.col_varchar_key  ) ) WHERE (  table1.col_varchar_nokey >= ALL (SELECT  SQL_SMALL_RESULT subquery2_t1.col_varchar_key AS subquery2_field1 FROM ( c AS subquery2_t1 INNER JOIN cc AS subquery2_t2 ON (subquery2_t2.pk = subquery2_t1.col_int_nokey  ) )   ) ) OR table1.pk = 98 AND table2.col_varchar_key != 'q' ORDER BY CONCAT( table1.col_varchar_nokey, table1.col_varchar_nokey ) /*+JavaDB:Postgres: NULLS FIRST*/
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -5,3 +5,3 @@
     "cost_info": {
-      "query_cost": "14.20"
+      "query_cost": "38.80"
     },
@@ -22,2 +22,3 @@
             "filtered": "6.83",
+            "using_where": true,
             "cost_info": {
@@ -34,3 +35,2 @@
             ],
-            "attached_condition": "((<not>((`test`.`subquery1_t1`.`col_varchar_nokey` < <max>(/* select#4 */ select sql_small_result `test`.`subquery2_t1`.`col_varchar_key` AS `subquery2_field1` from `test`.`c` `subquery2_t1` join `test`.`cc` `subquery2_t2` where (`test`.`subquery2_t2`.`pk` = `test`.`subquery2_t1`.`col_int_nokey`)))) or (`test`.`subquery1_t1`.`pk` = 98)) and (`test`.`subquery1_t1`.`col_int_nokey` = `test`.`subquery1_t1`.`col_int_nokey`))",
             "attached_subqueries": [
@@ -52,2 +52,3 @@
                         "filtered": "100.00",
+                        "using_where": true,
                         "cost_info": {
@@ -61,4 +62,3 @@
                           "col_varchar_key"
-                        ],
-                        "attached_condition": "(`test`.`subquery2_t1`.`col_int_nokey` is not null)"
+                        ]
                       }
@@ -109,4 +109,5 @@
             "rows_examined_per_scan": 20,
-            "rows_produced_per_join": 2,
-            "filtered": "10.00",
+            "rows_produced_per_join": 27,
+            "filtered": "100.00",
+            "using_where": true,
             "using_join_buffer": "Block Nested Loop",
@@ -114,5 +115,5 @@
               "read_cost": "1.00",
-              "eval_cost": "0.55",
+              "eval_cost": "5.47",
               "prefix_cost": "11.47",
-              "data_read_per_join": "131"
+              "data_read_per_join": "1K"
             },
@@ -124,3 +125,2 @@
             ],
-            "attached_condition": "((`test`.`table2`.`col_varchar_nokey` = `test`.`subquery1_t1`.`col_varchar_key`) and (<not>((`test`.`subquery1_t1`.`col_varchar_nokey` < <max>(/* select#4 */ select sql_small_result `test`.`subquery2_t1`.`col_varchar_key` AS `subquery2_field1` from `test`.`c` `subquery2_t1` join `test`.`cc` `subquery2_t2` where (`test`.`subquery2_t2`.`pk` = `test`.`subquery2_t1`.`col_int_nokey`)))) or ((`test`.`subquery1_t1`.`pk` = 98) and (`test`.`table2`.`col_varchar_key` <> 'q'))))",
             "attached_subqueries": [
@@ -142,2 +142,3 @@
                         "filtered": "100.00",
+                        "using_where": true,
                         "cost_info": {
@@ -151,4 +152,3 @@
                           "col_varchar_key"
-                        ],
-                        "attached_condition": "(`test`.`subquery2_t1`.`col_int_nokey` is not null)"
+                        ]
                       }
@@ -217,2 +217,3 @@
                   "filtered": "100.00",
+                  "using_where": true,
                   "using_index": true,
@@ -227,4 +228,3 @@
                     "col_int_key"
-                  ],
-                  "attached_condition": "(`test`.`child_subquery1_t2`.`col_int_key` <> 7)"
+                  ]
                 }
QUERY: SELECT    alias1.col_int_key AS field1 , alias2.col_datetime_key AS field2 , alias1.col_varchar_nokey AS field3 , alias1.col_int_nokey AS field4 , alias1.col_int_key AS field5 FROM ( b AS alias1 , view_d AS alias2 ) WHERE  alias1.col_varchar_nokey >= ANY (SELECT  SQL_SMALL_RESULT sq1_alias1.col_varchar_key AS sq1_field1 FROM ( c AS sq1_alias1 INNER JOIN c AS sq1_alias2 ON (sq1_alias2.col_int_key = sq1_alias1.pk  ) )   )  GROUP BY field1, field2, field3, field4, field5  ORDER BY alias1.col_date_key ASC , field1, field2, field3, field4, field5 
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -20,2 +20,3 @@
               "filtered": "100.00",
+              "using_where": true,
               "cost_info": {
@@ -33,3 +34,2 @@
               ],
-              "attached_condition": "<nop>((`test`.`alias1`.`col_varchar_nokey` >= (/* select#2 */ select sql_small_result min(`test`.`sq1_alias1`.`col_varchar_key`) from `test`.`c` `sq1_alias1` join `test`.`c` `sq1_alias2` where (`test`.`sq1_alias1`.`pk` = `test`.`sq1_alias2`.`col_int_key`))))",
               "attached_subqueries": [
@@ -59,2 +59,3 @@
                           "filtered": "100.00",
+                          "using_where": true,
                           "using_index": true,
@@ -68,4 +69,3 @@
                             "col_int_key"
-                          ],
-                          "attached_condition": "(`test`.`sq1_alias2`.`col_int_key` is not null)"
+                          ]
                         }
QUERY: SELECT    CONCAT ( alias1.col_varchar_key , alias1.col_varchar_nokey ) AS field1 FROM ( cc AS alias1 , c AS alias2 , cc AS alias3 ) WHERE (   EXISTS ( (SELECT   sq1_alias1.col_varchar_nokey AS sq1_field1 FROM ( c AS sq1_alias1 , cc AS sq1_alias2 )   ) ) ) AND alias1.col_varchar_key <= 'p' AND alias3.col_varchar_key > alias2.col_varchar_nokey  GROUP BY field1   /*  */
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -5,3 +5,3 @@
     "cost_info": {
-      "query_cost": "2397.53"
+      "query_cost": "5331.01"
     },
@@ -11,3 +11,3 @@
       "cost_info": {
-        "sort_cost": "1466.52"
+        "sort_cost": "4400.00"
       },
@@ -24,2 +24,3 @@
             "filtered": "55.00",
+            "using_where": true,
             "cost_info": {
@@ -34,4 +35,3 @@
               "col_varchar_nokey"
-            ],
-            "attached_condition": "(`test`.`alias1`.`col_varchar_key` <= 'p')"
+            ]
           }
@@ -61,3 +61,3 @@
             "table_name": "alias3",
-            "access_type": "ALL",
+            "access_type": "range",
             "possible_keys": [
@@ -65,11 +65,17 @@
             ],
+            "key": "col_varchar_key",
+            "used_key_parts": [
+              "col_varchar_key"
+            ],
+            "key_length": "4",
             "rows_examined_per_scan": 20,
-            "rows_produced_per_join": 1466,
-            "filtered": "33.33",
+            "rows_produced_per_join": 4400,
+            "filtered": "100.00",
             "range_checked_for_each_record": "index map: 0x20",
+            "using_index": true,
             "cost_info": {
               "read_cost": "1.01",
-              "eval_cost": "293.30",
+              "eval_cost": "880.00",
               "prefix_cost": "931.01",
-              "data_read_per_join": "68K"
+              "data_read_per_join": "206K"
             },
QUERY: SELECT    alias1.col_int_key AS field1 , alias1.col_date_key AS field2 , alias1.col_varchar_key AS field3 FROM ( c AS alias1 , d AS alias2 , cc AS alias3 ) WHERE (   EXISTS ( (SELECT   sq1_alias1.col_varchar_key AS sq1_field1 FROM ( d AS sq1_alias1 LEFT  JOIN d AS sq1_alias2 ON (sq1_alias2.col_varchar_key = sq1_alias1.col_varchar_key  ) )   ) ) ) AND alias1.col_int_key = alias1.col_int_key AND alias1.col_int_key < alias3.col_int_key  GROUP BY field1, field2, field3 HAVING field2 >= 'a' 
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -24,2 +24,3 @@
             "filtered": "10.00",
+            "using_where": true,
             "cost_info": {
@@ -35,4 +36,3 @@
               "col_varchar_key"
-            ],
-            "attached_condition": "(`test`.`alias1`.`col_int_key` = `test`.`alias1`.`col_int_key`)"
+            ]
           }
@@ -42,3 +42,3 @@
             "table_name": "alias3",
-            "access_type": "ALL",
+            "access_type": "range",
             "possible_keys": [
@@ -46,6 +46,12 @@
             ],
+            "key": "col_int_key",
+            "used_key_parts": [
+              "col_int_key"
+            ],
+            "key_length": "5",
             "rows_examined_per_scan": 20,
             "rows_produced_per_join": 13,
-            "filtered": "33.33",
+            "filtered": "100.00",
             "range_checked_for_each_record": "index map: 0x2",
+            "using_index": true,
             "cost_info": {
QUERY: SELECT    alias1.col_datetime_key AS field1 , alias2.col_int_key AS field2 FROM ( c AS alias1 , d AS alias2 , cc AS alias3 ) WHERE (   EXISTS ( (SELECT   sq1_alias1.col_int_key AS sq1_field1 FROM bb AS sq1_alias1 WHERE sq1_alias1.pk < 8   ) ) ) OR alias1.col_int_key > alias3.col_int_key   ORDER BY alias1.col_int_key ASC , field1, field2 LIMIT 2 /*  */
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -37,3 +37,3 @@
             "table_name": "alias3",
-            "access_type": "ALL",
+            "access_type": "range",
             "possible_keys": [
@@ -41,6 +41,12 @@
             ],
+            "key": "col_int_key",
+            "used_key_parts": [
+              "col_int_key"
+            ],
+            "key_length": "5",
             "rows_examined_per_scan": 20,
             "rows_produced_per_join": 133,
-            "filtered": "33.33",
+            "filtered": "100.00",
             "range_checked_for_each_record": "index map: 0x2",
+            "using_index": true,
             "cost_info": {
@@ -107,2 +113,3 @@
               "filtered": "100.00",
+              "using_where": true,
               "using_index": true,
@@ -117,4 +124,3 @@
                 "col_int_key"
-              ],
-              "attached_condition": "(`test`.`sq1_alias1`.`pk` < 8)"
+              ]
             }
QUERY: SELECT    alias1.col_int_key AS field1 , alias1.col_int_key AS field2 FROM ( ( SELECT   sq1_alias1.* FROM d AS sq1_alias1  ) AS alias1 , d AS alias2 ) WHERE (  (SELECT   MIN(  sq2_alias1.pk ) AS sq2_field1 FROM ( view_c AS sq2_alias1 RIGHT  JOIN c AS sq2_alias2 ON (sq2_alias2.col_varchar_nokey = sq2_alias1.col_varchar_key  ) )  ) IS NOT NULL ) AND ( alias2.col_varchar_key <= 'z' OR   EXISTS ( (SELECT   sq3_alias1.col_int_nokey AS sq3_field1 FROM a AS sq3_alias1    ) ) )  GROUP BY field1, field2 HAVING field2 < 4 ORDER BY alias1.col_int_key ASC , field1, field2 
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -31,2 +31,3 @@
               "filtered": "100.00",
+              "using_where": true,
               "using_index": true,
@@ -41,4 +42,3 @@
                 "col_varchar_key"
-              ],
-              "attached_condition": "(`test`.`alias2`.`col_varchar_key` <= 'z')"
+              ]
             }
QUERY: SELECT  STRAIGHT_JOIN  alias1.col_int_key AS field1 FROM ( b AS alias1 , ( SELECT   sq1_alias1.* FROM ( cc AS sq1_alias1 INNER JOIN ( c AS sq1_alias2 INNER JOIN c AS sq1_alias3 ON (sq1_alias3.pk = sq1_alias2.pk  ) ) ON (sq1_alias3.col_varchar_key = sq1_alias2.col_varchar_key  ) ) WHERE  sq1_alias2.col_int_key >= ANY (SELECT   c_sq1_alias1.col_int_key AS c_sq1_field1 FROM c AS c_sq1_alias1  GROUP BY c_sq1_field1  ) ) AS alias2 ) WHERE   EXISTS ( (SELECT   sq2_alias1.col_varchar_key AS sq2_field1 FROM c AS sq2_alias1 WHERE sq2_alias1.col_varchar_nokey < 'p' GROUP BY sq2_field1 ) )  GROUP BY field1 HAVING field1 <> 'o' ORDER BY field1  , alias1.col_time_key , alias2 .pk DESC, field1 
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -5,3 +5,3 @@
     "cost_info": {
-      "query_cost": "147.59"
+      "query_cost": "395.22"
     },
@@ -79,2 +79,3 @@
               "filtered": "66.67",
+              "using_where": true,
               "using_index": true,
@@ -92,3 +93,2 @@
               ],
-              "attached_condition": "<nop>((`test`.`sq1_alias2`.`col_int_key` >= (/* select#3 */ select min(`test`.`c_sq1_alias1`.`col_int_key`) from `test`.`c` `c_sq1_alias1`)))",
               "attached_subqueries": [
@@ -122,9 +122,10 @@
               "rows_examined_per_scan": 1,
-              "rows_produced_per_join": 19,
-              "filtered": "7.14",
+              "rows_produced_per_join": 266,
+              "filtered": "100.00",
+              "using_where": true,
               "cost_info": {
                 "read_cost": "13.33",
-                "eval_cost": "3.81",
+                "eval_cost": "53.34",
                 "prefix_cost": "128.54",
-                "data_read_per_join": "914"
+                "data_read_per_join": "12K"
               },
@@ -133,4 +134,3 @@
                 "col_varchar_key"
-              ],
-              "attached_condition": "(`test`.`sq1_alias3`.`col_varchar_key` = `test`.`sq1_alias2`.`col_varchar_key`)"
+              ]
             }
@@ -153,2 +153,3 @@
                 "filtered": "33.33",
+                "using_where": true,
                 "cost_info": {
@@ -162,4 +163,3 @@
                   "col_varchar_nokey"
-                ],
-                "attached_condition": "(`test`.`sq2_alias1`.`col_varchar_nokey` < 'p')"
+                ]
               }
QUERY: SELECT    CONCAT( table1.col_varchar_nokey , table1.col_varchar_nokey ) AS field1 FROM ( ( SELECT   subquery1_t1.* FROM bb AS subquery1_t1 WHERE ( subquery1_t1.col_varchar_key != 'y' OR subquery1_t1.col_varchar_key <= 'd' ) ) AS table1 RIGHT OUTER JOIN ( ( c AS table2 STRAIGHT_JOIN bb AS table3 ON (table3.pk = table2.pk  OR table2.col_varchar_key  IN (SELECT   subquery2_t2.col_varchar_key AS subquery2_field1 FROM ( c AS subquery2_t1 RIGHT OUTER JOIN c AS subquery2_t2 ON (subquery2_t2.col_int_nokey = subquery2_t1.col_int_key  ) ) WHERE  subquery2_t1.col_int_key >= (SELECT   SUM(  child_subquery1_t1.col_int_key ) AS child_subquery1_field1 FROM cc AS child_subquery1_t1 WHERE ( child_subquery1_t1.pk > child_subquery1_t1.pk OR child_subquery1_t1.col_int_nokey > 6 ) )  ) ) ) ) ON (table3.col_varchar_nokey = table2.col_varchar_key  ) ) WHERE (   EXISTS ( (SELECT   subquery3_t1.pk AS subquery3_field1 FROM ( bb AS subquery3_t1 INNER JOIN ( cc AS subquery3_t2 INNER JOIN c AS subquery3_t3 ON (subquery3_t3.col_varchar_key = subquery3_t2.col_varchar_key  ) ) ON (subquery3_t3.pk = subquery3_t2.col_int_nokey  ) )    ) ) ) AND ( table1.col_varchar_key < 'b' OR table1.col_int_key  BETWEEN 253 AND ( 253 + 77 ) ) OR ( table2.col_varchar_nokey != 't' OR table2.col_varchar_nokey = table1.col_varchar_nokey ) 
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -41,2 +41,3 @@
           "filtered": "100.00",
+          "using_where": true,
           "using_join_buffer": "Block Nested Loop",
@@ -52,3 +53,2 @@
           ],
-          "attached_condition": "((`test`.`table3`.`pk` = `test`.`table2`.`pk`) or <in_optimizer>(`test`.`table2`.`col_varchar_key`,`test`.`table2`.`col_varchar_key` in ( <materialize> (/* select#3 */ select `test`.`subquery2_t2`.`col_varchar_key` AS `subquery2_field1` from `test`.`c` `subquery2_t2` join `test`.`c` `subquery2_t1` where ((`test`.`subquery2_t2`.`col_int_nokey` = `test`.`subquery2_t1`.`col_int_key`) and (`test`.`subquery2_t1`.`col_int_key` >= (/* select#4 */ select sum(`test`.`child_subquery1_t1`.`col_int_key`) AS `child_subquery1_field1` from `test`.`cc` `child_subquery1_t1` where (`test`.`child_subquery1_t1`.`col_int_nokey` > 6)))) ), <primary_index_lookup>(`test`.`table2`.`col_varchar_key` in <temporary table> on <auto_key> where ((`test`.`table2`.`col_varchar_key` = `materialized-subquery`.`subquery2_field1`))))))",
           "attached_subqueries": [
@@ -86,2 +86,3 @@
                           "filtered": "100.00",
+                          "using_where": true,
                           "using_index": true,
@@ -96,3 +97,2 @@
                           ],
-                          "attached_condition": "(`test`.`subquery2_t1`.`col_int_key` >= (/* select#4 */ select sum(`test`.`child_subquery1_t1`.`col_int_key`) AS `child_subquery1_field1` from `test`.`cc` `child_subquery1_t1` where (`test`.`child_subquery1_t1`.`col_int_nokey` > 6)))",
                           "attached_subqueries": [
@@ -112,2 +112,3 @@
                                   "filtered": "33.33",
+                                  "using_where": true,
                                   "cost_info": {
@@ -122,4 +123,3 @@
                                     "col_int_key"
-                                  ],
-                                  "attached_condition": "(`test`.`child_subquery1_t1`.`col_int_nokey` > 6)"
+                                  ]
                                 }
@@ -140,2 +140,3 @@
                           "filtered": "10.00",
+                          "using_where": true,
                           "using_join_buffer": "Block Nested Loop",
@@ -150,4 +151,3 @@
                             "col_varchar_key"
-                          ],
-                          "attached_condition": "(`test`.`subquery2_t2`.`col_int_nokey` = `test`.`subquery2_t1`.`col_int_key`)"
+                          ]
                         }
@@ -172,2 +172,3 @@
           "filtered": "100.00",
+          "using_where": true,
           "using_join_buffer": "Block Nested Loop",
@@ -183,4 +184,3 @@
             "col_varchar_nokey"
-          ],
-          "attached_condition": "(<if>(found_match(subquery1_t1), ((`test`.`table2`.`col_varchar_nokey` <> 't') or (`test`.`subquery1_t1`.`col_varchar_nokey` = `test`.`table2`.`col_varchar_nokey`)), true) and <if>(is_not_null_compl(subquery1_t1), ((`test`.`table3`.`col_varchar_nokey` = `test`.`table2`.`col_varchar_key`) and ((`test`.`subquery1_t1`.`col_varchar_key` <> 'y') or (`test`.`subquery1_t1`.`col_varchar_key` <= 'd'))), true))"
+          ]
         }
@@ -232,2 +232,3 @@
                 "filtered": "100.00",
+                "using_where": true,
                 "using_join_buffer": "Block Nested Loop",
@@ -242,4 +243,3 @@
                   "col_varchar_key"
-                ],
-                "attached_condition": "(`test`.`subquery3_t2`.`col_int_nokey` is not null)"
+                ]
               }
@@ -265,2 +265,3 @@
                 "filtered": "7.14",
+                "using_where": true,
                 "cost_info": {
@@ -274,4 +275,3 @@
                   "col_varchar_key"
-                ],
-                "attached_condition": "(`test`.`subquery3_t3`.`col_varchar_key` = `test`.`subquery3_t2`.`col_varchar_key`)"
+                ]
               }
QUERY: SELECT DISTINCT col_int_nokey AS field1 , col_int_nokey AS field2 FROM a AS alias1 WHERE ( ( alias1.pk > 54 AND alias1.pk < ( 54 + 151 ) OR ( alias1.col_int_key  IN (240) OR ( alias1.pk > 54 AND alias1.pk < ( 54 + 16 ) OR ( alias1.col_int_key  BETWEEN 54 AND ( 54 + 125 ) OR alias1.pk > 54 AND alias1.pk < ( 54 + 147 ) ) ) ) ) OR alias1 .pk >= alias1.pk )  GROUP BY field1, field2
STATUS: EQUAL
QUERY: SELECT    MAX(  alias2.pk ) AS field1 , SUM( DISTINCT alias1.col_varchar_key ) AS field2 ,  (SELECT   MAX( DISTINCT sq1_alias1.col_varchar_nokey ) AS sq1_field1 FROM a AS sq1_alias1  ) AS field3 FROM ( c AS alias1 , ( SELECT   sq2_alias2.* FROM ( d AS sq2_alias1 LEFT OUTER JOIN c AS sq2_alias2 ON (sq2_alias2.col_int_key = sq2_alias1.col_int_nokey  ) ) WHERE ( sq2_alias1.col_varchar_nokey = 'o' OR sq2_alias1.col_varchar_key <= 'd' ) ) AS alias2 , cc AS alias3 ) WHERE   EXISTS ( (SELECT DISTINCT  sq3_alias1.col_varchar_nokey AS sq3_field1 FROM ( b AS sq3_alias1 RIGHT  JOIN bb AS sq3_alias2 ON (sq3_alias2.col_varchar_nokey = sq3_alias1.col_varchar_key  ) )   ) )  GROUP BY field3  ORDER BY alias1.col_datetime_key , alias2 .pk  , alias1.col_date_key , alias1 .pk ASC
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -43,2 +43,3 @@
               "filtered": "40.00",
+              "using_where": true,
               "using_join_buffer": "Block Nested Loop",
@@ -54,4 +55,3 @@
                 "col_varchar_nokey"
-              ],
-              "attached_condition": "((`test`.`sq2_alias1`.`col_varchar_nokey` = 'o') or (`test`.`sq2_alias1`.`col_varchar_key` <= 'd'))"
+              ]
             }
QUERY: SELECT  col_int_nokey AS field1 FROM a AS table1 WHERE table1 .pk = table1.pk
STATUS: EQUAL
QUERY: SELECT    alias1.col_time_key AS field1 , alias1.col_datetime_key AS field2 , alias1.col_int_key AS field3 FROM ( bb AS alias1 , ( SELECT   sq1_alias1.* FROM ( cc AS sq1_alias1 INNER JOIN cc AS sq1_alias2 ON (sq1_alias2.col_varchar_key = sq1_alias1.col_varchar_nokey  ) )  ) AS alias2 , ( SELECT   sq2_alias1.* FROM b AS sq2_alias1  ) AS alias3 ) WHERE  alias1.col_varchar_nokey <= ANY (SELECT   sq3_alias1.col_varchar_nokey AS sq3_field1 FROM ( c AS sq3_alias1 INNER JOIN ( c AS sq3_alias2 INNER JOIN c AS sq3_alias3 ON (sq3_alias3.pk = sq3_alias2.col_int_key  ) ) ON (sq3_alias3.col_varchar_nokey = sq3_alias2.col_varchar_key  ) )   )   
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -15,2 +15,3 @@
           "filtered": "100.00",
+          "using_where": true,
           "cost_info": {
@@ -27,3 +28,2 @@
           ],
-          "attached_condition": "<nop>((`test`.`alias1`.`col_varchar_nokey` <= (/* select#4 */ select max(`test`.`sq3_alias1`.`col_varchar_nokey`) from `test`.`c` `sq3_alias1` join `test`.`c` `sq3_alias2` join `test`.`c` `sq3_alias3` where ((`test`.`sq3_alias3`.`pk` = `test`.`sq3_alias2`.`col_int_key`) and (`test`.`sq3_alias3`.`col_varchar_nokey` = `test`.`sq3_alias2`.`col_varchar_key`)))))",
           "attached_subqueries": [
@@ -73,2 +73,3 @@
                       "filtered": "100.00",
+                      "using_where": true,
                       "using_index": true,
@@ -84,4 +85,3 @@
                         "col_varchar_key"
-                      ],
-                      "attached_condition": "(`test`.`sq3_alias2`.`col_int_key` is not null)"
+                      ]
                     }
@@ -106,2 +106,3 @@
                       "filtered": "10.00",
+                      "using_where": true,
                       "cost_info": {
@@ -115,4 +116,3 @@
                         "col_varchar_nokey"
-                      ],
-                      "attached_condition": "(`test`.`sq3_alias3`.`col_varchar_nokey` = `test`.`sq3_alias2`.`col_varchar_key`)"
+                      ]
                     }
@@ -154,2 +154,3 @@
           "filtered": "100.00",
+          "using_where": true,
           "using_join_buffer": "Block Nested Loop",
@@ -163,4 +164,3 @@
             "col_varchar_nokey"
-          ],
-          "attached_condition": "(`test`.`sq1_alias1`.`col_varchar_nokey` is not null)"
+          ]
         }
QUERY: SELECT    alias1.col_varchar_nokey AS field1 , alias1.col_varchar_key AS field2 , alias1.col_varchar_key AS field3 FROM ( b AS alias1 , c AS alias2 , b AS alias3 ) WHERE (  alias1.col_varchar_nokey >= ALL (SELECT DISTINCT  sq1_alias1.col_varchar_key AS sq1_field1 FROM ( view_a AS sq1_alias1 LEFT OUTER JOIN c AS sq1_alias2 ON (sq1_alias2.col_varchar_key = sq1_alias1.col_varchar_nokey  ) )   ) ) AND alias1.col_int_key NOT BETWEEN 20 AND ( 20 + 10 ) AND (   EXISTS (SELECT DISTINCT  sq2_alias1.col_int_key AS sq2_field1 FROM ( cc AS sq2_alias1 INNER JOIN b AS sq2_alias2 ON (sq2_alias2.col_int_nokey = sq2_alias1.col_int_key  ) ) WHERE sq2_alias1.col_varchar_nokey != alias3.col_varchar_nokey AND sq2_alias1.col_varchar_nokey <= 'g' ) AND alias1.col_varchar_nokey != 'z' )  HAVING field1 <= 3 ORDER BY CONCAT( alias1.col_varchar_key, alias2.col_varchar_key ), field1, field2, field3 LIMIT 1
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -21,2 +21,3 @@
             "filtered": "5.00",
+            "using_where": true,
             "cost_info": {
@@ -33,3 +34,2 @@
             ],
-            "attached_condition": "(<not>((`test`.`alias1`.`col_varchar_nokey` < <max>(/* select#2 */ select `test`.`a`.`col_varchar_key` AS `sq1_field1` from `test`.`a` left join `test`.`c` `sq1_alias2` on((`test`.`sq1_alias2`.`col_varchar_key` = `test`.`a`.`col_varchar_nokey`)) where 1))) and (`test`.`alias1`.`col_int_key` not between 20 and <cache>((20 + 10))) and (`test`.`alias1`.`col_varchar_nokey` <> 'z'))",
             "attached_subqueries": [
@@ -81,2 +81,3 @@
                         "filtered": "100.00",
+                        "using_where": true,
                         "using_index": true,
@@ -90,4 +91,3 @@
                           "col_varchar_key"
-                        ],
-                        "attached_condition": "<if>(is_not_null_compl(sq1_alias2), (`test`.`sq1_alias2`.`col_varchar_key` = `test`.`a`.`col_varchar_nokey`), true)"
+                        ]
                       }
@@ -107,2 +107,3 @@
             "filtered": "100.00",
+            "using_where": true,
             "using_join_buffer": "Block Nested Loop",
@@ -118,3 +119,2 @@
             ],
-            "attached_condition": "exists(/* select#3 */ select `test`.`sq2_alias1`.`col_int_key` AS `sq2_field1` from `test`.`cc` `sq2_alias1` join `test`.`b` `sq2_alias2` where ((`test`.`sq2_alias1`.`col_int_key` = `test`.`sq2_alias2`.`col_int_nokey`) and (`test`.`sq2_alias1`.`col_varchar_nokey` <> `test`.`alias3`.`col_varchar_nokey`) and (`test`.`sq2_alias1`.`col_varchar_nokey` <= 'g')))",
             "attached_subqueries": [
@@ -136,2 +136,3 @@
                         "filtered": "100.00",
+                        "using_where": true,
                         "cost_info": {
@@ -144,4 +145,3 @@
                           "col_int_nokey"
-                        ],
-                        "attached_condition": "(`test`.`sq2_alias2`.`col_int_nokey` is not null)"
+                        ]
                       }
@@ -166,2 +166,3 @@
                         "filtered": "30.00",
+                        "using_where": true,
                         "cost_info": {
@@ -175,4 +176,3 @@
                           "col_varchar_nokey"
-                        ],
-                        "attached_condition": "((`test`.`sq2_alias1`.`col_varchar_nokey` <> `test`.`alias3`.`col_varchar_nokey`) and (`test`.`sq2_alias1`.`col_varchar_nokey` <= 'g'))"
+                        ]
                       }
QUERY: SELECT   SQL_SMALL_RESULT  (SELECT   COUNT(  sq1_alias1.col_varchar_nokey ) AS sq1_field1 FROM ( cc AS sq1_alias1 , c AS sq1_alias2 )  ) AS field1 FROM ( c AS alias1 LEFT  JOIN ( ( ( SELECT   sq2_alias1.* FROM bb AS sq2_alias1  ) AS alias2 INNER JOIN ( SELECT   sq3_alias2.* FROM ( bb AS sq3_alias1 , a AS sq3_alias2 ) WHERE sq3_alias1.col_varchar_nokey != sq3_alias2.col_varchar_key ) AS alias3 ON (alias3.pk = alias2.pk  ) ) ) ON (alias3.col_varchar_key = alias2.col_varchar_key  ) ) WHERE  alias3.col_varchar_key > ALL (SELECT   sq4_alias2.col_varchar_nokey AS sq4_field1 FROM ( d AS sq4_alias1 STRAIGHT_JOIN cc AS sq4_alias2 ON (sq4_alias2.pk = sq4_alias1.col_int_key  ) )   )  GROUP BY field1 HAVING field1 = 'u' ORDER BY alias1.col_varchar_key , alias3 .pk DESC , alias1.col_varchar_key , alias1 .pk 
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -75,2 +75,3 @@
               "filtered": "100.00",
+              "using_where": true,
               "cost_info": {
@@ -83,4 +84,3 @@
                 "col_varchar_nokey"
-              ],
-              "attached_condition": "<if>(is_not_null_compl(sq2_alias1..sq3_alias2), (`test`.`sq3_alias1`.`col_varchar_nokey` <> `test`.`sq2_alias1`.`col_varchar_key`), true)"
+              ]
             }
@@ -106,2 +106,3 @@
               "filtered": "100.00",
+              "using_where": true,
               "cost_info": {
@@ -116,3 +117,2 @@
               ],
-              "attached_condition": "(<if>(found_match(sq2_alias1..sq3_alias2), <not>((`test`.`sq3_alias2`.`col_varchar_key` <= <max>(/* select#5 */ select `test`.`sq4_alias2`.`col_varchar_nokey` AS `sq4_field1` from `test`.`d` `sq4_alias1` straight_join `test`.`cc` `sq4_alias2` where (`test`.`sq4_alias2`.`pk` = `test`.`sq4_alias1`.`col_int_key`)))), true) and <if>(is_not_null_compl(sq2_alias1..sq3_alias2), (`test`.`sq3_alias2`.`col_varchar_key` = `test`.`sq2_alias1`.`col_varchar_key`), true))",
               "attached_subqueries": [
@@ -142,2 +142,3 @@
                           "filtered": "100.00",
+                          "using_where": true,
                           "using_index": true,
@@ -151,4 +152,3 @@
                             "col_int_key"
-                          ],
-                          "attached_condition": "(`test`.`sq4_alias1`.`col_int_key` is not null)"
+                          ]
                         }
QUERY: SELECT    CONCAT( table1.col_varchar_nokey , table1.col_varchar_key ) AS field1 , table1.col_varchar_key AS field2 , CONCAT( table1.col_varchar_nokey , table1.col_varchar_key ) AS field3 FROM ( cc AS table1 STRAIGHT_JOIN ( ( ( SELECT   subquery1_t2.* FROM ( c AS subquery1_t1 LEFT  JOIN ( c AS subquery1_t2 LEFT OUTER JOIN cc AS subquery1_t3 ON (subquery1_t3.col_int_key = subquery1_t2.pk  ) ) ON (subquery1_t3.col_int_key = subquery1_t2.col_int_key  ) )  ) AS table2 LEFT OUTER JOIN bb AS table3 ON (table3.col_varchar_key = table2.col_varchar_nokey  ) ) ) ON (table3.col_varchar_nokey = table2.col_varchar_key  ) ) WHERE (  table3.col_varchar_key <= (SELECT 'r' FROM dummy ) ) AND ( table1.pk <= table2.col_int_key AND table1.pk > table3.col_int_key ) 
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -47,2 +47,3 @@
           "filtered": "100.00",
+          "using_where": true,
           "using_join_buffer": "Block Nested Loop",
@@ -59,3 +60,2 @@
           ],
-          "attached_condition": "((`test`.`table3`.`col_varchar_key` <= (/* select#3 */ select 'r' from `test`.`dummy`)) and (`test`.`table1`.`pk` > `test`.`table3`.`col_int_key`))",
           "attached_subqueries": [
@@ -107,3 +107,4 @@
           "filtered": "3.50",
-          "index_condition": "((`test`.`subquery1_t2`.`pk` = `test`.`subquery1_t2`.`col_int_key`) and (`test`.`table1`.`pk` <= `test`.`subquery1_t2`.`col_int_key`))",
+          "index_condition": true,
+          "using_where": true,
           "cost_info": {
@@ -119,4 +120,3 @@
             "col_varchar_nokey"
-          ],
-          "attached_condition": "(`test`.`subquery1_t2`.`col_varchar_nokey` = `test`.`table3`.`col_varchar_key`)"
+          ]
         }
QUERY: SELECT    CONCAT( table2.col_varchar_key , table1.col_varchar_key ) AS field1 , table2.pk AS field2 , table1.pk AS field3 FROM ( cc AS table1 STRAIGHT_JOIN ( ( ( SELECT  SQL_SMALL_RESULT subquery1_t2.* FROM ( cc AS subquery1_t1 RIGHT OUTER JOIN bb AS subquery1_t2 ON (subquery1_t2.col_int_nokey = subquery1_t1.pk  ) )  ) AS table2 INNER JOIN cc AS table3 ON (table3.pk = table2.pk  ) ) ) ON (table3.col_int_key = table2.col_int_nokey  ) ) WHERE (   EXISTS (SELECT   subquery2_t1.col_int_nokey AS subquery2_field1 FROM ( c AS subquery2_t1 INNER JOIN ( c AS subquery2_t2 STRAIGHT_JOIN b AS subquery2_t3 ON (subquery2_t3.col_int_key = subquery2_t2.pk  AND subquery2_t2.col_int_key NOT IN (SELECT   child_subquery1_t1.col_int_nokey AS child_subquery1_field1 FROM ( cc AS child_subquery1_t1 LEFT  JOIN c AS child_subquery1_t2 ON (child_subquery1_t2.col_int_nokey = child_subquery1_t1.col_int_key ) )    ) ) ) ON (subquery2_t3.col_varchar_key = subquery2_t2.col_varchar_key  ) ) WHERE subquery2_t3.col_varchar_nokey <= table2.col_varchar_nokey AND subquery2_t3.pk <= table2.pk ) ) OR ( table3.col_varchar_nokey <= 'c' AND table2.col_varchar_key != table2.col_varchar_nokey ) ORDER BY table1.col_varchar_key /*+JavaDB:Postgres: NULLS FIRST*/ , table1 .pk DESC /*+JavaDB:Postgres: NULLS LAST */, field1 /*+JavaDB:Postgres: NULLS FIRST */, field2 /*+JavaDB:Postgres: NULLS FIRST */, field3 /*+JavaDB:Postgres: NULLS FIRST */ 
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -47,2 +47,3 @@
             "filtered": "100.00",
+            "using_where": true,
             "using_join_buffer": "Block Nested Loop",
@@ -60,3 +61,2 @@
             ],
-            "attached_condition": "(exists(/* select#3 */ select `test`.`subquery2_t1`.`col_int_nokey` AS `subquery2_field1` from `test`.`c` `subquery2_t1` join `test`.`c` `subquery2_t2` straight_join `test`.`b` `subquery2_t3` where ((`test`.`subquery2_t3`.`col_int_key` = `test`.`subquery2_t2`.`pk`) and (`test`.`subquery2_t3`.`col_varchar_key` = `test`.`subquery2_t2`.`col_varchar_key`) and (`test`.`subquery2_t3`.`col_varchar_nokey` <= `test`.`subquery1_t2`.`col_varchar_nokey`) and (`test`.`subquery2_t3`.`pk` <= `test`.`subquery1_t2`.`pk`) and (not(<in_optimizer>(`test`.`subquery2_t2`.`col_int_key`,`test`.`subquery2_t2`.`col_int_key` in ( <materialize> (/* select#4 */ select `test`.`child_subquery1_t1`.`col_int_nokey` AS `child_subquery1_field1` from `test`.`cc` `child_subquery1_t1` left join `test`.`c` `child_subquery1_t2` on((`test`.`child_subquery1_t2`.`col_int_nokey` = `test`.`child_subquery1_t1`.`col_int_key`)) where 1 having 1 ), <primary_index_lookup>(`test`.`subquery2_t2`.`col_int_key` in <temporary table> on <auto_key> where ((`test`.`subquery2_t2`.`col_int_key` = `materialized-subquery`.`child_subquery1_field1`))))))))) or (`test`.`subquery1_t2`.`col_varchar_key` <> `test`.`subquery1_t2`.`col_varchar_nokey`))",
             "attached_subqueries": [
@@ -106,2 +106,3 @@
                         "filtered": "100.00",
+                        "using_where": true,
                         "using_index": true,
@@ -119,3 +120,2 @@
                         ],
-                        "attached_condition": "(not(<in_optimizer>(`test`.`subquery2_t2`.`col_int_key`,`test`.`subquery2_t2`.`col_int_key` in ( <materialize> (/* select#4 */ select `test`.`child_subquery1_t1`.`col_int_nokey` AS `child_subquery1_field1` from `test`.`cc` `child_subquery1_t1` left join `test`.`c` `child_subquery1_t2` on((`test`.`child_subquery1_t2`.`col_int_nokey` = `test`.`child_subquery1_t1`.`col_int_key`)) where 1 having 1 ), <primary_index_lookup>(`test`.`subquery2_t2`.`col_int_key` in <temporary table> on <auto_key> where ((`test`.`subquery2_t2`.`col_int_key` = `materialized-subquery`.`child_subquery1_field1`)))))))",
                         "attached_subqueries": [
@@ -164,2 +164,3 @@
                                         "filtered": "100.00",
+                                        "using_where": true,
                                         "using_join_buffer": "Block Nested Loop",
@@ -173,4 +174,3 @@
                                           "col_int_nokey"
-                                        ],
-                                        "attached_condition": "<if>(is_not_null_compl(child_subquery1_t2), (`test`.`child_subquery1_t2`.`col_int_nokey` = `test`.`child_subquery1_t1`.`col_int_key`), true)"
+                                        ]
                                       }
@@ -237,2 +237,3 @@
             "filtered": "12.50",
+            "using_where": true,
             "cost_info": {
@@ -248,3 +249,2 @@
             ],
-            "attached_condition": "((`test`.`table3`.`col_int_key` = `test`.`subquery1_t2`.`col_int_nokey`) and (exists(/* select#3 */ select `test`.`subquery2_t1`.`col_int_nokey` AS `subquery2_field1` from `test`.`c` `subquery2_t1` join `test`.`c` `subquery2_t2` straight_join `test`.`b` `subquery2_t3` where ((`test`.`subquery2_t3`.`col_int_key` = `test`.`subquery2_t2`.`pk`) and (`test`.`subquery2_t3`.`col_varchar_key` = `test`.`subquery2_t2`.`col_varchar_key`) and (`test`.`subquery2_t3`.`col_varchar_nokey` <= `test`.`subquery1_t2`.`col_varchar_nokey`) and (`test`.`subquery2_t3`.`pk` <= `test`.`subquery1_t2`.`pk`) and (not(<in_optimizer>(`test`.`subquery2_t2`.`col_int_key`,`test`.`subquery2_t2`.`col_int_key` in ( <materialize> (/* select#4 */ select `test`.`child_subquery1_t1`.`col_int_nokey` AS `child_subquery1_field1` from `test`.`cc` `child_subquery1_t1` left join `test`.`c` `child_subquery1_t2` on((`test`.`child_subquery1_t2`.`col_int_nokey` = `test`.`child_subquery1_t1`.`col_int_key`)) where 1 having 1 ), <primary_index_lookup>(`test`.`subquery2_t2`.`col_int_key` in <temporary table> on <auto_key> where ((`test`.`subquery2_t2`.`col_int_key` = `materialized-subquery`.`child_subquery1_field1`))))))))) or ((`test`.`table3`.`col_varchar_nokey` <= 'c') and (`test`.`subquery1_t2`.`col_varchar_key` <> `test`.`subquery1_t2`.`col_varchar_nokey`))))",
             "attached_subqueries": [
@@ -294,2 +294,3 @@
                         "filtered": "100.00",
+                        "using_where": true,
                         "using_index": true,
@@ -307,3 +308,2 @@
                         ],
-                        "attached_condition": "(not(<in_optimizer>(`test`.`subquery2_t2`.`col_int_key`,`test`.`subquery2_t2`.`col_int_key` in ( <materialize> (/* select#4 */ select `test`.`child_subquery1_t1`.`col_int_nokey` AS `child_subquery1_field1` from `test`.`cc` `child_subquery1_t1` left join `test`.`c` `child_subquery1_t2` on((`test`.`child_subquery1_t2`.`col_int_nokey` = `test`.`child_subquery1_t1`.`col_int_key`)) where 1 having 1 ), <primary_index_lookup>(`test`.`subquery2_t2`.`col_int_key` in <temporary table> on <auto_key> where ((`test`.`subquery2_t2`.`col_int_key` = `materialized-subquery`.`child_subquery1_field1`)))))))",
                         "attached_subqueries": [
@@ -352,2 +352,3 @@
                                         "filtered": "100.00",
+                                        "using_where": true,
                                         "using_join_buffer": "Block Nested Loop",
@@ -361,4 +362,3 @@
                                           "col_int_nokey"
-                                        ],
-                                        "attached_condition": "<if>(is_not_null_compl(child_subquery1_t2), (`test`.`child_subquery1_t2`.`col_int_nokey` = `test`.`child_subquery1_t1`.`col_int_key`), true)"
+                                        ]
                                       }
QUERY: SELECT     (SELECT   MAX( DISTINCT sq1_alias1.col_int_key ) AS sq1_field1 FROM ( cc AS sq1_alias1 , bb AS sq1_alias2 ) WHERE sq1_alias2.pk <> alias1.pk AND sq1_alias2.pk <= alias1.col_int_key ) AS field1 , COUNT(  alias1.col_varchar_key ) AS field2 FROM ( bb AS alias1 LEFT OUTER JOIN ( ( cc AS alias2 INNER JOIN cc AS alias3 ON (alias3.col_int_key = alias2.col_int_key  ) ) ) ON (alias3.col_varchar_nokey = alias2.col_varchar_key  ) ) WHERE (   EXISTS ( (SELECT   sq2_alias1.col_varchar_nokey AS sq2_field1 FROM c AS sq2_alias1 WHERE  ( sq2_alias1.col_varchar_nokey , sq2_alias1.col_varchar_nokey )  IN (SELECT   c_sq1_alias1.col_varchar_key AS c_sq1_field1 , MAX(  c_sq1_alias1.col_varchar_nokey ) AS c_sq1_field2 FROM cc AS c_sq1_alias1    ) GROUP BY sq2_field1 ) ) ) OR ( alias1.col_int_key > 51 AND alias1.col_int_key < ( 51 + 209 ) OR alias1.col_int_key > 51 AND alias1.col_int_key < ( 51 + 159 ) ) OR  (SELECT  SQL_SMALL_RESULT MIN(  sq3_alias1.pk ) AS sq3_field1 FROM ( c AS sq3_alias1 RIGHT OUTER JOIN c AS sq3_alias2 ON (sq3_alias2.col_int_key = sq3_alias1.pk  ) )  ) IS NOT NULL  GROUP BY field1 HAVING field2 <> 5 ORDER BY alias1.col_time_key ASC , field2  , CONCAT( alias2.col_varchar_key, alias3.col_varchar_key )
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -113,3 +113,3 @@
                     "rows_produced_per_join": 0,
-                    "filtered": "5.00",
+                    "filtered": "100.00",
                     "range_checked_for_each_record": "index map: 0x1",
@@ -236,2 +236,3 @@
                 "filtered": "100.00",
+                "using_where": true,
                 "cost_info": {
@@ -245,3 +246,2 @@
                 ],
-                "attached_condition": "<in_optimizer>((`test`.`sq2_alias1`.`col_varchar_nokey`,`test`.`sq2_alias1`.`col_varchar_nokey`),(`test`.`sq2_alias1`.`col_varchar_nokey`,`test`.`sq2_alias1`.`col_varchar_nokey`) in ( <materialize> (/* select#4 */ select `test`.`c_sq1_alias1`.`col_varchar_key` AS `c_sq1_field1`,max(`test`.`c_sq1_alias1`.`col_varchar_nokey`) AS `c_sq1_field2` from `test`.`cc` `c_sq1_alias1` having 1 ), <primary_index_lookup>(`test`.`sq2_alias1`.`col_varchar_nokey` in <temporary table> on <auto_key> where ((`test`.`sq2_alias1`.`col_varchar_nokey` = `materialized-subquery`.`c_sq1_field1`) and (`test`.`sq2_alias1`.`col_varchar_nokey` = `materialized-subquery`.`c_sq1_field2`)))))",
                 "attached_subqueries": [
QUERY: SELECT     (SELECT 5 FROM dummy ) AS field1 FROM ( b AS table1 INNER JOIN ( ( ( SELECT   subquery2_t1.* FROM ( cc AS subquery2_t1 INNER JOIN cc AS subquery2_t2 ON (subquery2_t2.col_varchar_key = subquery2_t1.col_varchar_key  ) )  ) AS table2 LEFT  JOIN cc AS table3 ON (table3.col_int_key = table2.pk  ) ) ) ON (table3.col_varchar_key = table2.col_varchar_key  ) ) WHERE (   EXISTS ( (SELECT   subquery3_t2.col_varchar_nokey AS subquery3_field1 FROM ( d AS subquery3_t1 INNER JOIN bb AS subquery3_t2 ON (subquery3_t2.col_int_key = subquery3_t1.pk  ) )   ) ) ) OR ( table1.col_varchar_key = 'w' AND table1.col_varchar_key = table3.col_varchar_key ) ORDER BY table1.col_varchar_key DESC /*+JavaDB:Postgres: NULLS LAST */ , field1 /*+JavaDB:Postgres: NULLS FIRST */ LIMIT 10 OFFSET 6
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -55,3 +55,4 @@
             "rows_produced_per_join": 20,
-            "filtered": "80.00",
+            "filtered": "100.00",
+            "using_where": true,
             "using_index": true,
@@ -68,4 +69,3 @@
               "col_varchar_key"
-            ],
-            "attached_condition": "((`test`.`table3`.`col_int_key` is not null) and (`test`.`table3`.`col_varchar_key` is not null))"
+            ]
           }
@@ -91,2 +91,3 @@
             "filtered": "6.67",
+            "using_where": true,
             "cost_info": {
@@ -100,4 +101,3 @@
               "col_varchar_key"
-            ],
-            "attached_condition": "(`test`.`subquery2_t1`.`col_varchar_key` = `test`.`table3`.`col_varchar_key`)"
+            ]
           }
@@ -156,2 +156,3 @@
                   "filtered": "100.00",
+                  "using_where": true,
                   "cost_info": {
@@ -165,4 +166,3 @@
                     "col_varchar_nokey"
-                  ],
-                  "attached_condition": "(`test`.`subquery3_t2`.`col_int_key` is not null)"
+                  ]
                 }
QUERY: SELECT    alias1.col_time_key AS field1 , alias2.col_varchar_key AS field2 FROM ( b AS alias1 , ( SELECT   sq1_alias1.* FROM cc AS sq1_alias1  ) AS alias2 , c AS alias3 ) WHERE (   EXISTS ( (SELECT 5 FROM DUAL ) ) ) OR ( alias1.col_varchar_key  IN ('e' , 'USA') OR alias1.col_varchar_key  IN ('USA') )  GROUP BY field1, field2 HAVING field2 > 'e' 
STATUS: EQUAL
QUERY: SELECT     (SELECT 'z' FROM dummy ) AS field1 , table1.pk AS field2 , table1.col_time_key AS field3 , table2.col_datetime_key AS field4 , table1.col_datetime_key AS field5 , table2.pk AS field6 FROM ( ( SELECT   subquery2_t1.* FROM ( c AS subquery2_t1 INNER JOIN cc AS subquery2_t2 ON (subquery2_t2.pk = subquery2_t1.pk  ) )  ) AS table1 INNER JOIN ( SELECT   subquery3_t1.* FROM ( b AS subquery3_t1 LEFT  JOIN c AS subquery3_t2 ON (subquery3_t2.pk = subquery3_t1.pk  ) )  ) AS table2 ON (table2.pk = table1.col_int_key  ) ) WHERE (   EXISTS ( (SELECT   subquery4_t1.col_varchar_key AS subquery4_field1 FROM ( cc AS subquery4_t1 LEFT OUTER JOIN c AS subquery4_t2 ON (subquery4_t2.pk = subquery4_t1.col_int_key  ) )   ) ) ) OR ( table1.pk = 141 AND table1.pk = 79 ) ORDER BY table1.col_datetime_key DESC /*+JavaDB:Postgres: NULLS LAST */
STATUS: EQUAL
QUERY: SELECT    alias1.col_int_key AS field1 , alias2.col_varchar_key AS field2 FROM ( c AS alias1 , ( SELECT   sq1_alias1.* FROM ( cc AS sq1_alias1 RIGHT  JOIN b AS sq1_alias2 ON (sq1_alias2.col_int_key = sq1_alias1.pk  ) )  ) AS alias2 , ( SELECT   sq2_alias1.* FROM ( cc AS sq2_alias1 INNER JOIN c AS sq2_alias2 ON (sq2_alias2.pk = sq2_alias1.pk  ) )  ) AS alias3 ) WHERE  alias3.col_int_key  IN (SELECT   sq3_alias1.col_int_key AS sq3_field1 FROM ( c AS sq3_alias1 , c AS sq3_alias2 )    )  HAVING ((field1 = 'z' OR field2 < 235) AND field1 != 1) ORDER BY alias1.col_varchar_key DESC
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -167,3 +167,2 @@
             "rows_examined_per_scan": 1,
-            "attached_condition": "(`<subquery4>`.`sq3_field1` = `test`.`sq2_alias1`.`col_int_key`)",
             "materialized_from_subquery": {
QUERY: SELECT  STRAIGHT_JOIN  table1.pk AS field1 FROM ( c AS table1 INNER JOIN ( ( c AS table2 INNER JOIN ( SELECT   subquery1_t1.* FROM ( bb AS subquery1_t1 STRAIGHT_JOIN cc AS subquery1_t2 ON (subquery1_t2.pk = subquery1_t1.col_int_nokey  ) ) WHERE ( subquery1_t2.col_varchar_key < 'x' AND subquery1_t1.col_int_nokey != subquery1_t2.pk ) ) AS table3 ON (table3.pk = table2.col_int_key  AND table2.col_int_key = (SELECT   MIN(  subquery2_t1.col_int_nokey ) AS subquery2_field1 FROM ( cc AS subquery2_t1 INNER JOIN cc AS subquery2_t2 ON (subquery2_t2.pk = subquery2_t1.col_int_nokey  ) )  ) ) ) ) ON (table3.col_varchar_key = table2.col_varchar_nokey  ) ) WHERE (  table1.pk = ALL (SELECT 25 FROM dummy UNION SELECT 2 FROM dummy ) ) AND ( table1.col_varchar_key NOT IN ('z', 'n') OR table1.pk > 67 AND table1.pk < ( 67 + 32 ) ) 
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -29,2 +29,3 @@
                     "filtered": "100.00",
+                    "using_where": true,
                     "cost_info": {
@@ -34,4 +35,3 @@
                       "data_read_per_join": "8"
-                    },
-                    "attached_condition": "(<cache>(`test`.`table1`.`pk`) <> 25)"
+                    }
                   }
@@ -53,2 +53,3 @@
                     "filtered": "100.00",
+                    "using_where": true,
                     "cost_info": {
@@ -58,4 +59,3 @@
                       "data_read_per_join": "8"
-                    },
-                    "attached_condition": "(<cache>(`test`.`table1`.`pk`) <> 2)"
+                    }
                   }
@@ -83,2 +83,3 @@
                 "filtered": "100.00",
+                "using_where": true,
                 "cost_info": {
@@ -91,4 +92,3 @@
                   "col_int_nokey"
-                ],
-                "attached_condition": "(`test`.`subquery2_t1`.`col_int_nokey` is not null)"
+                ]
               }
QUERY: SELECT   SQL_SMALL_RESULT table2.col_varchar_key AS field1 , table2.col_time_key AS field2 , table1.col_time_key AS field3 , table1.col_datetime_key AS field4 , ( ( table1.col_int_key ) - ( table1.pk ) ) AS field5 FROM ( cc AS table1 STRAIGHT_JOIN a AS table2 ON (table2.col_int_key = table1.col_int_nokey  ) ) WHERE (   EXISTS ( (SELECT   subquery1_t1.col_varchar_key AS subquery1_field1 FROM ( c AS subquery1_t1 LEFT  JOIN b AS subquery1_t2 ON (subquery1_t2.col_int_nokey = subquery1_t1.pk  AND subquery1_t1.pk NOT IN (SELECT   child_subquery1_t1.col_int_key AS child_subquery1_field1 FROM b AS child_subquery1_t1    ) ) )  GROUP BY subquery1_field1 ) ) ) AND table2.col_varchar_key >= table1.col_varchar_key ORDER BY table1.col_date_key DESC /*+JavaDB:Postgres: NULLS LAST */ , field1 /*+JavaDB:Postgres: NULLS FIRST */, field2 /*+JavaDB:Postgres: NULLS FIRST */, field3 /*+JavaDB:Postgres: NULLS FIRST */, field4 /*+JavaDB:Postgres: NULLS FIRST */, field5 /*+JavaDB:Postgres: NULLS FIRST */ 
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -41,3 +41,3 @@
             "table_name": "table2",
-            "access_type": "ALL",
+            "access_type": "range",
             "possible_keys": [
@@ -46,2 +46,7 @@
             ],
+            "key": "col_int_key",
+            "used_key_parts": [
+              "col_int_key"
+            ],
+            "key_length": "5",
             "rows_examined_per_scan": 1,
@@ -108,2 +113,3 @@
                   "filtered": "100.00",
+                  "using_where": true,
                   "using_join_buffer": "Block Nested Loop",
@@ -118,3 +124,2 @@
                   ],
-                  "attached_condition": "<if>(is_not_null_compl(subquery1_t2), ((`test`.`subquery1_t2`.`col_int_nokey` = `test`.`subquery1_t1`.`pk`) and (not(<in_optimizer>(`test`.`subquery1_t1`.`pk`,`test`.`subquery1_t1`.`pk` in ( <materialize> (/* select#3 */ select `test`.`child_subquery1_t1`.`col_int_key` AS `child_subquery1_field1` from `test`.`b` `child_subquery1_t1` where 1 having 1 ), <primary_index_lookup>(`test`.`subquery1_t1`.`pk` in <temporary table> on <auto_key> where ((`test`.`subquery1_t1`.`pk` = `materialized-subquery`.`child_subquery1_field1`)))))))), true)",
                   "attached_subqueries": [
QUERY: SELECT   SQL_SMALL_RESULT table2.col_varchar_key AS field1 FROM ( c AS table1 LEFT OUTER JOIN cc AS table2 ON (table2.col_int_key = table1.pk  ) ) WHERE (  table2.col_varchar_nokey != ANY (SELECT  SQL_SMALL_RESULT subquery1_t1.col_varchar_key AS subquery1_field1 FROM ( c AS subquery1_t1 LEFT OUTER JOIN c AS subquery1_t2 ON (subquery1_t2.col_int_key = subquery1_t1.col_int_key  OR subquery1_t2.col_int_key = (SELECT   MIN(  child_subquery1_t2.pk ) AS child_subquery1_field1 FROM ( c AS child_subquery1_t1 INNER JOIN c AS child_subquery1_t2 ON (child_subquery1_t2.col_int_key = child_subquery1_t1.pk ) ) WHERE child_subquery1_t2.col_varchar_nokey = child_subquery1_t2.col_varchar_key ) ) ) WHERE subquery1_t2.pk >= table1.col_int_nokey ) ) AND ( table1.pk NOT IN (226, 126) OR table1.col_int_key > 241 AND table1.col_int_key < ( 241 + 133 ) ) OR ( table2.col_varchar_key <> 'a' OR table1.col_int_key < table1.pk ) 
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -50,2 +50,3 @@
           "filtered": "100.00",
+          "using_where": true,
           "cost_info": {
@@ -61,3 +62,2 @@
           ],
-          "attached_condition": "<if>(found_match(table2), ((<nop>(<in_optimizer>(`test`.`table2`.`col_varchar_nokey`,<exists>(/* select#2 */ select sql_small_result 1 from `test`.`c` `subquery1_t1` join `test`.`c` `subquery1_t2` where ((`test`.`subquery1_t2`.`pk` >= `test`.`table1`.`col_int_nokey`) and <if>(outer_field_is_not_null, ((<cache>(`test`.`table2`.`col_varchar_nokey`) <> `test`.`subquery1_t1`.`col_varchar_key`) or isnull(`test`.`subquery1_t1`.`col_varchar_key`)), true) and ((`test`.`subquery1_t1`.`col_int_key` = `test`.`subquery1_t2`.`col_int_key`) or (`test`.`subquery1_t2`.`col_int_key` = (/* select#3 */ select min(`test`.`child_subquery1_t2`.`pk`) AS `child_subquery1_field1` from `test`.`c` `child_subquery1_t1` join `test`.`c` `child_subquery1_t2` where ((`test`.`child_subquery1_t1`.`pk` = `test`.`child_subquery1_t2`.`col_int_key`) and (`test`.`child_subquery1_t2`.`col_varchar_key` = `test`.`child_subquery1_t2`.`col_varchar_nokey`)))))) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`subquery1_t1`.`col_varchar_key`), true)))) and ((`test`.`table1`.`pk` not in (226,126)) or ((`test`.`table1`.`col_int_key` > 241) and (`test`.`table1`.`col_int_key` < <cache>((241 + 133)))))) or (`test`.`table2`.`col_varchar_key` <> 'a') or (`test`.`table1`.`col_int_key` < `test`.`table1`.`pk`)), true)",
           "attached_subqueries": [
@@ -82,3 +82,3 @@
                       "rows_produced_per_join": 6,
-                      "filtered": "33.33",
+                      "filtered": "100.00",
                       "range_checked_for_each_record": "index map: 0x3",
@@ -112,2 +112,3 @@
                       "filtered": "100.00",
+                      "using_where": true,
                       "using_index": true,
@@ -124,3 +125,2 @@
                       ],
-                      "attached_condition": "(<if>(outer_field_is_not_null, ((<cache>(`test`.`table2`.`col_varchar_nokey`) <> `test`.`subquery1_t1`.`col_varchar_key`) or isnull(`test`.`subquery1_t1`.`col_varchar_key`)), true) and ((`test`.`subquery1_t1`.`col_int_key` = `test`.`subquery1_t2`.`col_int_key`) or (`test`.`subquery1_t2`.`col_int_key` = (/* select#3 */ select min(`test`.`child_subquery1_t2`.`pk`) AS `child_subquery1_field1` from `test`.`c` `child_subquery1_t1` join `test`.`c` `child_subquery1_t2` where ((`test`.`child_subquery1_t1`.`pk` = `test`.`child_subquery1_t2`.`col_int_key`) and (`test`.`child_subquery1_t2`.`col_varchar_key` = `test`.`child_subquery1_t2`.`col_varchar_nokey`))))))",
                       "attached_subqueries": [
@@ -145,2 +145,3 @@
                                   "filtered": "100.00",
+                                  "using_where": true,
                                   "cost_info": {
@@ -156,4 +157,3 @@
                                     "col_varchar_nokey"
-                                  ],
-                                  "attached_condition": "((`test`.`child_subquery1_t2`.`col_varchar_key` = `test`.`child_subquery1_t2`.`col_varchar_nokey`) and (`test`.`child_subquery1_t2`.`col_int_key` is not null))"
+                                  ]
                                 }
QUERY: SELECT    alias1.col_varchar_key AS field1 FROM ( ( SELECT   sq1_alias1.* FROM ( view_cc AS sq1_alias1 , cc AS sq1_alias2 ) WHERE sq1_alias1.pk < sq1_alias2.col_int_nokey ) AS alias1 RIGHT OUTER JOIN c AS alias2 ON (alias2.col_varchar_nokey = alias1.col_varchar_key  ) ) WHERE (   EXISTS ( (SELECT   sq2_alias1.col_varchar_nokey AS sq2_field1 FROM ( c AS sq2_alias1 , cc AS sq2_alias2 )   ) ) ) AND alias1.col_int_key = 108  HAVING field1 < 'o' ORDER BY alias1.col_date_key , alias2 .pk ASC, field1 
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -52,2 +52,3 @@
             "filtered": "10.00",
+            "using_where": true,
             "using_join_buffer": "Block Nested Loop",
@@ -62,4 +63,3 @@
               "col_varchar_nokey"
-            ],
-            "attached_condition": "(`test`.`alias2`.`col_varchar_nokey` = `test`.`cc`.`col_varchar_key`)"
+            ]
           }
@@ -71,4 +71,5 @@
             "rows_examined_per_scan": 20,
-            "rows_produced_per_join": 13,
-            "filtered": "33.33",
+            "rows_produced_per_join": 40,
+            "filtered": "100.00",
+            "using_where": true,
             "using_join_buffer": "Block Nested Loop",
@@ -76,5 +77,5 @@
               "read_cost": "1.00",
-              "eval_cost": "2.67",
+              "eval_cost": "8.00",
               "prefix_cost": "15.20",
-              "data_read_per_join": "639"
+              "data_read_per_join": "1K"
             },
@@ -83,4 +84,3 @@
               "col_int_nokey"
-            ],
-            "attached_condition": "(`test`.`cc`.`pk` < `test`.`sq1_alias2`.`col_int_nokey`)"
+            ]
           }
QUERY: SELECT    table2.pk AS field1 FROM ( ( SELECT   subquery1_t1.* FROM ( cc AS subquery1_t1 INNER JOIN c AS subquery1_t2 ON (subquery1_t2.col_varchar_key = subquery1_t1.col_varchar_key  ) ) WHERE (  NOT EXISTS (SELECT   child_subquery1_t2.col_varchar_nokey AS child_subquery1_field1 FROM ( cc AS child_subquery1_t1 INNER JOIN c AS child_subquery1_t2 ON (child_subquery1_t2.pk = child_subquery1_t1.pk ) ) WHERE child_subquery1_t2.col_int_nokey <> subquery1_t1.pk ) OR subquery1_t2.col_varchar_key >= 'c' ) ) AS table1 INNER JOIN cc AS table2 ON (table2.col_int_nokey = table1.col_int_key  ) ) WHERE (  table2.col_varchar_key > (SELECT 'r' FROM dummy ) ) AND table1.col_int_key = 104 ORDER BY table1.col_time_key ASC /*+JavaDB:Postgres: NULLS FIRST */ , field1 /*+JavaDB:Postgres: NULLS FIRST */ LIMIT 1
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -26,2 +26,3 @@
             "filtered": "10.00",
+            "using_where": true,
             "cost_info": {
@@ -37,3 +38,2 @@
             ],
-            "attached_condition": "((`test`.`table2`.`col_int_nokey` = 104) and (`test`.`table2`.`col_varchar_key` > (/* select#4 */ select 'r' from `test`.`dummy`)))",
             "attached_subqueries": [
@@ -84,2 +84,3 @@
             "filtered": "100.00",
+            "using_where": true,
             "cost_info": {
@@ -96,3 +97,2 @@
             ],
-            "attached_condition": "(((not(exists(/* select#3 */ select `test`.`child_subquery1_t2`.`col_varchar_nokey` AS `child_subquery1_field1` from `test`.`cc` `child_subquery1_t1` join `test`.`c` `child_subquery1_t2` where ((`test`.`child_subquery1_t1`.`pk` = `test`.`child_subquery1_t2`.`pk`) and (`test`.`child_subquery1_t2`.`col_int_nokey` <> `test`.`subquery1_t1`.`pk`))))) or (`test`.`subquery1_t1`.`col_varchar_key` >= 'c')) and (`test`.`subquery1_t1`.`col_varchar_key` is not null))",
             "attached_subqueries": [
@@ -117,2 +117,3 @@
                         "filtered": "90.00",
+                        "using_where": true,
                         "cost_info": {
@@ -127,4 +128,3 @@
                           "col_varchar_nokey"
-                        ],
-                        "attached_condition": "(`test`.`child_subquery1_t2`.`col_int_nokey` <> `test`.`subquery1_t1`.`pk`)"
+                        ]
                       }
QUERY: SELECT    alias1.col_datetime_key AS field1 , alias1.col_datetime_key AS field2 FROM ( view_cc AS alias1 , cc AS alias2 , ( SELECT   sq1_alias1.* FROM bb AS sq1_alias1  ) AS alias3 ) WHERE (  NOT EXISTS (SELECT   sq2_alias1.col_int_nokey AS sq2_field1 FROM c AS sq2_alias1 WHERE sq2_alias1.col_varchar_key > alias2.col_varchar_nokey AND sq2_alias1.pk >= 8 ) ) AND alias1.col_varchar_key <> 'b'  HAVING field2 < 'b' ORDER BY alias1.col_time_key  , field1, field2 
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -48,2 +48,3 @@
             "filtered": "95.00",
+            "using_where": true,
             "using_join_buffer": "Block Nested Loop",
@@ -60,4 +61,3 @@
               "col_varchar_key"
-            ],
-            "attached_condition": "(`test`.`cc`.`col_varchar_key` <> 'b')"
+            ]
           }
@@ -71,2 +71,3 @@
             "filtered": "100.00",
+            "using_where": true,
             "using_join_buffer": "Block Nested Loop",
@@ -82,3 +83,2 @@
             ],
-            "attached_condition": "(not(exists(/* select#3 */ select `test`.`sq2_alias1`.`col_int_nokey` AS `sq2_field1` from `test`.`c` `sq2_alias1` where ((`test`.`sq2_alias1`.`col_varchar_key` > `test`.`alias2`.`col_varchar_nokey`) and (`test`.`sq2_alias1`.`pk` >= 8)))))",
             "attached_subqueries": [
@@ -107,2 +107,3 @@
                     "filtered": "33.33",
+                    "using_where": true,
                     "cost_info": {
@@ -117,4 +118,3 @@
                       "col_varchar_key"
-                    ],
-                    "attached_condition": "((`test`.`sq2_alias1`.`col_varchar_key` > `test`.`alias2`.`col_varchar_nokey`) and (`test`.`sq2_alias1`.`pk` >= 8))"
+                    ]
                   }
QUERY: SELECT    MAX(  alias1.pk ) AS field1 FROM ( ( SELECT DISTINCT  sq1_alias1.* FROM bb AS sq1_alias1  ) AS alias1 RIGHT OUTER JOIN ( SELECT   sq2_alias1.* FROM cc AS sq2_alias1 WHERE sq2_alias1.pk < sq2_alias1.col_int_nokey ) AS alias2 ON (alias2.col_varchar_key = alias1.col_varchar_nokey  ) ) WHERE  alias2.col_varchar_nokey > (SELECT   SUM(  sq3_alias1.col_varchar_key ) AS sq3_field1 FROM ( cc AS sq3_alias1 INNER JOIN b AS sq3_alias2 ON (sq3_alias2.col_varchar_key = sq3_alias1.col_varchar_key  AND sq3_alias2.pk > ALL (SELECT 7 UNION SELECT 7 ) ) )  )  HAVING ( ( 7, 8 ) NOT IN (SELECT   sq4_alias1.col_int_nokey AS sq4_field1 , MAX(  sq4_alias1.pk ) AS sq4_field2 FROM ( view_bb AS sq4_alias1 LEFT OUTER JOIN ( cc AS sq4_alias2 RIGHT  JOIN c AS sq4_alias3 ON (sq4_alias3.col_varchar_key = sq4_alias2.col_varchar_nokey  ) ) ON (sq4_alias3.col_varchar_key = sq4_alias2.col_varchar_key  ) )    ) AND field1 >= 2) ORDER BY alias1.col_int_key  , field1 
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -15,2 +15,3 @@
           "filtered": "11.11",
+          "using_where": true,
           "cost_info": {
@@ -27,3 +28,2 @@
           ],
-          "attached_condition": "((`test`.`sq2_alias1`.`col_varchar_nokey` > (/* select#4 */ select sum(`test`.`sq3_alias1`.`col_varchar_key`) AS `sq3_field1` from `test`.`cc` `sq3_alias1` join `test`.`b` `sq3_alias2` where ((`test`.`sq3_alias1`.`col_varchar_key` = `test`.`sq3_alias2`.`col_varchar_key`) and <not>((`test`.`sq3_alias2`.`pk` <= <max>(/* select#5 */ select 7 union /* select#6 */ select 7)))))) and (`test`.`sq2_alias1`.`pk` < `test`.`sq2_alias1`.`col_int_nokey`))",
           "attached_subqueries": [
@@ -54,2 +54,3 @@
                       "filtered": "100.00",
+                      "using_where": true,
                       "using_index": true,
@@ -65,3 +66,2 @@
                       ],
-                      "attached_condition": "(<not>((`test`.`sq3_alias2`.`pk` <= <max>(/* select#5 */ select 7 union /* select#6 */ select 7))) and (`test`.`sq3_alias2`.`col_varchar_key` is not null))",
                       "attached_subqueries": [
@@ -284,2 +284,3 @@
                 "filtered": "100.00",
+                "using_where": true,
                 "using_index": true,
@@ -293,4 +294,3 @@
                   "col_varchar_key"
-                ],
-                "attached_condition": "<if>(is_not_null_compl(sq4_alias2..sq4_alias3), (`test`.`sq4_alias3`.`col_varchar_key` = `test`.`sq4_alias2`.`col_varchar_nokey`), true)"
+                ]
               }
QUERY: SELECT    alias1.col_date_key AS field1 FROM ( ( SELECT   sq1_alias1.* FROM b AS sq1_alias1  ) AS alias1 LEFT OUTER JOIN d AS alias2 ON (alias2.col_varchar_key = alias1.col_varchar_key  ) ) WHERE (  alias1.col_varchar_nokey >= SOME (SELECT   sq2_alias1.col_varchar_key AS sq2_field1 FROM cc AS sq2_alias1 WHERE sq2_alias1.col_varchar_nokey <> alias2.col_varchar_key AND sq2_alias1.col_varchar_nokey != alias2.col_varchar_nokey ) ) AND  alias1.col_int_nokey < ANY (SELECT 7 UNION SELECT 3 )  HAVING field1 >= 1 
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -15,2 +15,3 @@
           "filtered": "100.00",
+          "using_where": true,
           "cost_info": {
@@ -27,3 +28,2 @@
           ],
-          "attached_condition": "<nop>((`test`.`sq1_alias1`.`col_int_nokey` < <max>(/* select#4 */ select 7 union /* select#5 */ select 3)))",
           "attached_subqueries": [
@@ -79,2 +79,3 @@
           "filtered": "100.00",
+          "using_where": true,
           "cost_info": {
@@ -89,3 +90,2 @@
           ],
-          "attached_condition": "<if>(found_match(alias2), <nop>(<in_optimizer>(`test`.`sq1_alias1`.`col_varchar_nokey`,<exists>(/* select#3 */ select 1 from `test`.`cc` `sq2_alias1` where ((`test`.`sq2_alias1`.`col_varchar_nokey` <> `test`.`alias2`.`col_varchar_key`) and (`test`.`sq2_alias1`.`col_varchar_nokey` <> `test`.`alias2`.`col_varchar_nokey`) and <if>(outer_field_is_not_null, ((<cache>(`test`.`sq1_alias1`.`col_varchar_nokey`) >= `test`.`sq2_alias1`.`col_varchar_key`) or isnull(`test`.`sq2_alias1`.`col_varchar_key`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`sq2_alias1`.`col_varchar_key`), true)))), true)",
           "attached_subqueries": [
@@ -105,2 +105,3 @@
                   "filtered": "81.00",
+                  "using_where": true,
                   "cost_info": {
@@ -114,4 +115,3 @@
                     "col_varchar_nokey"
-                  ],
-                  "attached_condition": "((`test`.`sq2_alias1`.`col_varchar_nokey` <> `test`.`alias2`.`col_varchar_key`) and (`test`.`sq2_alias1`.`col_varchar_nokey` <> `test`.`alias2`.`col_varchar_nokey`) and <if>(outer_field_is_not_null, ((<cache>(`test`.`sq1_alias1`.`col_varchar_nokey`) >= `test`.`sq2_alias1`.`col_varchar_key`) or isnull(`test`.`sq2_alias1`.`col_varchar_key`)), true))"
+                  ]
                 }
QUERY: SELECT    COUNT(  alias1.col_varchar_nokey ) AS field1 FROM ( cc AS alias1 INNER JOIN ( ( b AS alias2 RIGHT OUTER JOIN ( SELECT   sq1_alias1.* FROM ( b AS sq1_alias1 , cc AS sq1_alias2 )  ) AS alias3 ON (alias3.col_varchar_key = alias2.col_varchar_key  ) ) ) ON (alias3.col_varchar_key = alias2.col_varchar_key  ) ) WHERE  alias2.col_varchar_nokey <= ANY (SELECT 'z' UNION DISTINCT SELECT 'l' )  HAVING (field1 <> 'j' AND field1 >= 'wr') ORDER BY field1 DESC , alias1.col_int_key  , alias1.col_datetime_key DESC
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -18,2 +18,3 @@
           "filtered": "100.00",
+          "using_where": true,
           "cost_info": {
@@ -28,3 +29,2 @@
           ],
-          "attached_condition": "(<nop>((`test`.`alias2`.`col_varchar_nokey` <= <max>(/* select#3 */ select 'z' union /* select#4 */ select 'l'))) and (`test`.`alias2`.`col_varchar_key` is not null))",
           "attached_subqueries": [
QUERY: SELECT DISTINCT   alias2.col_varchar_nokey AS field1 , alias1.col_date_key AS field2 , alias2.col_datetime_key AS field3 , alias2.col_date_key AS field4 , alias2.col_varchar_key AS field5 , alias2.col_int_key AS field6 FROM ( cc AS alias1 INNER JOIN ( SELECT DISTINCT  sq1_alias1.* FROM ( cc AS sq1_alias1 INNER JOIN c AS sq1_alias2 ON (sq1_alias2.pk = sq1_alias1.col_int_nokey  ) ) WHERE ( sq1_alias2.pk < sq1_alias2.col_int_nokey OR  sq1_alias2.col_varchar_key > SOME (SELECT 1 UNION DISTINCT SELECT 5 ) ) ) AS alias2 ON (alias2.col_varchar_key = alias1.col_varchar_key  ) ) WHERE   EXISTS ( (SELECT   sq2_alias1.col_int_nokey AS sq2_field1 FROM ( c AS sq2_alias1 , view_c AS sq2_alias2 )    ) )  GROUP BY field1, field2, field3, field4, field5, field6 HAVING field4 <> 3 ORDER BY field2  , alias1.col_datetime_key 
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -20,2 +20,3 @@
               "filtered": "100.00",
+              "using_where": true,
               "cost_info": {
@@ -39,3 +40,2 @@
               ],
-              "attached_condition": "(`alias2`.`col_varchar_key` is not null)",
               "materialized_from_subquery": {
@@ -60,2 +60,3 @@
                           "filtered": "100.00",
+                          "using_where": true,
                           "cost_info": {
@@ -78,4 +79,3 @@
                             "col_varchar_nokey"
-                          ],
-                          "attached_condition": "(`test`.`sq1_alias1`.`col_int_nokey` is not null)"
+                          ]
                         }
@@ -100,2 +100,3 @@
                           "filtered": "77.78",
+                          "using_where": true,
                           "cost_info": {
@@ -111,3 +112,2 @@
                           ],
-                          "attached_condition": "((`test`.`sq1_alias1`.`col_int_nokey` < `test`.`sq1_alias2`.`col_int_nokey`) or <nop>((`test`.`sq1_alias2`.`col_varchar_key` > <min>(/* select#3 */ select 1 union /* select#4 */ select 5))))",
                           "attached_subqueries": [
QUERY: SELECT    CONCAT( table2.col_varchar_key , table2.col_varchar_nokey ) AS field1 FROM ( ( SELECT   subquery1_t1.* FROM ( c AS subquery1_t1 INNER JOIN bb AS subquery1_t2 ON (subquery1_t2.col_int_key = subquery1_t1.pk  OR subquery1_t1.col_int_nokey >= ALL (SELECT 3 FROM dummy UNION SELECT 4 FROM dummy ) ) ) WHERE  NOT EXISTS (SELECT  SQL_SMALL_RESULT child_subquery2_t1.col_int_key AS child_subquery1_field1 FROM ( a AS child_subquery2_t1 STRAIGHT_JOIN ( ( cc AS child_subquery2_t2 INNER JOIN c AS child_subquery2_t3 ON (child_subquery2_t3.col_varchar_key = child_subquery2_t2.col_varchar_nokey ) ) ) ON (child_subquery2_t3.col_int_nokey = child_subquery2_t2.pk ) ) WHERE child_subquery2_t1.pk <= subquery1_t2.col_int_key ) ) AS table1 INNER JOIN ( SELECT   subquery2_t1.* FROM c AS subquery2_t1  ) AS table2 ON (table2.pk = table1.pk  ) ) WHERE (  (SELECT  SQL_SMALL_RESULT SUM( DISTINCT subquery3_t1.col_int_key ) AS subquery3_field1 FROM ( bb AS subquery3_t1 INNER JOIN cc AS subquery3_t2 ON (subquery3_t2.col_varchar_key = subquery3_t1.col_varchar_nokey  ) )  ) IS  NULL ) AND ( table1.col_varchar_key  IN ('g', 'z', 'w', 'v', 't') OR table1.pk > 39 AND table1.pk < ( 39 + 233 ) ) OR table1.col_varchar_key IS  NULL ORDER BY table1.col_int_key ASC /*+JavaDB:Postgres: NULLS FIRST */ , field1 /*+JavaDB:Postgres: NULLS FIRST */ LIMIT 100
STATUS:NOT_EQUAL
SYNC_POINT:before_reset_query_plan
Diff: EXPLAIN NORMAL vs OTHER
@@ -26,2 +26,3 @@
             "filtered": "100.00",
+            "using_where": true,
             "using_index": true,
@@ -37,3 +38,2 @@
             ],
-            "attached_condition": "(not(exists(/* select#5 */ select sql_small_result `test`.`child_subquery2_t1`.`col_int_key` AS `child_subquery1_field1` from `test`.`a` `child_subquery2_t1` join `test`.`cc` `child_subquery2_t2` join `test`.`c` `child_subquery2_t3` where ((`test`.`child_subquery2_t2`.`col_varchar_nokey` = `test`.`child_subquery2_t3`.`col_varchar_key`) and (`test`.`child_subquery2_t2`.`pk` = `test`.`child_subquery2_t3`.`col_int_nokey`) and (`test`.`child_subquery2_t1`.`pk` <= `test`.`subquery1_t2`.`col_int_key`)))))",
             "attached_subqueries": [
@@ -81,2 +81,3 @@
                         "filtered": "100.00",
+                        "using_where": true,
                         "using_join_buffer": "Block Nested Loop",
@@ -91,4 +92,3 @@
                           "col_varchar_key"
-                        ],
-                        "attached_condition": "(`test`.`child_subquery2_t3`.`col_int_nokey` is not null)"
+                        ]
                       }
@@ -113,2 +113,3 @@
                         "filtered": "10.00",
+                        "using_where": true,
                         "cost_info": {
@@ -122,4 +123,3 @@
                           "col_varchar_nokey"
-                        ],
-                        "attached_condition": "(`test`.`child_subquery2_t2`.`col_varchar_nokey` = `test`.`child_subquery2_t3`.`col_varchar_key`)"
+                        ]
                       }
@@ -143,2 +143,3 @@
             "filtered": "41.00",
+            "using_where": true,
             "using_join_buffer": "Block Nested Loop",
@@ -156,3 +157,2 @@
             ],
-            "attached_condition": "(((isnull((/* select#7 */ select sql_small_result sum(distinct `test`.`subquery3_t1`.`col_int_key`) AS `subquery3_field1` from `test`.`bb` `subquery3_t1` join `test`.`cc` `subquery3_t2` where (`test`.`subquery3_t2`.`col_varchar_key` = `test`.`subquery3_t1`.`col_varchar_nokey`))) and ((`test`.`subquery1_t1`.`col_varchar_key` in ('g','z','w','v','t')) or ((`test`.`subquery1_t1`.`pk` > 39) and (`test`.`subquery1_t1`.`pk` < <cache>((39 + 233)))))) or isnull(`test`.`subquery1_t1`.`col_varchar_key`)) and ((`test`.`subquery1_t1`.`pk` = `test`.`subquery1_t2`.`col_int_key`) or <not>((`test`.`subquery1_t1`.`col_int_nokey` < <max>(/* select#3 */ select 3 from `test`.`dummy` union /* select#4 */ select 4 from `test`.`dummy`)))))",
             "attached_subqueries": [
@@ -174,2 +174,3 @@
                         "filtered": "100.00",
+                        "using_where": true,
                         "cost_info": {
@@ -183,4 +184,3 @@
                           "col_varchar_nokey"
-                        ],
-                        "attached_condition": "(`test`.`subquery3_t1`.`col_varchar_nokey` is not null)"
+                        ]
                       }

Man Man