-- select query||';' from error e
--  where (msg ~~ 'ERROR:  failed to build any%')
--  and e.t > now() - interval '8 hours'
--  order by length(query) asc;

select  
  ref_0.collation_schema as c0
from 
  (select  
          sample_0.is_supported as c0
        from 
          information_schema.sql_packages as sample_0 tablesample system (0.8) 
        where 25 > 15
        fetch first 60 rows only) as subq_0
    right join information_schema.collations as ref_0
    on (subq_0.c0 = ref_0.collation_catalog ),
  lateral (select  
        ref_1.f2 as c0, 
        ref_1.f1 as c1, 
        ref_0.collation_name as c2, 
        ref_0.pad_attribute as c3, 
        subq_0.c0 as c4, 
        subq_0.c0 as c5, 
        subq_0.c0 as c6
      from 
        public.func_index_heap as ref_1
      where ref_1.f2 ~ ref_1.f1
      fetch first 170 rows only) as subq_1,
  lateral (select  
        sample_8.b as c0, 
        subq_1.c1 as c1, 
        sample_8.a as c2
      from 
        public.clstr_tst as sample_8 tablesample system (8.8) 
            left join public.f_star as sample_9 tablesample bernoulli (7.5) 
            on (sample_8.a = sample_9.aa )
          left join public.rules_log as sample_10 tablesample bernoulli (7) 
          on (sample_8.b = sample_10.f1 )
      where sample_10.tag <> sample_8.c
      fetch first 126 rows only) as subq_2
where (ref_0.collation_name is NULL) 
  or (subq_2.c1 !~ subq_2.c1)
fetch first 56 rows only;
select  
  subq_16.c4 as c0
from 
  public.rule_and_refint_t1 as sample_18 tablesample system (9.7) 
    left join (select  
            sample_20.xx as c0, 
            sample_20.xx as c1
          from 
            public.inhf as sample_20 tablesample bernoulli (1) 
          where sample_20.xx is not NULL) as subq_11
      inner join public.main_table as sample_25 tablesample system (1.2) 
        inner join (select  
              sample_26.b as c0, 
              subq_15.c1 as c1, 
              subq_15.c0 as c2, 
              32 as c3, 
              subq_15.c0 as c4
            from 
              public.dropcolumn as sample_26 tablesample system (7.6) ,
              lateral (select  
                    sample_27.t as c0, 
                    sample_26.b as c1
                  from 
                    public.radix_text_tbl as sample_27 tablesample system (4.6) 
                  where (sample_26.b is not NULL) 
                    and (sample_27.t ~~ sample_27.t)) as subq_15
            where subq_15.c0 !~ subq_15.c0) as subq_16
        on (sample_25.b = subq_16.c0 )
      on (subq_11.c0 = subq_16.c2 )
    on (sample_18.id1a = sample_25.a ),
  lateral (select  
        subq_16.c3 as c0, 
        subq_17.c1 as c1, 
        sample_18.id1a as c2, 
        coalesce(subq_16.c0, subq_16.c1) as c3
      from 
        public.rtest_vcomp as ref_21,
        lateral (select  
              sample_28.a as c0, 
              ref_21.size_in_cm as c1, 
              subq_11.c0 as c2, 
              sample_18.id1a as c3
            from 
              public.tab1 as sample_28 tablesample system (8.2) 
            where subq_11.c1 <= sample_28.b
            fetch first 111 rows only) as subq_17
      where ref_21.size_in_cm is NULL
      fetch first 101 rows only) as subq_18
where subq_11.c0 ~>=~ subq_11.c1
fetch first 94 rows only;
select  
  subq_33.c0 as c0, 
  subq_33.c0 as c1
