X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id C41549DC815 for ; Wed, 8 Feb 2006 11:37:35 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 70746-04 for ; Wed, 8 Feb 2006 11:37:39 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 128869DC82D for ; Wed, 8 Feb 2006 11:37:32 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id k18Fbb9J007894; Wed, 8 Feb 2006 10:37:38 -0500 (EST) To: Jacob Costello cc: pgsql-performance@postgresql.org Subject: Re: optimizing away join when querying view In-reply-to: <1139406891.11389.60.camel@localhost.localdomain> References: <1139406891.11389.60.camel@localhost.localdomain> Comments: In-reply-to Jacob Costello message dated "Wed, 08 Feb 2006 07:54:51 -0600" Date: Wed, 08 Feb 2006 10:37:37 -0500 Message-ID: <7893.1139413057@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.108 required=5 tests=[AWL=0.108] X-Spam-Score: 0.108 X-Spam-Level: X-Archive-Number: 200602/68 X-Sequence-Number: 17054 Jacob Costello writes: > Postgres doesn't seem to optimize away unnecessary joins There is no such thing as an unnecessary join, unless you are willing to stake the correctness of the query on constraints that could be dropped after the query is planned. Until we have some infrastructure to deal with that situation, nothing like this is going to happen. regards, tom lane