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 6CEC011F6653 for ; Thu, 30 Mar 2006 09:00:49 -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 44656-09 for ; Thu, 30 Mar 2006 09:00:49 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from cassarossa.samfundet.no (cassarossa.samfundet.no [129.241.93.19]) by postgresql.org (Postfix) with ESMTP id C081911F664B for ; Thu, 30 Mar 2006 09:00:46 -0400 (AST) Received: from trofast.sesse.net ([129.241.93.32]) by cassarossa.samfundet.no with esmtp (Exim 4.50) id 1FOwla-00006V-G3 for pgsql-performance@postgresql.org; Thu, 30 Mar 2006 15:00:46 +0200 Received: from sesse by trofast.sesse.net with local (Exim 3.36 #1 (Debian)) id 1FOwlV-0003a6-00 for ; Thu, 30 Mar 2006 15:00:41 +0200 Date: Thu, 30 Mar 2006 15:00:41 +0200 From: "Steinar H. Gunderson" To: pgsql-performance@postgresql.org Subject: Re: Index scan startup time Message-ID: <20060330130041.GA13732@uio.no> Mail-Followup-To: pgsql-performance@postgresql.org References: <200603301359.11038.peter_e@gmx.net> <200603301423.54510.peter_e@gmx.net> <20060330123134.GA13408@uio.no> <200603301459.03011.peter_e@gmx.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <200603301459.03011.peter_e@gmx.net> X-Operating-System: Linux 2.6.14.3 on a x86_64 X-Message-Flag: Outlook? --> http://www.mozilla.org/products/thunderbird/ User-Agent: Mutt/1.5.11+cvs20060126 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.101 required=5 tests=[AWL=0.101] X-Spam-Score: 0.101 X-Spam-Level: X-Archive-Number: 200603/617 X-Sequence-Number: 18054 On Thu, Mar 30, 2006 at 02:59:02PM +0200, Peter Eisentraut wrote: >> Well, it's logical enough; it scans along activity_id until it finds one >> with state=10000 or state=10001. You obviously have a _lot_ of records with >> low activity_id and state none of these two, so Postgres needs to scan all >> those records before it founds 100 it can output. This is the “startup >> cost” you're seeing. > The startup cost is the cost until the plan is set up to start outputting > rows. It is not the time until the first row is found. Well, point, my terminology was wrong. Still, what you're seeing is endless scanning for the first row. I don't know your distribution, but are you really sure state wouldn't have better selectivity? /* Steinar */ -- Homepage: http://www.sesse.net/