delete from t1
where (((case when ((t1.vkey in (    
      select 1 
      from 
        ((t2 as ref_2 cross join t6 as ref_3)
          cross join (t2 as ref_4
            right outer join t6 as ref_5
            on (ref_4.vkey = ref_5.vkey)))
      where (case when ((ref_5.c26 in (
          select ref_5.vkey
                 as c_0
          from 
            t6 as ref_6
          where ((case when (((exists (
                select  
                    pg_catalog.stddev_pop(ref_3.c29) over w0 as c_0, 
                    ref_21.c32 as c_1
                  from 
                    t6 as ref_21
                  window w0 as (partition by ref_4.c7 order by t1.vkey asc, t1.pkey asc, t1.c4 desc, t1.c5 asc, ref_2.vkey desc, ref_2.pkey desc, ref_2.c6 asc, ref_2.c7 asc, ref_2.c8 desc, ref_2.c9 desc, ref_2.c10 asc, ref_2.c11 asc, ref_2.c12 asc, ref_2.c13 desc, ref_2.c14 asc, ref_3.vkey asc, ref_3.pkey desc, ref_3.c26 asc, ref_3.c27 desc, ref_3.c28 asc, ref_3.c29 asc, ref_3.c30 asc, ref_3.c31 asc, ref_3.c32 asc, ref_3.c33 asc, ref_3.c34 asc, ref_4.vkey asc, ref_4.pkey desc, ref_4.c6 asc, ref_4.c7 desc, ref_4.c8 desc, ref_4.c9 desc, ref_4.c10 asc, ref_4.c11 asc, ref_4.c12 asc, ref_4.c13 asc, ref_4.c14 desc, ref_5.vkey asc, ref_5.pkey desc, ref_5.c26 asc, ref_5.c27 desc, ref_5.c28 asc, ref_5.c29 desc, ref_5.c30 desc, ref_5.c31 asc, ref_5.c32 desc, ref_5.c33 desc, ref_5.c34 desc, ref_6.vkey asc, ref_6.pkey desc, ref_6.c26 asc, ref_6.c27 asc, ref_6.c28 asc, ref_6.c29 asc, ref_6.c30 asc, ref_6.c31 asc, ref_6.c32 asc, ref_6.c33 desc, ref_6.c34 asc, ref_21.vkey asc, ref_21.pkey asc, ref_21.c26 desc, ref_21.c27 asc, ref_21.c28 desc, ref_21.c29 asc, ref_21.c30 asc, ref_21.c31 desc, ref_21.c32 desc, ref_21.c33 desc, ref_21.c34 asc))) 
                and (not (exists (
                select  
                    pg_catalog.stddev_pop(ref_3.c29) over w0 as c_0, 
                    ref_21.c32 as c_1
                  from 
                    t6 as ref_21
                  window w0 as (partition by ref_4.c7 order by t1.vkey asc, t1.pkey asc, t1.c4 desc, t1.c5 asc, ref_2.vkey desc, ref_2.pkey desc, ref_2.c6 asc, ref_2.c7 asc, ref_2.c8 desc, ref_2.c9 desc, ref_2.c10 asc, ref_2.c11 asc, ref_2.c12 asc, ref_2.c13 desc, ref_2.c14 asc, ref_3.vkey asc, ref_3.pkey desc, ref_3.c26 asc, ref_3.c27 desc, ref_3.c28 asc, ref_3.c29 asc, ref_3.c30 asc, ref_3.c31 asc, ref_3.c32 asc, ref_3.c33 asc, ref_3.c34 asc, ref_4.vkey asc, ref_4.pkey desc, ref_4.c6 asc, ref_4.c7 desc, ref_4.c8 desc, ref_4.c9 desc, ref_4.c10 asc, ref_4.c11 asc, ref_4.c12 asc, ref_4.c13 asc, ref_4.c14 desc, ref_5.vkey asc, ref_5.pkey desc, ref_5.c26 asc, ref_5.c27 desc, ref_5.c28 asc, ref_5.c29 desc, ref_5.c30 desc, ref_5.c31 asc, ref_5.c32 desc, ref_5.c33 desc, ref_5.c34 desc, ref_6.vkey asc, ref_6.pkey desc, ref_6.c26 asc, ref_6.c27 asc, ref_6.c28 asc, ref_6.c29 asc, ref_6.c30 asc, ref_6.c31 asc, ref_6.c32 asc, ref_6.c33 desc, ref_6.c34 asc, ref_21.vkey asc, ref_21.pkey asc, ref_21.c26 desc, ref_21.c27 asc, ref_21.c28 desc, ref_21.c29 asc, ref_21.c30 asc, ref_21.c31 desc, ref_21.c32 desc, ref_21.c33 desc, ref_21.c34 asc))))) 
                and ((exists (
                select
                    pg_catalog.stddev_pop(ref_3.c29) over w0 as c_0,
                    ref_21.c32 as c_1
                  from
                    t6 as ref_21
                  window w0 as (partition by ref_4.c7 order by t1.vkey asc, t1.pkey asc, t1.c4 desc, t1.c5 asc, ref_2.vkey desc, ref_2.pkey desc, ref_2.c6 asc, ref_2.c7 asc, ref_2.c8 desc, ref_2.c9 desc, ref_2.c10 asc, ref_2.c11 asc, ref_2.c12 asc, ref_2.c13 desc, ref_2.c14 asc, ref_3.vkey asc, ref_3.pkey desc, ref_3.c26 asc, ref_3.c27 desc, ref_3.c28 asc, ref_3.c29 asc, ref_3.c30 asc, ref_3.c31 asc, ref_3.c32 asc, ref_3.c33 asc, ref_3.c34 asc, ref_4.vkey asc, ref_4.pkey desc, ref_4.c6 asc, ref_4.c7 desc, ref_4.c8 desc, ref_4.c9 desc, ref_4.c10 asc, ref_4.c11 asc, ref_4.c12 asc, ref_4.c13 asc, ref_4.c14 desc, ref_5.vkey asc, ref_5.pkey desc, ref_5.c26 asc, ref_5.c27 desc, ref_5.c28 asc, ref_5.c29 desc, ref_5.c30 desc, ref_5.c31 asc, ref_5.c32 desc, ref_5.c33 desc, ref_5.c34 desc, ref_6.vkey asc, ref_6.pkey desc, ref_6.c26 asc, ref_6.c27 asc, ref_6.c28 asc, ref_6.c29 asc, ref_6.c30 asc, ref_6.c31 asc, ref_6.c32 asc, ref_6.c33 desc, ref_6.c34 asc, ref_21.vkey asc, ref_21.pkey asc, ref_21.c26 desc, ref_21.c27 asc, ref_21.c28 desc, ref_21.c29 asc, ref_21.c30 asc, ref_21.c31 desc, ref_21.c32 desc, ref_21.c33 desc, ref_21.c34 asc))) is not null)
                ) then (ref_4.c10) else (ref_3.c27) end
                ) = ref_6.c32)
          order by c_0 asc)) is not null) then true else (null::bool) end
          ))) is not null) then true else (null::bool) end
    )));