X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 275E7D1B43A for ; Sat, 20 Dec 2003 04:39:55 +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 23535-08 for ; Sat, 20 Dec 2003 00:39:05 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 87474D1B482 for ; Sat, 20 Dec 2003 00:39:04 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id hBK4d319014303; Fri, 19 Dec 2003 23:39:03 -0500 (EST) To: "A.Bhuvaneswaran" Cc: pgsql-admin@postgresql.org Subject: Re: Index is not used In-reply-to: <1071894514.1380.1.camel@Bhuvan.bksys.co.in> References: <1071894514.1380.1.camel@Bhuvan.bksys.co.in> Comments: In-reply-to "A.Bhuvaneswaran" message dated "Sat, 20 Dec 2003 09:58:35 +0530" Date: Fri, 19 Dec 2003 23:39:03 -0500 Message-ID: <14302.1071895143@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/282 X-Sequence-Number: 11788 "A.Bhuvaneswaran" writes: > I have a table and an index on it. The index is used when i use '=3D' > operator for the indexed field in the where condition. But the index is > not used when i use '>=3D' operator for the same field. Unsurprising. An inequality condition may require fetching many rows (the planner is estimating 336289 rows here...) and so an indexscan is not necessarily quicker. Have you compared actual runtimes with enable_seqscan on and off? regards, tom lane