Received: from anchor-post-30.mail.demon.net (anchor-post-30.mail.demon.net [194.217.242.88]) by postgresql.org (Postfix) with ESMTP id F32C7475A34 for ; Fri, 22 Feb 2002 14:29:25 -0500 (EST) Received: from lfix.demon.co.uk ([158.152.59.127] helo=linda.lfix.co.uk) by anchor-post-30.mail.demon.net with esmtp (Exim 3.34 #1) id 16eLNl-000PqE-0U; Fri, 22 Feb 2002 19:29:25 +0000 Received: from localhost ([127.0.0.1] helo=localhost.localdomain ident=olly) by linda.lfix.co.uk with esmtp (Exim 3.34 #1 (Debian)) id 16eLR8-0007ce-00; Fri, 22 Feb 2002 19:32:54 +0000 Subject: Re: How does Index Scan get used From: Oliver Elphick To: Oliver Elphick Cc: "Samuel J. Sutjiono" , pgsql-sql@postgresql.org In-Reply-To: <1014401308.13240.2302.camel@linda> References: <018a01c1bbaf$befb84b0$110a010a@headquarters.wcgroup.com> <1014401308.13240.2302.camel@linda> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Evolution/1.0.2 Date: 22 Feb 2002 19:32:53 +0000 Message-Id: <1014406374.13241.2406.camel@linda> Mime-Version: 1.0 X-Archive-Number: 200202/324 X-Sequence-Number: 6746 On Fri, 2002-02-22 at 18:08, Oliver Elphick wrote: > PostgreSQL thinks there are only 10 rows in the table. Therefore it > will not choose an index scan because for so few rows it is bound to be > more expensive than a sequential scan. But then I saw Tom's mail saying that it does use the index. How is that? Surely these few values would all be brought in in one single disk read? -- Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C "The LORD bless thee, and keep thee; The LORD make his face shine upon thee, and be gracious unto thee; The LORD lift up his countenance upon thee, and give thee peace." Numbers 6:24-26