X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8558CDBC26 for ; Thu, 24 Nov 2005 13:07:59 -0400 (AST) 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 69156-03-2 for ; Thu, 24 Nov 2005 17:07:57 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.Mi8.com (d01gw01.mi8.com [63.240.6.47]) by svr1.postgresql.org (Postfix) with ESMTP id 91589DBBB8 for ; Thu, 24 Nov 2005 13:07:56 -0400 (AST) Received: from 172.16.1.112 by mail.Mi8.com with ESMTP (- Welcome to Mi8 Corporation www.Mi8.com (D1)); Thu, 24 Nov 2005 12:07:42 -0500 X-Server-Uuid: 241911D6-425B-44B9-A073-E3FE0F8FC774 Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.175]) by D01SMTP02.Mi8.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 24 Nov 2005 12:07:42 -0500 Received: from 208.54.15.129 ([208.54.15.129]) by MI8NYCMAIL06.Mi8.com ( [172.16.1.219]) via Exchange Front-End Server mi8owa.mi8.com ( [172.16.1.106]) with Microsoft Exchange Server HTTP-DAV ; Thu, 24 Nov 2005 12:07:42 -0500 User-Agent: Microsoft-Entourage/11.2.1.051004 Date: Thu, 24 Nov 2005 09:07:40 -0800 Subject: Re: Hardware/OS recommendations for large databases ( From: "Luke Lonergan" To: "Luke Lonergan" cc: pgsql-performance@postgresql.org Message-ID: Thread-Topic: [PERFORM] Hardware/OS recommendations for large databases ( Thread-Index: AcXvIxdwfLDwWrP8Q669kHxJ85F1twBrF12iABKHo1c= In-Reply-To: MIME-Version: 1.0 X-OriginalArrivalTime: 24 Nov 2005 17:07:42.0594 (UTC) FILETIME=[94FBE620:01C5F119] X-WSS-ID: 6F9B2CD43282685473-01-01 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=2.386 required=5 tests=[AWL=-0.103, RCVD_IN_SORBS_WEB=1.236, RCVD_NUMERIC_HELO=1.253] X-Spam-Score: 2.386 X-Spam-Level: ** X-Archive-Number: 200511/501 X-Sequence-Number: 15758 The same 12.9GB distributed across 4 machines using Bizgres MPP fits into I/O cache. The interesting result is that the query "select count(1)" is limited in speed to 280 MB/s per CPU when run on the lineitem table. So when I run it spread over 4 machines, one CPU per machine I get this: ====================================================== Bizgres MPP, 4 data segments, 1 per 2 CPUs ====================================================== llonergan=# explain select count(1) from lineitem; QUERY PLAN ---------------------------------------------------------------------------- ---------- Aggregate (cost=582452.00..582452.00 rows=1 width=0) -> Gather Motion (cost=582452.00..582452.00 rows=1 width=0) -> Aggregate (cost=582452.00..582452.00 rows=1 width=0) -> Seq Scan on lineitem (cost=0.00..544945.00 rows=15002800 width=0) (4 rows) llonergan=# \timing Timing is on. llonergan=# select count(1) from lineitem; count ---------- 59986052 (1 row) Time: 12191.435 ms llonergan=# select count(1) from lineitem; count ---------- 59986052 (1 row) Time: 11986.109 ms llonergan=# select count(1) from lineitem; count ---------- 59986052 (1 row) Time: 11448.941 ms ====================================================== That's 12,937 MB in 11.45 seconds, or 1,130 MB/s. When you divide out the number of Postgres instances (4), that's 283MB/s per Postgres instance. To verify that this has nothing to do with MPP, I ran it in a special internal mode on one instance and got the same result. So - we should be able to double this rate by running one segment per CPU, or two per host: ====================================================== Bizgres MPP, 8 data segments, 1 per CPU ====================================================== llonergan=# select count(1) from lineitem; count ---------- 59986052 (1 row) Time: 6484.594 ms llonergan=# select count(1) from lineitem; count ---------- 59986052 (1 row) Time: 6156.729 ms llonergan=# select count(1) from lineitem; count ---------- 59986052 (1 row) Time: 6063.416 ms ====================================================== That's 12,937 MB in 11.45 seconds, or 2,134 MB/s. When you divide out the number of Postgres instances (8), that's 267MB/s per Postgres instance. So, if you want to "select count(1)", using more CPUs is a good idea! For most complex queries, having lots of CPUs + MPP is a good combo. Here is an example of a sorting plan - this should probably be done with a hash aggregation, but using 8 CPUs makes it go 8x faster: - Luke