Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 073BD2E2E5E for ; Sun, 2 Dec 2007 06:26:34 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 14611-07 for ; Sun, 2 Dec 2007 06:26:19 -0400 (AST) Received: from aibo.runbox.com (aibo.runbox.com [193.71.199.94]) by postgresql.org (Postfix) with ESMTP id C9E0C2E0042 for ; Sun, 2 Dec 2007 06:26:22 -0400 (AST) Received: from [10.9.9.131] (helo=garm.runbox.com) by greyhound.runbox.com with esmtp (Exim 4.50) id 1Iym1i-0004Q7-6L for pgsql-performance@postgresql.org; Sun, 02 Dec 2007 11:26:18 +0100 Received: from mail by garm.runbox.com with local (Exim 4.50) id 1Iym1h-0004Tg-VQ for pgsql-performance@postgresql.org; Sun, 02 Dec 2007 11:26:18 +0100 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Received: from [78.60.33.99] by secure.runbox.com with http (uid:663718) (RMM 4.0); for ; Sun, 02 Dec 2007 10:26:17 GMT From: "Mindaugas" To: pgsql-performance@postgresql.org Subject: Dealing with big tables Date: Sun, 02 Dec 2007 12:26:17 +0200 (EET) X-Sender: 663718 X-Mailer: RMM Message-Id: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/6 X-Sequence-Number: 27822 Hello, Started to work with big tables (like 300GB) and performance problems sta= rted to appear. :( To simplify things - table has an index on From an index on To columns. A= nd it also have several other not indexed columns. There are 100000+ of dif= ferent values for From and the same for To. I execute simple query "select * from bigtable where From=3D'something'".= Query returns like 1000 rows and takes 5++ seconds to complete. As far as = I understand the query is slow because: - first it has to retrieve pointers to rows with data from index. That go= es fast. - retrieve all the rows one by one. There we have 100% random read becaus= e rows with the same From is distributed evenly through all the 300GB and m= ost probably nothing is cached. So there we are limited by _one_ disk perfo= rmance independently of how many disks we have in storage? And in case stor= age consists of 15k rpm Cheetahs with 3.5ms average read seek time we shoul= d expect not more than ~285 rows per second? I feel that I'm overlooking something here. But I'm new into data warehou= sing. :) Also this query should greatly benefit from parallel execution or async I= O. Storage (seeks/second) scales almost linearly when it has a lot of disks= . And query is completely IO bound so it should scale well on single server. And I cannot use some index organized table or table partitioned by From = :) because there are at least 2 similar indexes by which queries can be exe= cuted - From and To. Ideas for improvement? Greenplum or EnterpriseDB? Or I forgot something f= rom PostgreSQL features. Thanks, Mindaugas