from 
  (select  
            sample_95.y as c0, 
            sample_95.z as c1
          from 
            public.check2_tbl as sample_95 tablesample system (5.1) 
          where sample_95.y = sample_95.y) as subq_28
      right join pg_catalog.pg_user as ref_101
      on (subq_28.c0 = ref_101.passwd )
    left join pg_catalog.pg_opfamily as sample_96 tablesample bernoulli (9.8) 
    on (ref_101.usesysid = sample_96.opfmethod ),
  lateral (select  
        subq_31.c0 as c0, 
        sample_97.e as c1, 
        sample_97.e as c2
      from 
        public.dropcolumnchild as sample_97 tablesample system (2.4) ,
        lateral (select  
              subq_30.c0 as c0
            from 
              public.random_tbl as sample_98 tablesample system (8.4) ,
              lateral (select  
                    subq_28.c1 as c0, 
                    subq_28.c0 as c1, 
                    subq_28.c1 as c2, 
                    sample_97.e as c3
                  from 
                    public.undroppable_objs as ref_102
                  where sample_96.opfnamespace <= ref_101.usesysid
                  fetch first 76 rows only) as subq_29,
              lateral (select  
                    sample_96.opfmethod as c0
                  from 
                    public.inhf as sample_99 tablesample system (10) 
                  where sample_96.opfname ~~ subq_28.c0) as subq_30
            where sample_96.opfnamespace = sample_96.opfnamespace
            fetch first 111 rows only) as subq_31
      where subq_31.c0 <= subq_31.c0
      fetch first 100 rows only) as subq_32,
  lateral (select  
        sample_100.srvfdw as c0
      from 
        pg_catalog.pg_foreign_server as sample_100 tablesample bernoulli (0.7) 
      where (sample_96.opfowner >= subq_32.c0) 
        and (subq_32.c0 <= sample_96.opfmethod)
      fetch first 117 rows only) as subq_33
where subq_33.c0 <= sample_96.opfowner;
select  
  subq_11.c0 as c0
from 
  (select  
            sample_23.srvversion as c0, 
            sample_23.srvfdw as c1
          from 
            pg_catalog.pg_foreign_server as sample_23 tablesample bernoulli (9.5) 
          where sample_23.srvowner <= sample_23.srvfdw) as subq_11
      right join (select  
            sample_24.f as c0, 
            sample_24.e as c1, 
            sample_24.ee as c2, 
            sample_24.cc as c3, 
            sample_24.a as c4, 
            sample_24.class as c5
          from 
            public.f_star as sample_24 tablesample system (4.8) 
          where sample_24.a ~<~ sample_24.a) as subq_12
      on (subq_11.c0 = subq_12.c4 )
    left join public.rtest_admin as ref_27
      inner join (select  
              subq_17.c0 as c0, 
              subq_17.c0 as c1, 
              subq_17.c0 as c2
            from 
              public.customer as ref_34,
              lateral (select  
                    ref_35.passwd as c0
                  from 
                    pg_catalog.pg_user as ref_35
                  where true) as subq_17
            where (((subq_17.c0 ~* ref_34.tel) 
                  or (((subq_17.c0 @@ subq_17.c0) 
                      or (subq_17.c0 ~>~ ref_34.passwd)) 
                    or (subq_17.c0 >= subq_17.c0))) 
                and (((ref_34.cid is not NULL) 
                    or (ref_34.tel is NULL)) 
                  or (subq_17.c0 ~<~ subq_17.c0))) 
              or (ref_34.passwd ~<~ subq_17.c0)) as subq_18
        inner join public.room as ref_36
        on (subq_18.c2 = ref_36.comment )
      on (ref_27.pname = ref_36.comment )
    on (subq_11.c0 = ref_36.comment ),
  lateral (select  
        ref_36.roomno as c0, 
        19 as c1, 
        subq_18.c0 as c2
      from 
        public.clstr_tst_s as sample_36 tablesample bernoulli (7.9) 
      where true
      fetch first 81 rows only) as subq_19
where ref_36.comment ~>~ subq_12.c4
fetch first 154 rows only;
select  
  subq_6.c1 as c0, 
  subq_0.c0 as c1, 
  sample_0.tmplinit as c2
