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 A0FE611F665B for ; Thu, 30 Mar 2006 09:29:25 -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 71701-01 for ; Thu, 30 Mar 2006 09:29:25 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from vms042pub.verizon.net (vms042pub.verizon.net [206.46.252.42]) by postgresql.org (Postfix) with ESMTP id 5E51011F6657 for ; Thu, 30 Mar 2006 09:29:22 -0400 (AST) Received: from osgiliath.mathom.us ([70.108.132.172]) by vms042.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0IWY006FN04W7FP1@vms042.mailsrvcs.net> for pgsql-performance@postgresql.org; Thu, 30 Mar 2006 07:29:21 -0600 (CST) Received: from localhost (localhost [127.0.0.1]) by osgiliath.mathom.us (Postfix) with ESMTP id 0FC4A6E638; Thu, 30 Mar 2006 08:29:18 -0500 (EST) Received: from osgiliath.mathom.us ([127.0.0.1]) by localhost (osgiliath.home.mathom.us [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 01131-02-7; Thu, 30 Mar 2006 08:29:17 -0500 (EST) Received: by osgiliath.mathom.us (Postfix, from userid 1000) id 4E3A96E81B; Thu, 30 Mar 2006 08:29:17 -0500 (EST) Date: Thu, 30 Mar 2006 08:29:17 -0500 From: Michael Stone Subject: Re: Index scan startup time In-reply-to: <20060330125147.GA13611@uio.no> To: pgsql-performance@postgresql.org, Peter Eisentraut Mail-followup-to: pgsql-performance@postgresql.org, Peter Eisentraut Message-id: <20060330132915.GL6811@mathom.us> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-disposition: inline X-Pgp-Fingerprint: 53 FF 38 00 E7 DD 0A 9C 84 52 84 C5 EE DF 7C 88 X-Virus-Scanned: Debian amavisd-new at mathom.us References: <200603301359.11038.peter_e@gmx.net> <20060330120206.GA13075@uio.no> <200603301423.54510.peter_e@gmx.net> <20060330123134.GA13408@uio.no> <20060330124251.GK6811@mathom.us> <20060330125147.GA13611@uio.no> User-Agent: Mutt/1.5.11+cvs20060126 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.11 required=5 tests=[AWL=0.110] X-Spam-Score: 0.11 X-Spam-Level: X-Archive-Number: 200603/618 X-Sequence-Number: 18055 On Thu, Mar 30, 2006 at 02:51:47PM +0200, Steinar H. Gunderson wrote: >On Thu, Mar 30, 2006 at 07:42:53AM -0500, Michael Stone wrote: >> Yes. And the estimates are bad enough (orders of magnitude) that I can't >> help but wonder whether pg could come up with a better plan with better >> statistics: >> >>>>>> -> Index Scan using activity_pk on activity (cost=0.00..40717259.91 >>>>>> rows=6538650 width=8) (actual time=207356.050..207356.722 rows=100 >>>>>> loops=1) Filter: ((state = 10000) OR (state = 10001)) > >Isn't the rows=100 here because of the LIMIT? Yes. I was looking at the other side; I thought pg could estimate how much work it would have to do to hit the limit, but double-checking it looks like it can't. Mike Stone