Re: On the performance of views

From: Bill Moran <wmoran(at)potentialtech(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: On the performance of views
Date: 2004-01-26 17:17:41
Message-ID: 40154BB5.1010700@potentialtech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance pgsql-sql

Tom Lane wrote:
> Bill Moran <wmoran(at)potentialtech(dot)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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Orion Henry 2004-01-26 20:53:16 Re: help with dual indexing
Previous Message Josh Berkus 2004-01-26 17:09:41 Re: On the performance of views

Browse pgsql-sql by date

  From Date Subject
Next Message Enio Schutt Junior 2004-01-26 17:51:47 Sometimes referential integrity seems not to work
Previous Message Josh Berkus 2004-01-26 17:09:41 Re: On the performance of views