X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 5BD96D1C4BF; Sun, 3 Aug 2003 23:19:44 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 62775-07; Sun, 3 Aug 2003 20:18:33 -0300 (ADT) Received: from joeconway.com (66-146-172-86.skyriver.net [66.146.172.86]) by svr1.postgresql.org (Postfix) with ESMTP id F1855D1C9DB; Sun, 3 Aug 2003 20:19:32 -0300 (ADT) Received: from [192.168.5.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 4.0.6) with ESMTP-TLS id 21879; Sun, 03 Aug 2003 15:41:13 -0700 Message-ID: <3F2D97BB.3060600@joeconway.com> Date: Sun, 03 Aug 2003 16:16:11 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: Hans Spaans , pgsql-admin@postgresql.org, pgsql-hackers@postgresql.org Subject: Re: [HACKERS] concat_ws References: <20030803131931.GD4326@sch01r01.nexit.nl> <26941.1059926135@sss.pgh.pa.us> <3F2D4B3B.3050405@joeconway.com> <6571.1059934474@sss.pgh.pa.us> <3F2D84FF.3070304@joeconway.com> <1680.1059949492@sss.pgh.pa.us> In-Reply-To: <1680.1059949492@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/48 X-Sequence-Number: 9771 Tom Lane wrote: > Yeah. The problem is that the SQL function inliner generates an > enormous expression tree from this function definition. 7.3 had no > inliner so no problem. But I wonder why it isn't at all a problem when the function is also defined STRICT? I also looked back at the greatest() example -- similar behavior. If defined ...language sql; or ...language sql IMMUTABLE STRICT; it works great. But when defined ...language sql IMMUTABLE; it dies a horrible recursive death. In case 1 above, the function doesn't get inlined at all, right? But in both case 2 and 3, it should get inlined -- why does 2 work fine when 3 doesn't? > I am not sure what to do about it --- the only idea that comes to mind > is to put an arbitrary limit (of, say, 5 or 10 function calls) on the > depth of inlining expansion. That seems like a pretty ugly answer > ... anyone have a better one? But as above, case 2 is inlined (I think) and works fine -- why restrict it. > Your definition of concat_ws bears some passing resemblance to the > infamous Ackermann's function, btw. I always knew I was destined to be infamous ;-) Joe