Re: Index Scan taking long time

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: Index Scan taking long time
Дата
Msg-id dcc563d10906162212m79c762cbi45292ea0c33e9a86@mail.gmail.com
обсуждение исходный текст
Ответ на Index Scan taking long time  (Bryce Ewing <bryce@smx.co.nz>)
Ответы Re: Index Scan taking long time  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
On Tue, Jun 16, 2009 at 9:30 PM, Bryce Ewing<bryce@smx.co.nz> wrote:
> Hi,
>
> I have been trying to fix a performance issue that we have which I have
> tracked down to index scans being done on a particular table (or set of
> tables):
>
> The following query:
> explain analyze select *
> FROM inbound.event_20090526 e
> LEFT OUTER JOIN inbound.internal_host i ON (e.mta_host_id = i.id)
> LEFT OUTER JOIN inbound.internal_host iaa ON (e.aamta_host_id = iaa.id)
> LEFT OUTER JOIN inbound.event_status es ON (e.event_status_id = es.id)
> LEFT OUTER JOIN inbound.threat t ON (e.threat_id = t.id), inbound.domain d,
> inbound.event_type et
> WHERE e.domain_id = d.id
> AND e.event_type_id = et.id
> AND d.name IN (
>   'testdomain.com'
> );

Without looking at the explain just yet, it seems to me that you are
constraining the order of joins to insist that the left joins be done
first, then the regular joins second, because of your mix of explicit
and implicit join syntax.  The query planner is constrained to run
explicit joins first, then implicit if I remember correctly.  So,
making it all explicit might help.  Might not.  But it's a thought

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Yet another slow nested loop
Следующее
От: Alan Li
Дата:
Сообщение: 8.4 COPY performance regression on Solaris