X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 19DC09DC9E8 for ; Sun, 8 Jan 2006 14:42:42 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 62633-03 for ; Sun, 8 Jan 2006 14:42:41 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.mi8.com (d01gw02.mi8.com [63.240.6.46]) by postgresql.org (Postfix) with ESMTP id AA7719DC942 for ; Sun, 8 Jan 2006 14:42:39 -0400 (AST) Received: from 172.16.1.110 by mail.mi8.com with ESMTP (- Welcome to Mi8 Corporation www.Mi8.com (D2)); Sun, 08 Jan 2006 13:42:32 -0500 X-Server-Uuid: 7829E76E-BB9E-4995-8473-3C0929DF7DD1 Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.175]) by D01SMTP01.Mi8.com with Microsoft SMTPSVC(6.0.3790.1830); Sun, 8 Jan 2006 13:42:32 -0500 Received: from 69.181.100.71 ([69.181.100.71]) 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 ; Sun, 8 Jan 2006 18:42:31 +0000 User-Agent: Microsoft-Entourage/11.2.1.051004 Date: Sun, 08 Jan 2006 10:42:31 -0800 Subject: Re: help tuning queries on large database From: "Luke Lonergan" To: "peter royal" , pgsql-performance@postgresql.org Message-ID: Thread-Topic: [PERFORM] help tuning queries on large database Thread-Index: AcYTFQFEbemu7xT0Q2qfSxqTQl+g7gBbkbeJ In-Reply-To: MIME-Version: 1.0 X-OriginalArrivalTime: 08 Jan 2006 18:42:32.0444 (UTC) FILETIME=[48FCDBC0:01C61483] X-WSS-ID: 6FDF82923TO9542830-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=1.318 required=5 tests=[AWL=0.065, RCVD_NUMERIC_HELO=1.253] X-Spam-Score: 1.318 X-Spam-Level: * X-Archive-Number: 200601/50 X-Sequence-Number: 16528 Peter, On 1/6/06 2:59 PM, "peter royal" wrote: > I have experimented with having all 8 disks in a single RAID0 set, a > single RAID10 set, and currently 4 RAID0 sets of 2 disks each. There > hasn't been an appreciable difference in the overall performance of > my test suite (which randomly generates queries like the samples > below as well as a few other types. this problem manifests itself on > other queries in the test suite as well). Have you tested the underlying filesystem for it's performance? Run this: time bash -c 'dd if=/dev/zero of=/my_file_system/bigfile bs=8k count= && sync' Then run this: time dd if=/my_file_system/bigfile bs=8k of=/dev/null And report the times here please. With your 8 disks in any of the RAID0 configurations you describe, you should be getting 480MB/s. In the RAID10 configuration you should get 240. Note that ext3 will not go faster than about 300MB/s in our experience. You should use xfs, which will run *much* faster. You should also experiment with using larger readahead, which you can implement like this: blockdev --setra 16384 /dev/ E.g. "blockdev --setra 16384 /dev/sda" This will set the readahead of Linux block device reads to 16MB. Using 3Ware's newest controllers we have seen 500MB/s + on 8 disk drives in RAID0 on CentOS 4.1 with xfs. Note that you will need to run the "CentOS unsupported kernel" to get xfs. > So, my question is, is there anything I can do to boost performance > with what I've got, or am I in a position where the only 'fix' is > more faster disks? I can't think of any schema/index changes that > would help, since everything looks pretty optimal from the 'explain > analyze' output. I'd like to get a 10x improvement when querying from > the 'cold' state.