SET Session join_cache_level = 8;
select  
  subq_0.c0 as c0, 
  subq_0.c2 as c1, 
  subq_0.c2 as c2, 
  subq_0.c1 as c3
from 
  (select  
        ref_2.v6 as c0, 
        ref_8.v8 as c1, 
        ref_7.v31 as c2
      from 
        test.table60 as ref_0
                inner join test.table44 as ref_1
                on (ref_0.v0 = ref_1.v0 )
              inner join test.table7 as ref_2
              on (((((((EXISTS (
                              select  
                                  ref_3.v14 as c0, 
                                  ref_1.v0 as c1, 
                                  ref_2.v5 as c2, 
                                  ref_3.v30 as c3, 
                                  ref_2.v3 as c4, 
                                  ref_2.v0 as c5, 
                                  ref_1.v2 as c6, 
                                  ref_0.v33 as c7, 
                                  ref_3.v12 as c8
                                from 
                                  test.table60 as ref_3
                                where 0)) 
                            or (((0) 
                                or (ref_2.v7 is not NULL)) 
                              or ((1) 
                                and (0)))) 
                          or (1)) 
                        and (1)) 
                      and (1)) 
                    and (0)) 
                  and (ref_2.v2 is NULL))
            right join test.table38 as ref_4
            on (EXISTS (
                select  
                    ref_1.v2 as c0, 
                    ref_4.v0 as c1
                  from 
                    test.table19 as ref_5
                  where ref_5.v0 is NULL))
          left join test.table7 as ref_6
            right join test.table60 as ref_7
              inner join test.table6 as ref_8
              on (((((((ref_7.v15 is NULL) 
                            or (EXISTS (
                              select  
                                  ref_7.v3 as c0, 
                                  ref_9.v4 as c1, 
                                  (select v8 from test.table43)
                                     as c2, 
                                  ref_8.v3 as c3, 
                                  ref_9.v3 as c4, 
                                  ref_8.v1 as c5, 
                                  ref_7.v8 as c6, 
                                  ref_9.v7 as c7, 
                                  ref_8.v1 as c8
                                from 
                                  test.table43 as ref_9
                                where 1))) 
                          or (((EXISTS (
                                select  
                                    (select v9 from test.table69)
                                       as c0, 
                                    ref_10.v0 as c1
                                  from 
                                    test.table19 as ref_10
                                  where 0)) 
                              or (ref_8.v1 is NULL)) 
                            and (1))) 
                        or (1)) 
                      and (((0) 
                          or ((((EXISTS (
                                  select  
                                      71 as c0, 
                                      ref_7.v9 as c1, 
                                      ref_11.v16 as c2, 
                                      ref_7.v15 as c3, 
                                      ref_7.v10 as c4, 
                                      (select v3 from test.table12)
                                         as c5, 
                                      ref_7.v13 as c6, 
                                      ref_7.v7 as c7, 
                                      ref_7.v1 as c8
                                    from 
                                      test.table54 as ref_11
                                    where ((EXISTS (
                                          select  
                                              ref_11.v4 as c0
                                            from 
                                              test.table38 as ref_12
                                            where (0) 
                                              and (1))) 
                                        and ((0) 
                                          or (0))) 
                                      or ((1) 
                                        or ((0) 
                                          or (1))))) 
                                or (((((0) 
                                        and ((0) 
                                          and (ref_8.v4 is NULL))) 
                                      or (EXISTS (
                                        select  
                                            ref_8.v3 as c0, 
                                            ref_13.v71 as c1, 
                                            ref_8.v3 as c2, 
                                            61 as c3, 
                                            ref_7.v15 as c4, 
                                            (select v39 from test.table65)
                                               as c5, 
                                            ref_8.v2 as c6
                                          from 
                                            test.table65 as ref_13
                                          where 1))) 
                                    and (1)) 
                                  and (1))) 
                              or (((EXISTS (
                                    select  
                                        (select v19 from test.table60)
                                           as c0, 
                                        72 as c1, 
                                        ref_7.v19 as c2, 
                                        ref_8.v0 as c3, 
                                        (select v3 from test.table44)
                                           as c4, 
                                        ref_14.v4 as c5, 
                                        ref_8.v9 as c6
                                      from 
                                        test.table40 as ref_14
                                      where 0)) 
                                  and (((((ref_8.v8 is NULL) 
                                          or ((0) 
                                            or (((ref_8.v7 is NULL) 
                                                or (1)) 
                                              or ((0) 
                                                and (0))))) 
                                        or (ref_7.v15 is not NULL)) 
                                      and ((1) 
                                        and (0))) 
                                    and (ref_7.v1 is not NULL))) 
                                and (0))) 
                            or (ref_7.v30 is not NULL))) 
                        or (1))) 
                    and (EXISTS (
                      select distinct 
                          (select v0 from test.table19)
                             as c0
                        from 
                          test.table69 as ref_15
                        where ref_15.v37 is NULL))) 
                  and (ref_8.v7 is NULL))
            on (ref_6.v0 is not NULL)
          on (EXISTS (
              select  
                  3 as c0, 
                  ref_4.v0 as c1, 
                  ref_7.v36 as c2, 
                  ref_7.v13 as c3, 
                  ref_1.v0 as c4, 
                  ref_1.v1 as c5
                from 
                  test.table75 as ref_16
                where ref_1.v3 is not NULL))
      where coalesce(ref_6.v3,
          ref_2.v0) is NULL) as subq_0
where json_object() is not NULL
;

