Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id EBA042E0035 for ; Sat, 22 Mar 2008 13:34:05 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 88224-07 for ; Sat, 22 Mar 2008 13:34:02 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 4AB002E0032 for ; Sat, 22 Mar 2008 13:34:03 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m2MGY0tm029706; Sat, 22 Mar 2008 12:34:00 -0400 (EDT) To: Giorgio Valoti cc: pgsql-performance@postgresql.org 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> Comments: In-reply-to Giorgio Valoti message dated "Sat, 22 Mar 2008 15:01:50 +0100" Date: Sat, 22 Mar 2008 12:33:59 -0400 Message-ID: <29705.1206203639@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/431 X-Sequence-Number: 29385 Giorgio Valoti writes: > 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, Yes. Usually the view will win. regards, tom lane