Re: Views and functions returning sets of records

From: Giorgio Valoti <giorgio_v(at)mac(dot)com>
To: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Views and functions returning sets of records
Date: 2008-03-23 09:37:12
Message-ID: D49B7437-F5A9-44FC-807F-C8472C059B2B@mac.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


On 22/mar/08, at 17:55, Andreas Kretschmer wrote:

> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> schrieb:
>
>> Giorgio Valoti <giorgio_v(at)mac(dot)com> writes:
>>> maybe it’s a naive question but I was wondering if there is any
>>> difference, from a performance point of view, between a view and a
>>> function performing the same task,
>>
>> Yes. Usually the view will win.
>
> *smile*

:-(
I was thinking about using using functions as the main way to
interact with the database from an external application. The
(supposed) rationale was to simplify the application code: you only
have to worry about in and out function parameters.
Are there any way to pass some hints to the planner? For example,
could the IMMUTABLE/STABLE/VOLATILE modifiers be of some help?

Thank you
--
Giorgio Valoti

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2008-03-23 15:28:52 Re: Views and functions returning sets of records
Previous Message Andreas Kretschmer 2008-03-22 16:55:51 Re: Views and functions returning sets of records