pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Giorgio Valoti <giorgio_v@mac.com>
To: pgsql-performance@postgresql.org
Subject: Views and functions returning sets of records
Date: Sat, 22 Mar 2008 15:01:50 +0100
Message-ID: <6A737ADC-2A11-4A01-8ACE-C439E4297273@mac.com> (raw)

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







view thread (8+ messages)  latest in thread

Message-ID: <6A737ADC-2A11-4A01-8ACE-C439E4297273@mac.com>
Permalink:  ../6A737ADC-2A11-4A01-8ACE-C439E4297273@mac.com/
Also on:    postgresql.org/message-id/6A737ADC-2A11-4A01-8ACE-C439E4297273@mac.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: giorgio_v@mac.com
  Subject: Re: Views and functions returning sets of records
  In-Reply-To: <6A737ADC-2A11-4A01-8ACE-C439E4297273@mac.com>
  References: <6A737ADC-2A11-4A01-8ACE-C439E4297273@mac.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox