explain plan - Mailing list pgsql-novice

From rudy
Subject explain plan
Date
Msg-id 3A771B18.A5826279@heymax.com
Whole thread Raw
Responses Re: explain plan  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: explain plan  (Francisco Reyes <fran@reyes.somos.net>)
Re: explain plan  (Francisco Reyes <fran@reyes.somos.net>)
List pgsql-novice
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



pgsql-novice by date:

Previous
From: Andrew McMillan
Date:
Subject: Re: Slow date comparison
Next
From: Andrew McMillan
Date:
Subject: Re: truncated numeric data