Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c0Cbj-00088b-Vt for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Oct 2016 19:14:28 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c0Cbj-0002JI-B3 for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Oct 2016 19:14:27 +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 1c0Cbh-0002IL-Q2 for pgsql-hackers@postgresql.org; Fri, 28 Oct 2016 19:14:25 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c0Cbc-0000v8-Qt for pgsql-hackers@postgresql.org; Fri, 28 Oct 2016 19:14:23 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u9SJEHop012588; Fri, 28 Oct 2016 15:14:17 -0400 From: Tom Lane To: Andrew Dunstan cc: pgsql-hackers@postgresql.org Subject: Re: Speed of user-defined aggregates using array_append as transfn In-reply-to: <0b14ae5b-dc6a-8545-c3d8-63566ed0a43a@dunslane.net> References: <6315.1477677885@sss.pgh.pa.us> <0b14ae5b-dc6a-8545-c3d8-63566ed0a43a@dunslane.net> Comments: In-reply-to Andrew Dunstan message dated "Fri, 28 Oct 2016 15:00:56 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <12586.1477682057.1@sss.pgh.pa.us> Date: Fri, 28 Oct 2016 15:14:17 -0400 Message-ID: <12587.1477682057@sss.pgh.pa.us> X-Pg-Spam-Score: -3.3 (---) 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 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. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers