X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 0D70130F29E for ; Sat, 28 Jun 2003 06:03:15 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 24028-10 for ; Sat, 28 Jun 2003 03:03:04 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 4A71C30DCE3 for ; Sat, 28 Jun 2003 03:03:04 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h5S633QQ016132; Sat, 28 Jun 2003 02:03:03 -0400 (EDT) To: Ludwig Lim Cc: PostgreSQL Mailing List Subject: Re: Question on OUTER JOINS. In-reply-to: <20030628054547.40824.qmail@web80503.mail.yahoo.com> References: <20030628054547.40824.qmail@web80503.mail.yahoo.com> Comments: In-reply-to Ludwig Lim message dated "Fri, 27 Jun 2003 22:45:47 -0700" Date: Sat, 28 Jun 2003 02:03:03 -0400 Message-ID: <16131.1056780183@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200306/326 X-Sequence-Number: 14084 Ludwig Lim writes: > 1) Is the ON clause of an OUTER JOIN always > evaluated first before the WHERE clause? No; the planner will do whatever it thinks is the most efficient way (assuming it can prove that the reordering it wants to do won't change the query result). > Is there a way to rewrite the query as a view such > that one can do: I'm really not clear on what you want here. Better example please? regards, tom lane