Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 5FD731335B36 for ; Wed, 3 Nov 2010 14:10:40 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 44261-06 for ; Wed, 3 Nov 2010 17:10:32 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og104.obsmtp.com (exprod7og104.obsmtp.com [64.18.2.161]) by mail.postgresql.org (Postfix) with SMTP id B42A81337B4C for ; Wed, 3 Nov 2010 14:10:31 -0300 (ADT) Received: from source ([209.85.215.44]) by exprod7ob104.postini.com ([64.18.6.12]) with SMTP ID DSNKTNGXhneL+QrxGEEoke8ya5g9Q9m2TtT1@postini.com; Wed, 03 Nov 2010 10:10:32 PDT Received: by ewy27 with SMTP id 27so425561ewy.31 for ; Wed, 03 Nov 2010 10:10:30 -0700 (PDT) Received: by 10.213.98.78 with SMTP id p14mr4687873ebn.54.1288804229705; Wed, 03 Nov 2010 10:10:29 -0700 (PDT) Received: from [192.168.1.183] (dsl-hkibrasgw2-ff7ac300-240.dhcp.inet.fi [88.195.122.240]) by mx.google.com with ESMTPS id v51sm6753521eeh.22.2010.11.03.10.10.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 03 Nov 2010 10:10:27 -0700 (PDT) Message-ID: <4CD19785.9060301@enterprisedb.com> Date: Wed, 03 Nov 2010 19:10:29 +0200 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.1.12) Gecko/20100913 Icedove/3.0.7 MIME-Version: 1.0 To: Nick Matheson CC: pgsql-performance@postgresql.org Subject: Re: Simple (hopefully) throughput question? References: <4CD1853F.2010800@noaa.gov> In-Reply-To: <4CD1853F.2010800@noaa.gov> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.2 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3 X-Spam-Level: X-Archive-Number: 201011/30 X-Sequence-Number: 41054 On 03.11.2010 17:52, Nick Matheson wrote: > We have an application that needs to do bulk reads of ENTIRE > Postgres tables very quickly (i.e. select * from table). We have > observed that such sequential scans run two orders of magnitude slower > than observed raw disk reads (5 MB/s versus 100 MB/s). Part of this is > due to the storage overhead we have observed in Postgres. In the > example below, it takes 1 GB to store 350 MB of nominal data. However > that suggests we would expect to get 35 MB/s bulk read rates. > > Observations using iostat and top during these bulk reads suggest > that the queries are CPU bound, not I/O bound. In fact, repeating the > queries yields similar response times. Presumably if it were an I/O > issue the response times would be much shorter the second time through > with the benefit of caching. > > We have tried these simple queries using psql, JDBC, pl/java stored > procedures, and libpq. In all cases the client code ran on the same > box as the server. We have experimented with Postgres 8.1, 8.3 and 9.0. Try COPY, ie. "COPY bulk_performance.counts TO STDOUT BINARY". -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com