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 2DD6C9DCAD3 for ; Thu, 8 Dec 2005 09:46:47 -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 87261-05 for ; Thu, 8 Dec 2005 09:46:50 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from europa.cosmos.opusvl.com (europa.cosmos.opusvl.com [213.106.249.125]) by postgresql.org (Postfix) with ESMTP id 193A29DCAE0 for ; Thu, 8 Dec 2005 09:46:44 -0400 (AST) Received: from localhost.localdomain ([127.0.0.1]) by europa.cosmos.opusvl.com with esmtp (Exim 4.30) id 1EkM6f-00044R-N9; Thu, 08 Dec 2005 13:46:45 +0000 Message-ID: <43983945.9020706@opusvl.com> Date: Thu, 08 Dec 2005 13:46:45 +0000 From: Rich Doughty Organization: Opus VL User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: KeithW@NarrowPathInc.com CC: PostgreSQL Perform Subject: Re: view of view References: <43979EC0.1060400@NarrowPathInc.com> In-Reply-To: <43979EC0.1060400@NarrowPathInc.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.167 required=5 tests=[AWL=0.167] X-Spam-Score: 0.167 X-Spam-Level: X-Archive-Number: 200512/243 X-Sequence-Number: 16064 Keith Worthington wrote: > Hi All, > > I am working on an application that uses PostgreSQL. One of the > functions of the application is to generate reports. In order to keep > the code in the application simple we create a view of the required data > in the database and then simply execute a SELECT * FROM > view_of_the_data; All of the manipulation and most of the time even the > ordering is handled in the view. > > My question is how much if any performance degradation is there in > creating a view of a view? > > IOW if I have a view that ties together a couple of tables and > manipulates some data what will perform better; a view that filters, > manipulates, and orders the data from the first view or a view that > performs all the necessary calculations on the original tables? from personal experience, if the inner views contain outer joins performance isn't that great. -- - Rich Doughty