Re: Question about index scan vs seq scan when using count()

Поиск
Список
Период
Сортировка
От Andrew Sullivan
Тема Re: Question about index scan vs seq scan when using count()
Дата
Msg-id 20060223224723.GG11392@phlogiston.dyndns.org
обсуждение исходный текст
Ответ на Re: Question about index scan vs seq scan when using count()  ("Kashmira Patel \(kupatel\)" <kupatel@cisco.com>)
Список pgsql-sql
On Thu, Feb 23, 2006 at 02:25:34PM -0800, Kashmira Patel (kupatel) wrote:
> 
> [Kashmira] I did do an EXPLAIN ANALYZE as well, it also showed a
> sequential scan. The table has about 600+ rows, with around 6 of them
> matching the given id. Wouldn't an index scan be faster in this case?

EXPLAIN ANALYSE will always choose the same plan as EXPLAIN.  The
difference is that it shows you the estimate and actual.

I am surprised you're getting a seqscan for that, though.  Is there
something about the index you're not telling us?  

Is your system tuned correctly?  Maybe 600 rows is so small that a
seqscan's just as fast.

A

-- 
Andrew Sullivan  | ajs@crankycanuck.ca
"The year's penultimate month" is not in truth a good way of saying
November.    --H.W. Fowler


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

Предыдущее
От: "Kashmira Patel \(kupatel\)"
Дата:
Сообщение: Re: Question about index scan vs seq scan when using count()
Следующее
От: "Kashmira Patel \(kupatel\)"
Дата:
Сообщение: Re: Question about index scan vs seq scan when using count()