Re: what is the cause that scan type is showing as 'seq scan' after indexing

Поиск
Список
Период
Сортировка
От Ross J. Reedstrom
Тема Re: what is the cause that scan type is showing as 'seq scan' after indexing
Дата
Msg-id 20030126164418.GB20331@wallace.ece.rice.edu
обсуждение исходный текст
Ответ на what is the cause that scan type is showing as 'seq scan' after indexing  ("shreedhar" <shreedhar@lucidindia.net>)
Список pgsql-admin
On Sun, Jan 26, 2003 at 06:31:50PM +0530, shreedhar wrote:
> Hi All,
>
> Before indexing query plan was showing cost as 40.00, after indexing query
> plan again showing as 'seq scan' and cost as 3060.55.
> The field which i indexed is primary key to this table.
> May i know
> 1) what is the cause that scan type is showing as 'seq scan' after indexing
> also
> 2) why it is showing cost as high value compare to previous.

You trimmed out the other parts of the EXPLAIN, so I'm just guessing,
but that cost seems suspiciously round: I'm guessing that you haven't
run VACUUM ANALYZE at all. One thing indexing does is update the 'number
of tuples' statistic. See the archives for why sequential scans still
show up (short answer: index scans aren't free, so at some point, it's
cheaper to scan the entire table than to scan both the index and the
subset of the table returned)

Ross

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

Предыдущее
От: "shreedhar"
Дата:
Сообщение: what is the cause that scan type is showing as 'seq scan' after indexing
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Password Encryption