Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 1CAE01337B88 for ; Fri, 5 Nov 2010 06:05:40 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 70273-01-10 for ; Fri, 5 Nov 2010 09:05:33 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from 30.mail-out.ovh.net (30.mail-out.ovh.net [213.186.62.213]) by mail.postgresql.org (Postfix) with SMTP id 349D11337BD4 for ; Fri, 5 Nov 2010 06:05:30 -0300 (ADT) Received: (qmail 19607 invoked by uid 503); 5 Nov 2010 08:43:52 -0000 Received: from b6.ovh.net (HELO mail639.ha.ovh.net) (213.186.33.56) by 30.mail-out.ovh.net with SMTP; 5 Nov 2010 08:43:52 -0000 Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 5 Nov 2010 11:05:36 +0200 Received: from par69-8-88-161-102-87.fbx.proxad.net (HELO apollo13) (lists%peufeu.com@88.161.102.87) by ns0.ovh.net with SMTP; 5 Nov 2010 11:05:35 +0200 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Nick Matheson" Cc: pgsql-performance@postgresql.org Subject: Re: Simple (hopefully) throughput question? References: <4CD1853F.2010800@noaa.gov> <4CD19E84.7070204@squeakycode.net> <4CD2C640.8030303@noaa.gov> Date: Fri, 05 Nov 2010 10:05:25 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Pierre C" Message-ID: In-Reply-To: <4CD2C640.8030303@noaa.gov> User-Agent: Opera Mail/10.62 (Linux) X-Ovh-Tracer-Id: 14474287729197057790 X-Ovh-Remote: 88.161.102.87 (par69-8-88-161-102-87.fbx.proxad.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Spam-Check: DONE|U 0.5/N X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201011/42 X-Sequence-Number: 41066 On Thu, 04 Nov 2010 15:42:08 +0100, Nick Matheson wrote: > I think your comments really get at what our working hypothesis was, but > given that our experience is limited compared to you all here on the > mailing lists we really wanted to make sure we weren't missing any > alternatives. Also the writing of custom aggregators will likely > leverage any improvements we make to our storage throughput. Quick test : SELECT sum(x) FROM a table with 1 INT column, 3M rows, cached => 244 MB/s => 6.7 M rows/s Same on MySQL : size SELECT sum(x) (cached) postgres 107 MB 0.44 s myisam 20 MB 0.42 s innodb 88 MB 1.98 s As you can see, even though myisam is much smaller (no transaction data to store !) the aggregate performance isn't any better, and for innodb it is much worse. Even though pg's per-row header is large, seq scan / aggregate performance is very good. You can get performance in this ballpark by writing a custom aggregate in C ; it isn't very difficult, the pg source code is clean and full of insightful comments. - take a look at how contrib/intagg works - http://www.postgresql.org/files/documentation/books/aw_pgsql/node168.html - and the pg manual of course