explain plan

Поиск
Список
Период
Сортировка
От rudy
Тема explain plan
Дата
Msg-id 3A771B18.A5826279@heymax.com
обсуждение исходный текст
Ответы 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>)
Список 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 по дате отправления:

Предыдущее
От: Andrew McMillan
Дата:
Сообщение: Re: Slow date comparison
Следующее
От: Andrew McMillan
Дата:
Сообщение: Re: truncated numeric data