from 
  pg_catalog.pg_ts_template as sample_0 tablesample system (5.1) 
    left join (select  
            ref_0.tgconstrrelid as c0
          from 
            pg_catalog.pg_trigger as ref_0
          where (ref_0.tgname < ref_0.tgname) 
            and (ref_0.tgtype is NULL)
          fetch first 49 rows only) as subq_0
      right join (select  
              subq_5.c9 as c0, 
              4 as c1
            from 
              public.abstime_tbl as sample_23 tablesample bernoulli (3.8) ,
              lateral (select  
                    sample_24.a as c0, 
                    sample_24.a as c1, 
                    sample_23.f1 as c2, 
                    sample_23.f1 as c3, 
                    sample_24.a as c4, 
                    sample_24.b as c5, 
                    sample_24.a as c6, 
                    sample_24.a as c7, 
                    sample_24.b as c8, 
                    sample_23.f1 as c9, 
                    sample_23.f1 as c10, 
                    sample_23.f1 as c11, 
                    sample_23.f1 as c12, 
                    sample_23.f1 as c13, 
                    sample_24.a as c14, 
                    sample_24.a as c15
                  from 
                    testxmlschema.test1 as sample_24 tablesample system (9.4) 
                  where sample_23.f1 <> sample_23.f1) as subq_5
            where sample_23.f1 <= sample_23.f1) as subq_6
        inner join (select  
              sample_25.collowner as c0, 
              sample_25.collowner as c1, 
              sample_25.collctype as c2, 
              42 as c3, 
              sample_25.collctype as c4, 
              sample_25.collnamespace as c5
            from 
              pg_catalog.pg_collation as sample_25 tablesample bernoulli (8.5) 
            where (false) 
              or (sample_25.collname = sample_25.collctype)
            fetch first 72 rows only) as subq_7
        on (subq_6.c1 = subq_7.c3 )
      on (subq_0.c0 = subq_7.c0 )
    on (sample_0.tmplnamespace = subq_0.c0 ),
  lateral (select  
        subq_7.c2 as c0, 
        subq_6.c1 as c1
      from 
        information_schema.sql_packages as sample_26 tablesample system (1.2) 
      where ((subq_0.c0 = subq_0.c0) 
          and (subq_6.c1 <= 28)) 
        and (subq_0.c0 = coalesce(subq_7.c5, subq_7.c0))
      fetch first 101 rows only) as subq_8
where sample_0.tmplnamespace >= subq_0.c0
fetch first 30 rows only;
select  
  ref_109.name as c0, 
  ref_109.passwd as c1
from 
  (select  
            subq_30.c2 as c0, 
            ref_94.character_set_schema as c1
          from 
            information_schema.collation_character_set_applicability as ref_94,
            lateral (select  
                  ref_94.character_set_name as c0, 
                  ref_95.a as c1, 
                  ref_95.b as c2
                from 
                  public.rtest_t9 as ref_95
                where ref_95.b ~* ref_95.b
                fetch first 122 rows only) as subq_30
          where subq_30.c2 !~* subq_30.c2) as subq_31
      inner join public.tenk2 as sample_106 tablesample system (5.4) 
        right join public.my_property_secure as ref_109
        on (sample_106.odd = ref_109.cid )
      on (subq_31.c0 = ref_109.name )
    right join public.array_op_test as sample_107 tablesample bernoulli (4.8) 
    on (sample_106.twenty = sample_107.seqno ),
  lateral (select  
        ref_110.x as c0, 
        subq_31.c1 as c1, 
        subq_31.c1 as c2, 
        subq_32.c0 as c3, 
        sample_107.i as c4
      from 
        public.tt1 as ref_110,
        lateral (select  
              sample_107.seqno as c0
            from 
              public.path_tbl as sample_108 tablesample bernoulli (2.7) 
            where subq_31.c0 !~~* ref_109.tel
            fetch first 134 rows only) as subq_32
      where (subq_31.c0 !~* subq_31.c0) 
        and (EXISTS (
          select  
              ref_111.sh_avail as c0
            from 
              public.shoe_data as ref_111
            where 7 <= 38
            fetch first 109 rows only))
      fetch first 130 rows only) as subq_33,
  lateral (select  
        8 as c0, 
        subq_34.c0 as c1, 
        sample_107.seqno as c2, 
        ref_112.roomno as c3
      from 
        public.room as ref_112,
        lateral (select  
              subq_31.c1 as c0
            from 
              pg_catalog.pg_attribute as ref_113
            where subq_31.c0 @@ ref_109.name) as subq_34,
        lateral (select  
              subq_33.c2 as c0, 
              sample_109.f2 as c1, 
              subq_31.c0 as c2, 
              sample_106.tenthous as c3
            from 
              public.rules_src as sample_109 tablesample system (3.2) 
            where ref_112.comment < ref_109.tel
            fetch first 40 rows only) as subq_35
      where sample_107.i is NULL
      fetch first 110 rows only) as subq_36
