By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,661 Members | 1,330 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,661 IT Pros & Developers. It's quick & easy.

Index Usage Question

P: n/a
Hi,
I created a simple table (name char200, zip char10, city char200, street char200, id int) and filled some data, appr. 250 000 records, in it.
I tested accessing some rows (select id from address where id = 44444;, select * from address where id between 33333, 333444) with an unique index on id and without an index. EXPLAIN tells me in both cases that it does NOT use the index.
I tested this with using the name column (select name from address where name like 'Wal%';, select name from address where name = 'Walz') and if I created an index on name it uses it.
Using id in the where clause of the select is as slow as using an unindexed name in the where-clause.
I ran ANALYZE, no changes.
What's this ?
This is not a feature, is it ?

Thanks for any hints or explanations
Ciao
Alexander

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Fri, 24 Oct 2003, Staff, Alexander wrote:
Hi,
I created a simple table (name char200, zip char10, city char200, street char200, id int) and filled some data, appr. 250 000 records, in it.
I tested accessing some rows (select id from address where id = 44444;, select * from address where id between 33333, 333444) with an unique index on id and without an index. EXPLAIN tells me in both cases that it does NOT use the index.
I tested this with using the name column (select name from address where name like 'Wal%';, select name from address where name = 'Walz') and if I created an index on name it uses it.
Using id in the where clause of the select is as slow as using an unindexed name in the where-clause.
I ran ANALYZE, no changes.
What's this ?
This is not a feature, is it ?


Can we see the output of explain analyze select...(your query here)???
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.