Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 4980B476F33 for ; Wed, 22 Jan 2003 20:26:26 -0500 (EST) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 63BD7476ADB for ; Wed, 22 Jan 2003 19:52:26 -0500 (EST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 5FB52D616; Wed, 22 Jan 2003 16:52:29 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 411725C03; Wed, 22 Jan 2003 16:52:29 -0800 (PST) Date: Wed, 22 Jan 2003 16:52:29 -0800 (PST) From: Stephan Szabo To: Tomasz Myrta Cc: Subject: Re: To use a VIEW or not to use a View..... In-Reply-To: <3E2F130B.4030002@klaster.net> Message-ID: <20030122164520.O4204-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/349 X-Sequence-Number: 11214 On Wed, 22 Jan 2003, Tomasz Myrta wrote: > Stephan Szabo wrote: > > >That's not the same join for optimization purposes > >since postgresql treats explicit join syntax as a > >constraint on the ordering of joins. > > > >The same join would be something like: > > > >przystanki p1 join miasta m1 using (id_miasta) > >join (przystanki p2 join miasta m2 using (id_miasta)) > > using (id_przystanku) > > > >minus the fact I think you'd need some explicit naming in > >there. > > You are right. > > The result of your query is: > explain select * from > przystanki p1 join miasta m1 using (id_miasta) > join (przystanki p2 join miasta m2 using (id_miasta)) > using (id_przystanku) > where id_przystanku=1230 > > Hash Join (cost=13.00..30.10 rows=1 width=128) > -> Hash Join (cost=6.74..21.02 rows=374 width=64) > -> Seq Scan on przystanki p2 (cost=0.00..7.74 rows=374 width=41) > -> Hash (cost=5.99..5.99 rows=299 width=23) > -> Seq Scan on miasta m2 (cost=0.00..5.99 rows=299 width=23) > -> Hash (cost=6.26..6.26 rows=1 width=64) > -> Nested Loop (cost=0.00..6.26 rows=1 width=64) > -> Index Scan using przystanki_pkey on przystanki p1 (cost=0.00..3.14 rows=1 width=41) > -> Index Scan using miasta_pkey on miasta m1 (cost=0.00..3.10 rows=1 width=23) > > Anyway - is it possible to expose table "przystanki alias p2" to get valid result? I think it's possible that the work Tom mentioned in current CVS may make these cases work the way you want. I don't have access to my test machine to try it right now however. > Stephan - I have some problems with mail relay to you. > Does my mail server have any open-relay problem, or something like this (213.25.37.66) ? Doesn't seem to be a simple open relay (but I didn't try anything complicated). It acted a little wierd about email addresses in reacting to my telnet, but I think it was acting correctly as far as standards are concerned.