rudy <rudy(at)heymax(dot)com> writes:
> 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)
> This table has 20,000 records.
It does? Given that cost estimate for a sequential scan, I don't
believe the table could have more than one page or more than
fifty records. What do you get from
select relpages, reltuples from pg_class where relname = 'article';
> Why doesn't it use the Index I created?
Because it thinks the seqscan is cheaper.
regards, tom lane