Re: Help understanding indexes, explain, and optimizing - Mailing list pgsql-performance

From i.v.r.
Subject Re: Help understanding indexes, explain, and optimizing
Date
Msg-id 440CEBE3.6030004@gmail.com
Whole thread Raw
In response to Re: Help understanding indexes, explain, and optimizing  (Chris <dmagick@gmail.com>)
List 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 by date:

Previous
From: Chris
Date:
Subject: Re: Help understanding indexes, explain, and optimizing
Next
From: Michael Fuhr
Date:
Subject: Re: Can anyone explain this pgbench results?