X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id B78B9D1B4B5 for ; Fri, 13 Feb 2004 05:38:25 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 50161-03 for ; Fri, 13 Feb 2004 01:38:24 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 7FE2FD1B456 for ; Fri, 13 Feb 2004 01:38:23 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i1D5cMg8028007; Fri, 13 Feb 2004 00:38:22 -0500 (EST) To: "David Witham" Cc: pgsql-sql@postgresql.org Subject: Re: Index question In-reply-to: References: Comments: In-reply-to "David Witham" message dated "Fri, 13 Feb 2004 13:30:10 +1100" Date: Fri, 13 Feb 2004 00:38:22 -0500 Message-ID: <28006.1076650702@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/133 X-Sequence-Number: 16824 "David Witham" writes: > I understand that selecting count(*) will involve a scan at some > stage, but I was surprised that the index wasn't used in the >= case, > but was used in the between case. Given the estimated row counts in your examples, the planner's choices are not surprising. You have not given us any information on whether those estimates are accurate. regards, tom lane