select case when (select max_latency from sys.x$waits_by_user_by_latency limit 1 offset 3) is NULL then subq_2.c8 else subq_2.c8 end as c0 from mytest.test10 as ref_0 inner join mytest.test73 as ref_1 on (EXISTS ( select ref_2.column1 as c0, 8 as c1, ref_1.column48 as c2 from mytest.test44 as ref_2 where false limit 103)) right join mytest.test68 as ref_3 on ((ref_3.column1 is not NULL) or ((ref_0.column2 is NULL) and (true))) right join (select ref_4.column2 as c0, ref_4.column1 as c1 from mytest.test115 as ref_4 where ref_4.column3 is not NULL limit 141) as subq_0 on (EXISTS ( select ref_0.column1 as c0, ref_5.column1 as c1, subq_0.c1 as c2 from mytest.test42 as ref_5, lateral (select ref_1.column48 as c0, 69 as c1, ref_6.column4 as c2 from mytest.test1 as ref_6 where false limit 85) as subq_1 where (false) or (((true) or (subq_1.c1 is NULL)) or ((((true) and (true)) and (false)) or (((true) or (true)) and ((subq_1.c1 is NULL) or (false))))) limit 79)) right join mytest.test5 as ref_7 left join (select ref_8.column2 as c0, ref_8.column7 as c1, ref_8.column4 as c2, ref_8.column7 as c3, ref_8.column3 as c4, ref_8.column4 as c5, ref_8.column4 as c6, ref_8.column2 as c7, ref_8.column8 as c8, ref_8.column3 as c9, ref_8.column2 as c10, ref_8.column3 as c11 from mytest.test91 as ref_8 where false limit 40) as subq_2 on ((ref_7.column2 is not NULL) and (EXISTS ( select subq_2.c10 as c0, ref_7.column2 as c1, ref_9.column2 as c2, 57 as c3 from mytest.test13 as ref_9 where subq_2.c8 is NULL limit 69))) on (subq_0.c1 = ref_7.column3 ) where ((((subq_2.c10 is NULL) or (false)) and ((ref_0.column4 is NULL) or (true))) or ((((ref_3.column1 is NULL) and (EXISTS ( select ref_3.column2 as c0, subq_0.c0 as c1, ref_7.column3 as c2, ref_0.column2 as c3, (select ATTR_VALUE from performance_schema.session_connect_attrs limit 1 offset 3) as c4 from mytest.test72 as ref_18 where false limit 58))) and ((((EXISTS ( select subq_0.c1 as c0, ref_3.column1 as c1, subq_2.c8 as c2 from mytest.test115 as ref_19 where ref_7.column6 is NULL limit 97)) and (((false) or (true)) and (false))) or ((subq_2.c9 is NULL) or ((true) and (true)))) or ((true) or ((((false) and ((EXISTS ( select subq_2.c9 as c0, ref_3.column1 as c1 from mytest.test102 as ref_20 where false limit 36)) and (((((EXISTS ( select ref_3.column1 as c0, ref_7.column6 as c1, subq_0.c1 as c2, (select NAME from information_schema.INNODB_TABLES limit 1 offset 4) as c3, ref_7.column4 as c4, ref_7.column6 as c5, subq_2.c8 as c6, subq_0.c0 as c7 from mytest.test74 as ref_21 where (false) and (((subq_0.c1 is NULL) and ((EXISTS ( select ref_7.column6 as c0, 9 as c1, ref_7.column4 as c2, 44 as c3, ref_22.column3 as c4, (select total_allocated from sys.memory_global_total limit 1 offset 3) as c5 from mytest.test79 as ref_22 where (true) and ((true) and (true)))) or (true))) and (false)) limit 73)) or (false)) or (false)) and (ref_7.column1 is not NULL)) or (false)))) and (true)) and ((true) or ((true) and (false))))))) and (((ref_0.column2 is NULL) or ((EXISTS ( select ref_0.column3 as c0, ref_23.column38 as c1, ref_7.column3 as c2, ref_1.column68 as c3, ref_23.column75 as c4, ref_1.column40 as c5 from mytest.test55 as ref_23 where true limit 94)) and (ref_7.column1 is not NULL))) and (EXISTS ( select ref_24.column6 as c0, ref_7.column2 as c1, ref_1.column40 as c2, ref_3.column1 as c3, ref_3.column1 as c4 from mytest.test123 as ref_24 left join mytest.test98 as ref_25 on (ref_24.column3 = ref_25.column2 ) where (subq_0.c0 is not NULL) and (ref_25.column4 is NULL) limit 79))))) or (ref_0.column4 is NULL);