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 B603BD1C4BF; Mon, 4 Aug 2003 01:41:22 +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 73014-01; Sun, 3 Aug 2003 22:40:12 -0300 (ADT) Received: from joeconway.com (66-146-172-86.skyriver.net [66.146.172.86]) by svr1.postgresql.org (Postfix) with ESMTP id 0865CD1C991; Sun, 3 Aug 2003 22:41:11 -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 21995; Sun, 03 Aug 2003 18:02:52 -0700 Message-ID: <3F2DB8F0.9040605@joeconway.com> Date: Sun, 03 Aug 2003 18:37:52 -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: concat_ws References: <20030803131931.GD4326@sch01r01.nexit.nl> <26941.1059926135@sss.pgh.pa.us> <3F2D4B3B.3050405@joeconway.com> <2270.1059952382@sss.pgh.pa.us> <4313.1059954837@sss.pgh.pa.us> In-Reply-To: <4313.1059954837@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/52 X-Sequence-Number: 9775 Tom Lane wrote: > I added code to inline_function to stop inlining if a parameter > expression to be substituted multiple times has cost greater than > 10*cpu_operator_cost (which roughly means that it contains more than > 10 operators or functions). This seems to cut off the problem nicely, > at least for this example. The factor of 10 is a bit of a magic number > but it seems reasonable. > That did it (on fresh copy of cvs): regression=# explain analyze select concat_ws('~','01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31'); QUERY PLAN ---------------------------------------------------------------------------------- Result (cost=0.00..0.11 rows=1 width=0) (actual time=2.37..2.37 rows=1 loops=1) Total runtime: 2.66 msec (2 rows) Thanks Tom! Joe