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 ABDE99DD75F for ; Wed, 7 Dec 2005 23:21:02 -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 04049-09 for ; Wed, 7 Dec 2005 23:21:01 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from svr2.postgresql.org (svr2.postgresql.org [65.19.161.25]) by postgresql.org (Postfix) with ESMTP id 1C0AD9DD755 for ; Wed, 7 Dec 2005 23:01:38 -0400 (AST) Received: from mxsf07.cluster1.charter.net (mxsf07.cluster1.charter.net [209.225.28.207]) by svr2.postgresql.org (Postfix) with ESMTP id 646BFF0B52 for ; Thu, 8 Dec 2005 02:47:31 +0000 (GMT) Received: from mxip06a.cluster1.charter.net (mxip06a.cluster1.charter.net [209.225.28.136]) by mxsf07.cluster1.charter.net (8.12.11/8.12.11) with ESMTP id jB82lSSe004515 for ; Wed, 7 Dec 2005 21:47:28 -0500 Received: from 68-118-182-213.dhcp.nwtn.ct.charter.com (HELO [192.168.116.102]) ([68.118.182.213]) by mxip06a.cluster1.charter.net with ESMTP; 07 Dec 2005 21:47:28 -0500 X-IronPort-AV: i="3.99,227,1131339600"; d="scan'208"; a="1717985552:sNHT16281768" Message-ID: <43979EC0.1060400@NarrowPathInc.com> Date: Wed, 07 Dec 2005 21:47:28 -0500 From: Keith Worthington Reply-To: KeithW@NarrowPathInc.com Organization: Narrow Path, Inc. User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: PostgreSQL Perform Subject: view of view 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=1.11 required=5 tests=[AWL=-0.222, RCVD_IN_BL_SPAMCOP_NET=1.332] X-Spam-Score: 1.11 X-Spam-Level: * X-Archive-Number: 200512/237 X-Sequence-Number: 16058 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? -- Kind Regards, Keith