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 |
Current File : //home/usr.opt/mysql57/mysql-test/r/explain_for_connection_rqg_trad.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: EQUAL 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: EQUAL 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 @@ -2,2 +2,2 @@ 1 SIMPLE alias1 NULL ref col_int_key col_int_key 5 const 1 100.00 NULL -1 SIMPLE alias2 NULL ALL NULL NULL NULL NULL 2 50.00 Using where; Using join buffer (Block Nested Loop) +1 SIMPLE alias2 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (Block Nested Loop) 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: EQUAL 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: EQUAL 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: EQUAL 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: EQUAL 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: EQUAL 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: EQUAL 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: EQUAL 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 @@ -2,3 +2,3 @@ 1 PRIMARY subquery1_t1 NULL ALL PRIMARY,col_varchar_key NULL NULL NULL 20 6.83 Using where; Using temporary; Using filesort -1 PRIMARY table2 NULL ALL col_varchar_key NULL NULL NULL 20 10.00 Using where; Using join buffer (Block Nested Loop) +1 PRIMARY table2 NULL ALL col_varchar_key NULL NULL NULL 20 100.00 Using where; Using join buffer (Block Nested Loop) 4 SUBQUERY subquery2_t1 NULL ALL NULL NULL NULL NULL 20 100.00 Using where 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: EQUAL 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 @@ -3,3 +3,3 @@ 1 PRIMARY alias2 NULL ALL NULL NULL NULL NULL 20 100.00 Using join buffer (Block Nested Loop) -1 PRIMARY alias3 NULL ALL col_varchar_key NULL NULL NULL 20 33.33 Range checked for each record (index map: 0x20) +1 PRIMARY alias3 NULL range col_varchar_key col_varchar_key 4 NULL 20 100.00 Range checked for each record (index map: 0x20); Using index 2 SUBQUERY sq1_alias1 NULL ALL NULL NULL NULL NULL 20 100.00 NULL 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 @@ -2,3 +2,3 @@ 1 PRIMARY alias1 NULL ALL col_int_key NULL NULL NULL 20 10.00 Using where; Using temporary; Using filesort -1 PRIMARY alias3 NULL ALL col_int_key NULL NULL NULL 20 33.33 Range checked for each record (index map: 0x2) +1 PRIMARY alias3 NULL range col_int_key col_int_key 5 NULL 20 100.00 Range checked for each record (index map: 0x2); Using index 1 PRIMARY alias2 NULL index NULL col_date_key 4 NULL 100 100.00 Using index; Using join buffer (Block Nested Loop) 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 @@ -2,3 +2,3 @@ 1 PRIMARY alias1 NULL ALL col_int_key NULL NULL NULL 20 100.00 Using temporary; Using filesort -1 PRIMARY alias3 NULL ALL col_int_key NULL NULL NULL 20 33.33 Range checked for each record (index map: 0x2) +1 PRIMARY alias3 NULL range col_int_key col_int_key 5 NULL 20 100.00 Range checked for each record (index map: 0x2); Using index 1 PRIMARY alias2 NULL index NULL col_int_key 5 NULL 100 100.00 Using index; Using join buffer (Block Nested Loop) 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: EQUAL 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 @@ -4,3 +4,3 @@ 1 PRIMARY sq1_alias2 NULL index PRIMARY,col_varchar_key col_varchar_key 9 NULL 20 66.67 Using where; Using index; Using join buffer (Block Nested Loop) -1 PRIMARY sq1_alias3 NULL eq_ref PRIMARY,col_varchar_key PRIMARY 4 test.sq1_alias2.pk 1 7.14 Using where +1 PRIMARY sq1_alias3 NULL eq_ref PRIMARY,col_varchar_key PRIMARY 4 test.sq1_alias2.pk 1 100.00 Using where 4 SUBQUERY sq2_alias1 NULL ALL NULL NULL NULL NULL 20 33.33 Using where 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: EQUAL 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: EQUAL 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: EQUAL 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: EQUAL 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: EQUAL 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: EQUAL 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: EQUAL 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 @@ -8,3 +8,3 @@ 4 SUBQUERY c_sq1_alias1 NULL ALL NULL NULL NULL NULL 20 100.00 NULL -2 DEPENDENT SUBQUERY sq1_alias2 NULL ALL PRIMARY NULL NULL NULL 1 5.00 Range checked for each record (index map: 0x1) +2 DEPENDENT SUBQUERY sq1_alias2 NULL ALL PRIMARY NULL NULL NULL 1 100.00 Range checked for each record (index map: 0x1) 2 DEPENDENT SUBQUERY sq1_alias1 NULL index NULL col_int_key 5 NULL 20 100.00 Using index; Using join buffer (Block Nested Loop) 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 @@ -2,3 +2,3 @@ 1 PRIMARY table1 NULL index NULL col_varchar_key 9 NULL 1 100.00 Using index; Using temporary; Using filesort -1 PRIMARY table3 NULL range col_int_key,col_varchar_key col_varchar_key 4 NULL 18 80.00 Using where; Using index; Using join buffer (Block Nested Loop) +1 PRIMARY table3 NULL range col_int_key,col_varchar_key col_varchar_key 4 NULL 18 100.00 Using where; Using index; Using join buffer (Block Nested Loop) 1 PRIMARY subquery2_t1 NULL eq_ref PRIMARY,col_varchar_key PRIMARY 4 test.table3.col_int_key 1 6.67 Using where 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: EQUAL 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: EQUAL 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 @@ -2,3 +2,3 @@ 1 PRIMARY table1 NULL ALL col_varchar_key NULL NULL NULL 20 100.00 Using temporary; Using filesort -1 PRIMARY table2 NULL ALL col_int_key,col_varchar_key NULL NULL NULL 1 100.00 Range checked for each record (index map: 0x22) +1 PRIMARY table2 NULL range col_int_key,col_varchar_key col_int_key 5 NULL 1 100.00 Range checked for each record (index map: 0x22) 2 SUBQUERY subquery1_t1 NULL index NULL col_varchar_key 9 NULL 20 100.00 Using index 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 @@ -3,3 +3,3 @@ 1 PRIMARY table2 NULL ref col_int_key col_int_key 5 test.table1.pk 2 100.00 Using where -2 DEPENDENT SUBQUERY subquery1_t2 NULL ALL PRIMARY,col_int_key NULL NULL NULL 20 33.33 Range checked for each record (index map: 0x3) +2 DEPENDENT SUBQUERY subquery1_t2 NULL ALL PRIMARY,col_int_key NULL NULL NULL 20 100.00 Range checked for each record (index map: 0x3) 2 DEPENDENT SUBQUERY subquery1_t1 NULL index col_int_key col_varchar_key 9 NULL 20 100.00 Using where; Using index; Using join buffer (Block Nested Loop) 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 @@ -3,3 +3,3 @@ 1 PRIMARY alias2 NULL ALL NULL NULL NULL NULL 20 10.00 Using where; Using join buffer (Block Nested Loop) -1 PRIMARY sq1_alias2 NULL ALL NULL NULL NULL NULL 20 33.33 Using where; Using join buffer (Block Nested Loop) +1 PRIMARY sq1_alias2 NULL ALL NULL NULL NULL NULL 20 100.00 Using where; Using join buffer (Block Nested Loop) 3 SUBQUERY sq2_alias1 NULL ALL NULL NULL NULL NULL 20 100.00 NULL 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: EQUAL 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: EQUAL 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: EQUAL 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: EQUAL 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: EQUAL 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: EQUAL 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: EQUAL