Re: explain plan

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: explain plan
Дата
Msg-id 2458.981226948@sss.pgh.pa.us
обсуждение исходный текст
Ответ на explain plan  (rudy <rudy@heymax.com>)
Список pgsql-novice
rudy <rudy@heymax.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

В списке pgsql-novice по дате отправления:

Предыдущее
От: Nabil Sayegh
Дата:
Сообщение: CUG
Следующее
От: Francisco Reyes
Дата:
Сообщение: Re: CUG