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 8F505D1CCB6 for ; Mon, 26 Jan 2004 17:18:18 +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 47789-08 for ; Mon, 26 Jan 2004 13:17:47 -0400 (AST) Received: from internet.potentialtech.com (h-66-167-251-6.PHLAPAFG.covad.net [66.167.251.6]) by svr1.postgresql.org (Postfix) with ESMTP id 7D231D1BA8B for ; Mon, 26 Jan 2004 13:17:45 -0400 (AST) Received: from potentialtech.com (pa-plum-cmts1e-68-68-113-33.pittpa.adelphia.net [68.68.113.33]) by internet.potentialtech.com (Postfix) with ESMTP id BF7F169A64; Mon, 26 Jan 2004 12:17:44 -0500 (EST) Message-ID: <40154BB5.1010700@potentialtech.com> Date: Mon, 26 Jan 2004 12:17:41 -0500 From: Bill Moran User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20031005 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: pgsql-performance@postgresql.org Subject: Re: On the performance of views References: <40152FF2.8000007@potentialtech.com> <8197.1075135417@sss.pgh.pa.us> In-Reply-To: <8197.1075135417@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/274 X-Sequence-Number: 5448 Tom Lane wrote: > 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. Well, I don't see a huge difference in how the application will be built. Basically, PQexec calls will have a string like "SELECT * FROM view_name WHERE prikey=%i" instead of "SELECT * FROM function_name(%i)" ... which really doesn't make life much more difficult (unless there's something I'm missing?) Thanks for the input, Tom. I'll definately try out views where possible to see if it improves things. -- Bill Moran Potential Technologies http://www.potentialtech.com