Re: left outer join terrible slow compared to inner join

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Clay Luther" <claycle(at)cisco(dot)com>
Cc: "Sean Chittenden" <sean(at)chittenden(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: left outer join terrible slow compared to inner join
Date: 2003-08-28 19:52:47
Message-ID: 14088.1062100367@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Clay Luther" <claycle(at)cisco(dot)com> writes:
> Here is the output of the above explain analyze execution:

Given the presence of this sort of thing:

> -> Nested Loop (cost=1.15..17157470797.64 rows=1229 width=1976) (actual time=2723.56..104804.55 rows=1780 loops=1)
> Join Filter: (("inner".tkservice = 11) AND ("inner".paramname = 'DefaultNetworkLocale'::character varying))

I think you are running into 7.3's inability to determine that certain
outer joins can be simplified to regular joins (specifically, if there
is a strict operator above the OUTER JOIN that will reject null-extended
rows, then there's no need to generate null-extended rows at all).

7.4 should do better.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Nigel J. Andrews 2003-08-28 20:09:56 Re: Let's see if this helps ... more anti-virus/anti-spam
Previous Message Lanette Miller 2003-08-28 19:37:09 Re: Problems with transactions and sequences