Running Red Hat 7.0 kernel 2.2.16
PostgreSQL 7.0.3
skyy=# create unique index article_pkey on article (id_article);
CREATE
skyy=# explain select id_article from article where id_article = 21;
NOTICE: QUERY PLAN:
Seq Scan on article (cost=0.00..1.61 rows=1 width=8)
EXPLAIN
skyy=# vacuum analyze article;
VACUUM
skyy=# explain select id_article from article where id_article = 21;
NOTICE: QUERY PLAN:
Seq Scan on article (cost=0.00..1.61 rows=1 width=8)
EXPLAIN
skyy=#
This table has 20,000 records. What am I doing wrong? Why doesn't it use
the Index I created? Is there something I need to enable, why wouldn't
it choose an index over a seq scan with more than 20,000 rows to scan?
Thanks In Advance,
Rudy Laczkovich