where subq_31.c0 is not NULL
fetch first 36 rows only;
select  
  sample_180.condeferred as c0, 
  subq_46.c4 as c1, 
  subq_46.c3 as c2
from 
  (select  
          ref_158.id as c0
        from 
          public.dupindexcols as ref_158
        where (EXISTS (
            select  
                ref_159.p as c0, 
                subq_39.c2 as c1, 
                subq_39.c0 as c2
              from 
                public.gist_point_tbl as ref_159,
                lateral (select  
                      ref_159.id as c0, 
                      ref_160.factor as c1, 
                      ref_160.factor as c2
                    from 
                      public.rtest_unitfact as ref_160
                    where (ref_159.p ~= ref_159.p) 
                      and ((ref_160.factor is NULL) 
                        and (EXISTS (
                          select  
                              ref_161.blks_hit as c0, 
                              ref_161.relid as c1, 
                              ref_161.schemaname as c2
                            from 
                              pg_catalog.pg_statio_sys_sequences as ref_161
                            where ref_161.relname < ref_161.schemaname)))) as subq_39
              where EXISTS (
                select  
                    sample_154.x as c0, 
                    sample_154.x as c1, 
                    sample_154.y as c2, 
                    sample_154.x as c3, 
                    sample_154.y as c4, 
                    sample_154.x as c5
                  from 
                    public.tt0 as sample_154 tablesample system (9.6) 
                  where 5 <> 24
                  fetch first 63 rows only))) 
          and (ref_158.f1 @@ ref_158.f1)
        fetch first 163 rows only) as subq_40
    inner join (select  
            subq_45.c0 as c0, 
            26 as c1, 
            subq_45.c0 as c2, 
            sample_179.i2 as c3, 
            subq_45.c0 as c4, 
            sample_179.i2 as c5
          from 
            public.defaultexpr_tbl as sample_179 tablesample bernoulli (3.1) ,
            lateral (select  
                  ref_191.t as c0
                from 
                  public.btree_tall_tbl as ref_191
                where ref_191.id is NULL
                fetch first 62 rows only) as subq_45
          where subq_45.c0 is NULL) as subq_46
      right join pg_catalog.pg_constraint as sample_180 tablesample bernoulli (9.5) 
      on (subq_46.c4 = sample_180.consrc )
    on (subq_40.c0 = subq_46.c3 ),
  lateral (select  
        sample_181.comments as c0, 
        sample_180.conffeqop as c1, 
        sample_181.feature_name as c2, 
        subq_40.c0 as c3, 
        subq_46.c2 as c4
      from 
        information_schema.sql_packages as sample_181 tablesample system (9) 
      where (subq_46.c2 ~>=~ subq_46.c2) 
        and (subq_46.c1 > 9)
      fetch first 100 rows only) as subq_47
where sample_180.consrc !~~ subq_46.c4
fetch first 87 rows only;
select  
  subq_7.c0 as c0, 
  subq_7.c1 as c1, 
  subq_2.c1 as c2, 
  subq_7.c0 as c3
