Re: Chaotically weird execution plan

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Chaotically weird execution plan
Дата
Msg-id 17587.1222225090@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Chaotically weird execution plan  (Einars <einars@gmail.com>)
Ответы Re: Chaotically weird execution plan  ("Scott Carey" <scott@richrelevance.com>)
Список pgsql-performance
Einars <einars@gmail.com> writes:
> When displaying information about information about an user in our
> site, I noticed an unreasonable slowdown. The culprit turned out to be
> a trivial select, which determines the number of comments left by an
> user:

I don't see anything even slightly wrong here.  Your first example pulls
15888 rows from the table in 13134 ms.  Your second example pulls 3
rows from the table in 0.121 ms --- which I rather imagine is because
those three rows are already in cache; it would take a lot longer if it
actually had to go to disk several times.

The planner's rowcount estimates are on target and it appears to be
choosing appropriate plans in each case.  It just takes longer to
process 5000 times as many rows ...

            regards, tom lane

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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: Chaotically weird execution plan
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Chaotically weird execution plan