Re: Index scan startup time

Поиск
Список
Период
Сортировка
От Michael Stone
Тема Re: Index scan startup time
Дата
Msg-id 20060330124251.GK6811@mathom.us
обсуждение исходный текст
Ответ на Re: Index scan startup time  ("Steinar H. Gunderson" <sgunderson@bigfoot.com>)
Ответы Re: Index scan startup time
Список pgsql-performance
On Thu, Mar 30, 2006 at 02:31:34PM +0200, Steinar H. Gunderson wrote:
>Well, it's logical enough; it scans along activity_id until it finds one with
>state=10000 or state=10001. You obviously have a _lot_ of records with low
>activity_id and state none of these two, so Postgres needs to scan all those
>records before it founds 100 it can output. This is the “startup cost” you're
>seeing.

Yes. And the estimates are bad enough (orders of magnitude) that I can't
help but wonder whether pg could come up with a better plan with better
statistics:

>>>>   ->  Index Scan using activity_pk on activity  (cost=0.00..40717259.91 rows=6538650 width=8) (actual
time=207356.050..207356.722rows=100 loops=1) Filter: ((state = 10000) OR (state = 10001)) 

Mike Stone

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

Предыдущее
От: Markus Schaber
Дата:
Сообщение: Re: Index scan startup time
Следующее
От: "Steinar H. Gunderson"
Дата:
Сообщение: Re: Index scan startup time