Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id A7C901091DCD for ; Thu, 17 Nov 2011 01:19:22 -0400 (AST) 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 69066-02 for ; Thu, 17 Nov 2011 05:19:16 +0000 (UTC) Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 4A7CC1091DCC for ; Thu, 17 Nov 2011 01:19:16 -0400 (AST) Received: from smtp.01.com ([216.115.88.169]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RQuNW-0001OD-W9 for pgsql-performance@postgresql.org; Thu, 17 Nov 2011 05:19:16 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp-out-1.01.com (Postfix) with ESMTP id 3C8089D004C for ; Wed, 16 Nov 2011 23:19:02 -0600 (CST) X-Virus-Scanned: amavisd-new at smtp-out-1.01.com Received: from smtp.01.com ([127.0.0.1]) by localhost (smtp-out-1.01.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZvOAhy0w2VcT for ; Wed, 16 Nov 2011 23:19:02 -0600 (CST) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp-out-1.01.com (Postfix) with ESMTP id 1DFD69D00AE for ; Wed, 16 Nov 2011 23:19:02 -0600 (CST) Received: from Sidney-Stratton.local (70-36-143-92.dsl.dynamic.sonic.net [70.36.143.92]) by smtp-out-1.01.com (Postfix) with ESMTPSA id EF4DD9D004C for ; Wed, 16 Nov 2011 23:19:01 -0600 (CST) Message-ID: <4EC49945.40408@agliodbs.com> Date: Wed, 16 Nov 2011 21:19:01 -0800 From: Josh Berkus Organization: PostgreSQL Experts Inc. User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.24) Gecko/20111103 Lightning/1.0b2 Thunderbird/3.1.16 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Performance question 83 GB Table 150 million rows, distinct select References: <57c79e7822e93c2325245ab4f5606acc.squirrel@sq.gransy.com> In-Reply-To: X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 X-Spam-Level: X-Archive-Number: 201111/214 X-Sequence-Number: 45725 Tory, A seq scan across 83GB in 4 minutes is pretty good. That's over 300MB/s. Even if you assume that 1/3 of the table was already cached, that's still over 240mb/s. Good disk array. Either you need an index, or you need to not do this query at user request time. Or a LOT more RAM. -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com