From: Anshaj <anshaj@in2m.com>
To: anshaj@in2m.com
Cc: pgsql-admin@postgresql.org
Subject: indexes are not working for
Date: Fri, 22 Oct 2004 11:40:07 +0530 (IST)
Message-ID: <Pine.LNX.4.44.0410221037000.5072-100000@Unforgiven> (raw)
In-Reply-To: <Pine.LNX.4.61.0410210905320.28988@emo.org.tr>
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."
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: anshaj@in2m.com
Subject: Re: indexes are not working for
In-Reply-To: <Pine.LNX.4.44.0410221037000.5072-100000@Unforgiven>
References: <Pine.LNX.4.61.0410210905320.28988@emo.org.tr> <Pine.LNX.4.44.0410221037000.5072-100000@Unforgiven>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox