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 F3FF43A6113 for ; Fri, 28 Jan 2005 00:14:59 +0000 (GMT) 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 33768-06 for ; Fri, 28 Jan 2005 00:14:49 +0000 (GMT) Received: from stark.xeocode.com (gsstark.mtl.istop.com [66.11.160.162]) by svr1.postgresql.org (Postfix) with ESMTP id 96ABC3A6109 for ; Fri, 28 Jan 2005 00:14:50 +0000 (GMT) Received: from localhost ([127.0.0.1] helo=stark.xeocode.com) by stark.xeocode.com with smtp (Exim 3.36 #1 (Debian)) id 1CuJmh-0006Sh-00; Thu, 27 Jan 2005 19:14:47 -0500 To: "Merlin Moncure" Cc: , Subject: Re: [SQL] OFFSET impact on Performance??? References: <6EE64EF3AB31D5448D0007DD34EEB3412A75F3@Herge.rcsinc.local> In-Reply-To: <6EE64EF3AB31D5448D0007DD34EEB3412A75F3@Herge.rcsinc.local> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 27 Jan 2005 19:14:46 -0500 Message-ID: <87651iv289.fsf@stark.xeocode.com> Lines: 22 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.057 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200501/559 X-Sequence-Number: 10249 "Merlin Moncure" writes: > what about > CREATE AGGREGATE array_accum ( > sfunc = array_append, > basetype = anyelement, > stype = anyarray, > initcond = '{}' > ); huh, that is faster. It's only 14x slower than the C implementation. For completeness, here are the fastest times I get after repeating a few times each: 13.97 ms contrib/intagg C implementation 194.76 ms aggregate using array_append 723.15 ms aggregate with SQL state function -- greg