Re: Query only slow on first run

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Query only slow on first run
Дата
Msg-id 2224.1196269972@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Query only slow on first run  ("Dave Dutcher" <dave@tridecap.com>)
Список pgsql-performance
"Dave Dutcher" <dave@tridecap.com> writes:
> ... According to the explain analyze
> there are only 646 rows in posts which match your criteria, so it does seem
> like scanning posts first might be the right thing to do.

No, that's not right.  What the output actually shows is that only 646
posts rows were needed to produce the first 200 aggregate rows, which was
enough to satisfy the LIMIT.  The planner is evidently doing things this
way in order to exploit the presence of the LIMIT --- if it had to
compute all the aggregate results it would likely have picked a
different plan.

            regards, tom lane

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

Предыдущее
От: "Usama Munir Dar"
Дата:
Сообщение: Re: Training Recommendations
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: TB-sized databases