Re: On the performance of views - Mailing list pgsql-performance

From Bill Moran
Subject Re: On the performance of views
Date
Msg-id 40154BB5.1010700@potentialtech.com
Whole thread Raw
In response to Re: On the performance of views  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
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


pgsql-performance by date:

Previous
From: Josh Berkus
Date:
Subject: Re: On the performance of views
Next
From: Orion Henry
Date:
Subject: Re: help with dual indexing