Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id F2ADD13FA3D7 for ; Mon, 18 Jun 2012 16:08:55 -0300 (ADT) Received: from smtp.01.com ([199.36.142.181]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SghJj-0007yN-L2 for pgsql-performance@postgresql.org; Mon, 18 Jun 2012 19:08:55 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp-out-1.01.com (Postfix) with ESMTP id 137332940FB; Mon, 18 Jun 2012 14:08:39 -0500 (CDT) 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 TWPlTLHY0H8Z; Mon, 18 Jun 2012 14:08:38 -0500 (CDT) Received: from smtp.01.com (localhost.localdomain [127.0.0.1]) by smtp-out-1.01.com (Postfix) with ESMTP id DEFE3294107; Mon, 18 Jun 2012 14:08:38 -0500 (CDT) 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 879E22940FB; Mon, 18 Jun 2012 14:08:38 -0500 (CDT) Message-ID: <4FDF7CB5.4060207@agliodbs.com> Date: Mon, 18 Jun 2012 12:08:37 -0700 From: Josh Berkus Organization: PostgreSQL Experts Inc. User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: Anish Kejariwal CC: Jeff Janes , pgsql-performance@postgresql.org Subject: Re: Expected performance of querying 5k records from 4 million records? References: In-Reply-To: X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/101 X-Sequence-Number: 47127 On 6/18/12 9:39 AM, Anish Kejariwal wrote: > Thanks for the help, Jeff and Josh. It looks reclustering the multi-column > index might solve things. For my particular query, because I'm getting a > range of records back, it makes sense that reclustering will benefit me if > I have a slow disk even if I had expected that the indices would be > sufficient . I now need to make sure that the speed up I'm seeing is not > because things have been cached. Well, other than that your performance is as expected because of your much-larger-than-RAM database and your relatively slow disk. -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com