from 
  (select  
          coalesce(sample_2.b, sample_2.b) as c0, 
          sample_2.b as c1
        from 
          public.dropcolumn as sample_2 tablesample system (0.8) 
        where 35 < 14) as subq_2
    inner join (select  
          subq_3.c0 as c0, 
          ref_4.action_reference_old_row as c1
        from 
          public.a as ref_3
            right join information_schema.triggers as ref_4
            on (ref_3.aa = ref_4.action_order ),
          lateral (select  
                ref_3.aa as c0, 
                ref_5.xx as c1, 
                ref_5.xx as c2
              from 
                public.inhf as ref_5
              where false
              fetch first 80 rows only) as subq_3,
          lateral (select  
                subq_3.c0 as c0, 
                subq_3.c2 as c1
              from 
                information_schema.udt_privileges as ref_6,
                lateral (select  
                      ref_6.privilege_type as c0, 
                      ref_4.event_object_catalog as c1, 
                      ref_7.foreign_data_wrapper_name as c2
                    from 
                      information_schema.foreign_servers as ref_7,
                      lateral (select  
                            sample_3.a as c0
                          from 
                            public.rewritemetoo1 as sample_3 tablesample system (1.3) 
                          where sample_3.a > subq_3.c2) as subq_4
                    where (subq_4.c0 = subq_4.c0) 
                      or (subq_4.c0 <= subq_4.c0)
                    fetch first 90 rows only) as subq_5
              where (subq_3.c1 ~<=~ subq_3.c2) 
                and (subq_3.c2 ~~* subq_3.c2)
              fetch first 83 rows only) as subq_6
        where (ref_4.event_manipulation is not NULL) 
          or (((subq_6.c1 is not NULL) 
              or (false)) 
            or (subq_6.c1 >= subq_6.c1))) as subq_7
    on (subq_2.c0 = subq_7.c0 ),
  lateral (select  
        subq_2.c0 as c0, 
        subq_11.c1 as c1
      from 
        public.int8_tbl as sample_4 tablesample bernoulli (7.3) ,
        lateral (select  
              subq_10.c1 as c0, 
              subq_9.c0 as c1, 
              subq_2.c0 as c2
            from 
              information_schema.column_domain_usage as ref_8,
              lateral (select  
                    sample_5.x as c0
                  from 
                    public.tt6 as sample_5 tablesample system (8.1) ,
                    lateral (select  
                          subq_2.c0 as c0
                        from 
                          public.rule_and_refint_t1 as ref_9
                        where ref_9.id1a is not NULL
                        fetch first 146 rows only) as subq_8
                  where sample_4.q1 is NULL
                  fetch first 150 rows only) as subq_9,
              lateral (select  
                    ref_8.domain_schema as c0, 
                    subq_7.c1 as c1
                  from 
                    information_schema.sql_sizing_profiles as sample_6 tablesample system (5.8) 
                  where (39 <= 24) 
                    and ((18 <= 12) 
                      and ((((((sample_6.sizing_name is NULL) 
                                or (11 > 32)) 
                              and (33 <= 19)) 
                            or ((subq_2.c1 is NULL) 
                              or (subq_9.c0 is not NULL))) 
                          or (6 <> 42)) 
                        and (22 > 35)))) as subq_10
            where subq_7.c1 is not NULL
            fetch first 41 rows only) as subq_11
      where 17 <> 22) as subq_12
where subq_12.c0 is NULL
fetch first 37 rows only;
select  
  subq_32.c0 as c0, 
  subq_32.c0 as c1
