Views and functions returning sets of records

From: Giorgio Valoti <giorgio_v(at)mac(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Views and functions returning sets of records
Date: 2008-03-22 14:01:50
Message-ID: 6A737ADC-2A11-4A01-8ACE-C439E4297273@mac.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi all,
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, something like:

CREATE VIEW foo AS …;
CREATE FUNCTION getfoo(int) RETURNS SETOF foo AS $$
SELECT * FROM foo WHERE fooid = $1;
$$ LANGUAGE SQL;

Thank you
--
Giorgio Valoti

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2008-03-22 16:33:59 Re: Views and functions returning sets of records
Previous Message sathiya psql 2008-03-22 09:08:25 Re: Having MANY MANY empty columns in database