Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c0CuW-0000Ws-OY for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Oct 2016 19:33:52 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c0CuW-0004tc-BP for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Oct 2016 19:33:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c0CuV-0004sD-FZ for pgsql-hackers@postgresql.org; Fri, 28 Oct 2016 19:33:51 +0000 Received: from relay5-d.mail.gandi.net ([217.70.183.197]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c0CuR-0001H4-0q for pgsql-hackers@postgresql.org; Fri, 28 Oct 2016 19:33:50 +0000 Received: from mfilter44-d.gandi.net (mfilter44-d.gandi.net [217.70.178.175]) by relay5-d.mail.gandi.net (Postfix) with ESMTP id 2FB0D41C091; Fri, 28 Oct 2016 21:33:45 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter44-d.gandi.net Received: from relay5-d.mail.gandi.net ([IPv6:::ffff:217.70.183.197]) by mfilter44-d.gandi.net (mfilter44-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id cUpOvpVcv5mz; Fri, 28 Oct 2016 21:33:43 +0200 (CEST) X-Originating-IP: 98.122.164.227 Received: from [192.168.10.146] (unknown [98.122.164.227]) (Authenticated sender: adsend@dunslane.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 1F56141C08A; Fri, 28 Oct 2016 21:33:42 +0200 (CEST) Subject: Re: Speed of user-defined aggregates using array_append as transfn To: Tom Lane References: <6315.1477677885@sss.pgh.pa.us> <0b14ae5b-dc6a-8545-c3d8-63566ed0a43a@dunslane.net> <12587.1477682057@sss.pgh.pa.us> Cc: pgsql-hackers@postgresql.org From: Andrew Dunstan Message-ID: Date: Fri, 28 Oct 2016 15:33:41 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <12587.1477682057@sss.pgh.pa.us> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 10/28/2016 03:14 PM, Tom Lane wrote: > Andrew Dunstan writes: >> My initial admittedly ugly thought was why not have a second append >> function that doesn't use expanded arrays? > That won't get us out of the O(N^2) behavior. Also I don't see what's > better about it than my suggestion of making array_append itself do > that when called as an aggregate function. > > Probably nothing, I was just thinking out loud. That suggestion seems like the most obviously back-patchable solution. cheers andrew -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers