Re: failed to build any 5-way joins

From: "Alessandro Depase" <alessandro(dot)depase(at)libero(dot)it>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: failed to build any 5-way joins
Date: 2003-12-17 16:04:11
Message-ID: 003701c3c4b7$6952a8f0$0200a8c0@dedalus1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Thanks Tom, but I think I can wait, being possible to use the exists clause
and not having, at the moment a big database.
When there will be the less-drastic fix you refer to, I will use it and
change my query.

Thanks again.
Bye
Alessandro Depase

----- Original Message -----
From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Alessandro Depase" <alessandro(dot)depase(at)libero(dot)it>
Cc: <pgsql-sql(at)postgresql(dot)org>
Sent: Wednesday, December 17, 2003 4:32 PM
Subject: Re: [SQL] failed to build any 5-way joins

> "Alessandro Depase" <alessandro(dot)depase(at)libero(dot)it> writes:
> > select *
> > from info where parent_infoid is null=20
> > and fieldtypeid in (select fieldtypeid from users_auth_groups uag1,
field_a=
> > uth fa where userid =3D 8 and fa.groupid =3D uag1.groupid)=20
> > and main_infoid in (select ic.infoid from info_category ic,
category_auth c=
> > a, users_auth_groups uag2=20
> > where ic.categoryid =3D ca.categoryid and uag2.userid =3D 8 and
uag2.grou=
> > pid =3D ca.groupid and read_write =3D 'W')=20
>
> Hmm. It's right, there's no way to construct a sub-plan that joins just
> that number of relations, because of the constraint that the IN
> sub-selects have to be fully formed before we can do IN processing.
>
> A brute force solution is to just remove the error cross-check in
> src/backend/optimizer/path/joinrels.c:
>
> if (result_rels == NIL)
> elog(ERROR, "failed to build any %d-way joins", level);
>
> I'll probably install some less-drastic fix for 7.4.1, but if you need a
> solution right now, that will get you going.
>
> regards, tom lane
>
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message mohan 2003-12-17 18:58:17 migration between databases and versions
Previous Message Tom Lane 2003-12-17 15:32:23 Re: failed to build any 5-way joins