Re: View vs Stored Proc Performance

From: Ivan Voras <ivoras(at)freebsd(dot)org>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: View vs Stored Proc Performance
Date: 2009-09-15 15:14:06
Message-ID: h8oave$ohn$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Merlin Moncure wrote:
> On Sat, Sep 12, 2009 at 7:51 AM, Dimitri Fontaine
> <dfontaine(at)hi-media(dot)com> wrote:
>> Merlin Moncure <mmoncure(at)gmail(dot)com> writes:
>>> like joining the result to another table...the planner can see
>>> 'through' the view, etc. in a function, the result is fetched first
>>> and materialized without looking at the rest of the query.
>> I though the planner would "see through" SQL language functions and
>> inline them when possible, so they often can make for parametrized
>> views...
>
> It can happen for simple functions but often it will not. For views
> it always happens.

Are functions in language 'sql' handled differently than those of
language 'plpgsql'?

I think they're not so in any case a function will behave as a black box
with regards to the planner and optimizer (and views are always
'transparent').

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2009-09-15 15:26:13 Re: View vs Stored Proc Performance
Previous Message Kevin Grittner 2009-09-15 14:50:10 Re: How to post Performance Questions