Re: Help understanding indexes, explain, and optimizing

Поиск
Список
Период
Сортировка
От i.v.r.
Тема Re: Help understanding indexes, explain, and optimizing
Дата
Msg-id 440CEBE3.6030004@gmail.com
обсуждение исходный текст
Ответ на Re: Help understanding indexes, explain, and optimizing  (Chris <dmagick@gmail.com>)
Список pgsql-performance
Chris escribió:
> Have you done an 'analyze' or 'vacuum analyze' over these tables?
>
> A left outer join gets *everything* from the second table:
>
> > LEFT OUTER JOIN groups ON groups.id = locations.group_id
> > LEFT OUTER JOIN schools ON schools.location_id = locations.id
>
> So they will load everything from groups and schools. Maybe they
> should be left join's not left outer joins?
>
>
Yes, I did that. I tried your other suggestion and it did improve it by
about 200ms.

I also repurposed the query by selecting first from the groups table and
joining with the locations and schools tables, and that made all the
difference. Now it's down to
32ms. Yipee!

Thanks!

Ivan V.


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

Предыдущее
От: Chris
Дата:
Сообщение: Re: Help understanding indexes, explain, and optimizing
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: Can anyone explain this pgbench results?