pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bill Moran <wmoran@potentialtech.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org
Subject: Re: On the performance of views
Date: Mon, 26 Jan 2004 12:17:41 -0500
Message-ID: <40154BB5.1010700@potentialtech.com> (raw)
In-Reply-To: <8197.1075135417@sss.pgh.pa.us>
References: <40152FF2.8000007@potentialtech.com>
	<8197.1075135417@sss.pgh.pa.us>

Tom Lane wrote:
> Bill Moran <wmoran@potentialtech.com> 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




view thread (12+ messages)  latest in thread

Message-ID: <40154BB5.1010700@potentialtech.com>
Permalink:  ../40154BB5.1010700@potentialtech.com/
Also on:    postgresql.org/message-id/40154BB5.1010700@potentialtech.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: wmoran@potentialtech.com, tgl@sss.pgh.pa.us, pgsql-performance@postgresql.org
  Subject: Re: On the performance of views
  In-Reply-To: <40154BB5.1010700@potentialtech.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox