Re: View vs Stored Proc Performance - Mailing list pgsql-performance

From Merlin Moncure
Subject Re: View vs Stored Proc Performance
Date
Msg-id b42b73150909111453l73467547j485aa6d90f68fa99@mail.gmail.com
Whole thread Raw
In response to Re: View vs Stored Proc Performance  (Jason Tesser <jasontesser@gmail.com>)
Responses Re: View vs Stored Proc Performance
List pgsql-performance
On Fri, Sep 11, 2009 at 5:27 PM, Jason Tesser <jasontesser@gmail.com> wrote:
> Right what I was wondering is is this better done in a view? or a stored
> proc?   I am guessing based on your initial response the view is better
> performance.  These are the types of queries I will be doing though.
>

in performance terms the view should be faster if you are doing things
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.  the actual
mechanism you use to build the arrays is likely going to be more
important than anything else.

merlin

pgsql-performance by date:

Previous
From: Robert Haas
Date:
Subject: Re: slow query : very simple delete, 100% cpu, nearly no disk activity
Next
From: Merlin Moncure
Date:
Subject: Re: slow query : very simple delete, 100% cpu, nearly no disk activity