X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1870632ABFF for ; Fri, 22 Oct 2004 07:04:28 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 97427-09 for ; Fri, 22 Oct 2004 06:04:16 +0000 (GMT) Received: from mail.in2m.com (unknown [67.139.235.83]) by svr1.postgresql.org (Postfix) with ESMTP id 7C22A32A6BE for ; Fri, 22 Oct 2004 07:04:20 +0100 (BST) Received: by mail.in2m.com (Postfix, from userid 501) id 0AE9B576C6; Fri, 22 Oct 2004 00:04:20 -0600 (MDT) Received: from Unforgiven (dialpool-210-214-107-177.maa.sify.net [210.214.107.177]) by mail.in2m.com (Postfix) with ESMTP id 9DCB05769A; Fri, 22 Oct 2004 00:04:18 -0600 (MDT) Date: Fri, 22 Oct 2004 11:40:07 +0530 (IST) From: Anshaj X-X-Sender: anshaj@Unforgiven To: anshaj@in2m.com Cc: pgsql-admin@postgresql.org Subject: indexes are not working for In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_RFCI X-Spam-Level: X-Archive-Number: 200410/301 X-Sequence-Number: 15294 Dear group, I have a table foo anshajdb=# \d foo Table "public.foo" Column | Type | Modifiers ---------+-------------------+----------- snumber | numeric(18,0) | test | character varying | Indexes: "snum_idx" btree (snumber) when I try to do a query like explain analyze select * from foo where snumber > 1000; Seq Scan on foo (cost=0.00..69.00 rows=320 width=391) (actual time=0.011..0.721 rows=323 loops=1) Filter: (snumber > 1000::numeric) Total runtime: 0.979 ms (3 rows) It do a sequence scan on table. Why it is not using the snum_idx in this query. Do I need to change some setting or indexes don't work on this types of query. Thanks and Regards Anshaj -- "Normal people believe that if it ain't broke, don't fix it. Engineers believe that if it ain't broke, it doesn't have enough features yet."