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 304F053388 for ; Mon, 18 Apr 2005 16:50:36 -0300 (ADT) 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 59593-06 for ; Mon, 18 Apr 2005 19:50:34 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id DF6D05334B for ; Mon, 18 Apr 2005 16:50:33 -0300 (ADT) 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 j3IJoQBh025152; Mon, 18 Apr 2005 15:50:26 -0400 (EDT) To: Greg Stark Cc: "Merlin Moncure" , "Dawid Kuroczko" , pgsql-performance@postgresql.org Subject: Re: immutable functions vs. join for lookups ? In-reply-to: <87u0m4j5p0.fsf@stark.xeocode.com> References: <6EE64EF3AB31D5448D0007DD34EEB3415C2596@Herge.rcsinc.local> <22219.1113839449@sss.pgh.pa.us> <87u0m4j5p0.fsf@stark.xeocode.com> Comments: In-reply-to Greg Stark message dated "18 Apr 2005 14:33:15 -0400" Date: Mon, 18 Apr 2005 15:50:26 -0400 Message-ID: <25151.1113853826@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/436 X-Sequence-Number: 11833 Greg Stark writes: > Tom Lane writes: >> It would be interesting sometime to try to teach the planner about >> inlining SQL-language functions to become joins. That is, given > The Inlining of the function is presumably a side-issue. I have tons of > queries that use subqueries in the select list for which the same behaviour > would be appropriate. Yeah, I was actually thinking about a two-step process: inline the function to produce somethig equivalent to a handwritten scalar sub-SELECT, and then try to convert sub-SELECTs into joins. regards, tom lane