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 6D7AB56758 for ; Mon, 21 Mar 2005 06:40:45 +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 72487-05 for ; Mon, 21 Mar 2005 06:40:42 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id CF2E856754 for ; Mon, 21 Mar 2005 06:40:41 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j2L6egAf011189; Mon, 21 Mar 2005 01:40:42 -0500 (EST) To: Neil Conway Cc: Bruno Wolff III , Keith Worthington , pgsql-performance@postgresql.org Subject: Re: View vs function In-reply-to: <423E57E5.4070405@samurai.com> References: <423E420D.1020503@NarrowPathInc.com> <20050321042720.GA27098@wolff.to> <423E57E5.4070405@samurai.com> Comments: In-reply-to Neil Conway message dated "Mon, 21 Mar 2005 16:13:09 +1100" Date: Mon, 21 Mar 2005 01:40:42 -0500 Message-ID: <11188.1111387242@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/415 X-Sequence-Number: 11120 Neil Conway writes: > Bruno Wolff III wrote: >> Functions are just black boxes to the planner. > ... unless the function is a SQL function that is trivial enough for the > planner to inline it into the plan of the invoking query. Currently, we > won't inline set-returning SQL functions that are used in the query's > rangetable, though. This would be worth doing, I think -- I'm not sure > how much work it would be, though. Yeah, I've been thinking the same. It seems like it shouldn't be unduly difficult --- not harder than inlining scalar-valued SQL functions, just different validity conditions. regards, tom lane