Views and functions returning sets of records - Mailing list pgsql-performance

From Giorgio Valoti
Subject Views and functions returning sets of records
Date
Msg-id 6A737ADC-2A11-4A01-8ACE-C439E4297273@mac.com
Whole thread Raw
Responses Re: Views and functions returning sets of records  (Andreas Kretschmer <akretschmer@spamfence.net>)
Re: Views and functions returning sets of records  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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





pgsql-performance by date:

Previous
From: "sathiya psql"
Date:
Subject: Re: Having MANY MANY empty columns in database
Next
From: Andreas Kretschmer
Date:
Subject: Re: Views and functions returning sets of records