ERROR: failed to build any 8-way joins - Mailing list pgsql-hackers

From Mario Weilguni
Subject ERROR: failed to build any 8-way joins
Date
Msg-id 200702151528.23668.mweilguni@sime.com
Whole thread Raw
In response to Re: Variable length varlena headers redux  (elein <elein@varlena.com>)
Responses Re: ERROR: failed to build any 8-way joins
Re: ERROR: failed to build any 8-way joins
List pgsql-hackers
Interesting problem, seems to be planer related:
select 1  from beitraege bei,       b_zuordnungen bz,          (select bei_id             from b_zuordnungen bz,
         ben_zuordnungen z,                  strukturelemente se            where se.id = z.str_id              and
se.sty_id= (select id from strukturtypen where code='GEO')              and z.str_id = bz.str_id              and
z.ben_id= 100           union            select id from beitraege where kz_edit <> 'N' and useraend = 100          ) as
foo where bz.bei_id = bei.id             and foo.bei_id = bei.id       and bei.red_id in (select gba.grp_id
      from grp_ben_applikationen gba,                         grp_gruppen grp                   where grp.id =
gba.grp_id                    and grp.kz_aktiv='J'                     and gba.app_id in (select id from
grp_applikationenwhere code in ('app1', 'app2'))                      and gba.ben_id = 100)    and (bei.bei_id_frei is
nullor bei.kz_edit='N')       and (bei.bt_id, bz.str_id) in ((96,1259036), (96,2688382) )       and bei.red_id=1777712
    and bei.id in (                             select bzu.bei_id                               from b_zuordnungen bzu,
                                  strukturelemente se                              where bzu.str_id = se.id
                  and se.id = 1773715           )        and bei.id=10157309;
 
ERROR:  failed to build any 8-way joins

Interesting: remove any of the above where conditions solves  the problem go away, e.g. removing "and
bei.id=10157309".

Testet with 8.2.1 and 8.1.4, same effect on both systems. Because of the large number of tables involved it's difficult
tofind a self contained patch, but if necessary I'll give it a try.
 
I could give 8.2.3 a try, but I doubt this will help. 

Any ideas?

Regards
Mario Weilguni


pgsql-hackers by date:

Previous
From: Hideyuki Kawashima
Date:
Subject: Re: Acclerating INSERT/UPDATE using UPS
Next
From: Gregory Stark
Date:
Subject: Re: Plan for compressed varlena headers