X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8EF7156486 for ; Mon, 21 Mar 2005 03:37:22 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 22344-02 for ; Mon, 21 Mar 2005 03:37:21 +0000 (GMT) Received: from mxsf32.cluster1.charter.net (mxsf32.cluster1.charter.net [209.225.28.156]) by svr1.postgresql.org (Postfix) with ESMTP id 404A6563DE for ; Mon, 21 Mar 2005 03:37:20 +0000 (GMT) Received: from mxip06.cluster1.charter.net (mxip06a.cluster1.charter.net [209.225.28.136]) by mxsf32.cluster1.charter.net (8.12.11/8.12.11) with ESMTP id j2L3bNeH031493 for ; Sun, 20 Mar 2005 22:37:24 -0500 Received: from pc-68-118-180-13.will.ct.charter.com (HELO [192.168.116.102]) (68.118.180.13) by mxip06.cluster1.charter.net with ESMTP; 20 Mar 2005 22:37:23 -0500 X-Ironport-AV: i="3.91,105,1110171600"; d="scan'208"; a="682501728:sNHT26986800" Message-ID: <423E420D.1020503@NarrowPathInc.com> Date: Sun, 20 Mar 2005 22:39:57 -0500 From: Keith Worthington Reply-To: KeithW@NarrowPathInc.com Organization: Narrow Path, Inc. User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: View vs function Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.12 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/397 X-Sequence-Number: 11102 Hi All, I have been reading about set returning functions. What I would like to know is is there a performance advantage in using SRFs versus querying a view. Assuming the underlying SQL is the same for the view vs the function except for the WHERE clause which of these would you expect to be faster? Or does the planner realize all this... SELECT * FROM view_big_query WHERE column1 = 1234; SELECT * FROM func_bug_query(1234); -- Kind Regards, Keith