X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id DBEAFD1D34E for ; Mon, 26 Jan 2004 16:46:30 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 42028-03 for ; Mon, 26 Jan 2004 12:46:00 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 62182D1D278 for ; Mon, 26 Jan 2004 12:43:38 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id i0QGhbnX008198; Mon, 26 Jan 2004 11:43:37 -0500 (EST) To: Bill Moran Cc: pgsql-performance@postgresql.org Subject: Re: On the performance of views In-reply-to: <40152FF2.8000007@potentialtech.com> References: <40152FF2.8000007@potentialtech.com> Comments: In-reply-to Bill Moran message dated "Mon, 26 Jan 2004 10:19:14 -0500" Date: Mon, 26 Jan 2004 11:43:37 -0500 Message-ID: <8197.1075135417@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/272 X-Sequence-Number: 5446 Bill Moran writes: > At first I was going to just convert all MSSQL procedures to Postgres functions. > But now that I'm looking at it, a lot of them may be candidates for views. A > lot of them take on the format of: > SELECT a.cola, b.colb, c.colc > FROM a JOIN b JOIN c > WHERE a.prikey=$1 You'd probably be better off using views, if making that significant a notational change is feasible for you. Functions that return multiple columns are notationally messy in Postgres. A view-based solution would be more flexible and likely have better performance. regards, tom lane