ERROR: failed to build any 8-way joins

From: Mario Weilguni <mweilguni(at)sime(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: ERROR: failed to build any 8-way joins
Date: 2007-02-15 14:28:23
Message-ID: 200702151528.23668.mweilguni@sime.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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_applikationen where code in ('app1', 'app2'))
and gba.ben_id = 100)
and (bei.bei_id_frei is null or 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 to find 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2007-02-15 14:54:14 Re: Plan for compressed varlena headers
Previous Message Alvaro Herrera 2007-02-15 13:55:35 Re: patch adding new regexp functions