from 
  public.num_exp_div as ref_135
    left join (select  
          ref_136.name as c0, 
          ref_136.prepare_time as c1, 
          ref_136.statement as c2, 
          subq_21.c6 as c3, 
          ref_136.from_sql as c4, 
          subq_21.c4 as c5
        from 
          pg_catalog.pg_prepared_statements as ref_136,
          lateral (select  
                ref_136.prepare_time as c0, 
                ref_136.statement as c1, 
                sample_110.f1 as c2, 
                33 as c3, 
                sample_110.f1 as c4, 
                sample_110.f1 as c5, 
                42 as c6, 
                sample_110.f1 as c7, 
                ref_136.parameter_types as c8
              from 
                public.check_con_tbl as sample_110 tablesample bernoulli (8.3) 
              where ref_136.name ~ ref_136.name) as subq_21
        where true) as subq_22
    on (ref_135.id2 = subq_22.c5 ),
  lateral (select  
        ref_138.slotlink as c0, 
        subq_22.c5 as c1, 
        sample_112.a as c2
      from 
        public.phone as ref_138
          right join testxmlschema.test1 as sample_112 tablesample bernoulli (9.9) 
          on (ref_138.comment = sample_112.b ),
        lateral (select  
              ref_138.comment as c0, 
              ref_138.comment as c1
            from 
              public.ihighway as sample_113 tablesample system (8.3) 
            where ((sample_113.name ~<~ sample_113.name) 
                or (ref_138.comment ~>=~ ref_138.comment)) 
              and (ref_138.comment ~<~ sample_113.name)) as subq_23
      where true) as subq_24,
  lateral (select  
        subq_22.c3 as c0, 
        subq_22.c0 as c1, 
        ref_139.name as c2, 
        subq_22.c0 as c3, 
        25 as c4, 
        ref_135.id2 as c5
      from 
        public.street as ref_139
      where (((subq_22.c3 > subq_22.c3) 
            or (subq_22.c2 ~~* ref_139.name)) 
          and (ref_139.name ~ ref_139.name)) 
        or (ref_139.name ~* ref_139.cname)
      fetch first 83 rows only) as subq_25,
  lateral (select  
        ref_135.id1 as c0
      from 
        public.ruletest_tbl as ref_144
          inner join public.domcontest as sample_116 tablesample system (5.2) 
          on (ref_144.a = sample_116.col1 ),
        lateral (select  
              ref_145.foreign_data_wrapper_catalog as c0, 
              subq_25.c0 as c1, 
              ref_145.option_name as c2
            from 
              information_schema.foreign_data_wrapper_options as ref_145
            where ((subq_22.c3 >= subq_22.c3) 
                or (subq_25.c3 ~<~ subq_25.c3)) 
              and (EXISTS (
                select  
                    sample_117.w as c0, 
                    sample_117.d as c1, 
                    sample_117.w as c2, 
                    sample_117.d as c3, 
                    sample_117.d as c4, 
                    sample_117.d as c5, 
                    sample_117.w as c6
                  from 
                    public.renamecolumn as sample_117 tablesample system (7.1) 
                  where 1 <> 38
                  fetch first 92 rows only))
            fetch first 124 rows only) as subq_27,
        lateral (select  
              subq_24.c1 as c0
            from 
              public.ec2 as ref_146
            where subq_22.c3 <> subq_27.c1) as subq_28,
        lateral (select  
              sample_116.col1 as c0, 
              ref_144.a as c1
            from 
              public.rtest_unitfact as ref_147,
              lateral (select  
                    sample_116.col1 as c0
                  from 
                    public.rtest_t7 as sample_118 tablesample system (2.5) ,
                    lateral (select  
                          subq_24.c2 as c0, 
                          sample_116.col1 as c1, 
                          subq_22.c0 as c2
                        from 
                          information_schema.sql_sizing_profiles as sample_119 tablesample system (6.2) 
                        where subq_22.c2 ~>~ sample_118.b
                        fetch first 116 rows only) as subq_29
                  where 35 <= subq_25.c4) as subq_30
            where subq_22.c0 ~* subq_25.c2
            fetch first 21 rows only) as subq_31
      where subq_22.c0 < subq_22.c2
      fetch first 71 rows only) as subq_32
where subq_22.c2 <> subq_22.c0;
