Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 200A69F945C for ; Mon, 5 Nov 2007 12:08:19 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 21363-04 for ; Mon, 5 Nov 2007 12:08:06 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 7FB199F9457 for ; Mon, 5 Nov 2007 12:08:15 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id lA5G8DYl020750; Mon, 5 Nov 2007 11:08:13 -0500 (EST) To: Ehab Galal cc: "pgsql-sql@postgresql.org" Subject: Re: omitting redundant join predicate In-reply-to: References: <14450.1194194136@sss.pgh.pa.us> Comments: In-reply-to Ehab Galal message dated "Mon, 05 Nov 2007 10:15:36 -0500" Date: Mon, 05 Nov 2007 11:08:13 -0500 Message-ID: <20749.1194278893@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/17 X-Sequence-Number: 29545 Ehab Galal writes: > what i expected is that the optimizer will use the redundant predicates > to create the plan, but the execution plan itself will not execute a > redundant predicate. > O! I see, it's my mistake. The example i mentioned was not a good example. I tried the equality and it is working well :) The planner has a great deal more smarts about equality conditions than inequality conditions. There's more you can do with equalities, and it's more useful for typical queries. > I am using postgresql 8.5.1, I am wondering is there is any patch that > i can run to enable it to put the actual table names instead of > inner/outer. Update to 8.2. regards, tom lane