Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UrwdV-0002yP-MC for pgsql-performance@arkaria.postgresql.org; Wed, 26 Jun 2013 20:48:17 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1UrwdU-0008Kw-JO for pgsql-performance@arkaria.postgresql.org; Wed, 26 Jun 2013 20:48:16 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UrwdK-00084a-3K for pgsql-performance@postgresql.org; Wed, 26 Jun 2013 20:48:06 +0000 Received: from proofpoint2.mail.rice.edu ([128.42.201.101] helo=pp2.rice.edu) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UrwdH-0006NV-Jp for pgsql-performance@postgresql.org; Wed, 26 Jun 2013 20:48:05 +0000 Received: from pps.filterd (pp2.rice.edu [127.0.0.1]) by pp2.rice.edu (8.14.5/8.14.5) with SMTP id r5QAAM9B011993; Wed, 26 Jun 2013 15:48:01 -0500 Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by pp2.rice.edu with ESMTP id 1d6ep8hj75-1; Wed, 26 Jun 2013 15:48:01 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel X-SMTP-Auth: no X-SMTP-Auth: no X-SMTP-Auth: no X-SMTP-Auth: no Received: from aart.rice.edu (aart.rice.edu [168.7.56.48]) by mh1.mail.rice.edu (Postfix) with ESMTP id 790704600EF; Wed, 26 Jun 2013 15:48:01 -0500 (CDT) Received: by aart.rice.edu (Postfix, from userid 18612) id D930F1006F0; Wed, 26 Jun 2013 15:48:04 -0500 (CDT) Date: Wed, 26 Jun 2013 15:48:04 -0500 From: "ktm@rice.edu" To: Willy-Bas Loos Cc: Jeff Janes , Scott Marlowe , "pgsql-performance@postgresql.org" Subject: Re: seqscan for 100 out of 3M rows, index present Message-ID: <20130626204804.GC3264@aart.rice.edu> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-12-10) X-Pg-Spam-Score: -0.5 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On Wed, Jun 26, 2013 at 10:36:10PM +0200, Willy-Bas Loos wrote: > On Wed, Jun 26, 2013 at 10:31 PM, Jeff Janes wrote: > > > > > Why is it retrieving 3.1 million, when it only needs 17? > > > > > > that's because of the sequential scan, it reads all the data. > > cheers, > > willy-bas Well, the two plans timings were pretty close together. Maybe your cost model is off. Try adjusting the various cost parameters to favor random I/O more. Regards, Ken -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance