dbTalk Databases Forums  

Re: [BUGS] ERROR: failed to build any 4-way joins

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss Re: [BUGS] ERROR: failed to build any 4-way joins in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] ERROR: failed to build any 4-way joins - 12-12-2006 , 01:40 PM






Teodor Sigaev <teodor (AT) sigaev (DOT) ru> writes:
Quote:
Test suite (as simple as I can produce):
Mmm, sweet :-(. There is only one legal way to form the outer join, but
make_rels_by_joins() doesn't try it because have_relevant_joinclause()
says there is no relevant joinclause ... as indeed there is not, the
"true = true" thing having been optimized away. I guess we need a hack
to treat empty outer join conditions specially.

Quote:
Sorry, versions are 8.2 & 8.3. 8.1 works well
Right, not a problem before 8.2 because outer join order was driven by
the syntax instead of by searching for a good join order. Also, you
need at least two base relations on each side of the outer join, else
the "last ditch" case in make_rels_by_joins() finds the join.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq


Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] ERROR: failed to build any 4-way joins - 12-12-2006 , 03:40 PM






I wrote:
Quote:
I guess we need a hack
to treat empty outer join conditions specially.
Actually, it can happen with non-empty join conditions too, if the join
condition doesn't mention the outer side; for instance, using your
example

explain SELECT * from fooview fv1
LEFT OUTER JOIN fooview fv2 on fv2.a_for_max_b < 10;

So my original thoughts of a narrow special case for "OUTER JOIN ON TRUE"
went up in smoke, and I ended up just having have_relevant_joinclause()
troll for relevant outer joins all the time. This probably isn't going
to cost enough planning time to matter, anyway.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster


Reply With Quote
  #3  
Old   
Teodor Sigaev
 
Posts: n/a

Default Re: [BUGS] ERROR: failed to build any 4-way joins - 12-13-2006 , 12:03 PM



Quote:
went up in smoke, and I ended up just having have_relevant_joinclause()
Thank you a lot, I was near around it

--
Teodor Sigaev E-mail: teodor (AT) sigaev (DOT) ru
WWW: http://www.sigaev.ru/

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.