Re: Throwing unnecessary joins away - Mailing list pgsql-performance

From Jim C. Nasby
Subject Re: Throwing unnecessary joins away
Date
Msg-id 20060114002205.GP9017@pervasive.com
Whole thread Raw
In response to Re: Throwing unnecessary joins away  (Ottó Havasvölgyi <havasvolgyi.otto@gmail.com>)
List pgsql-performance
On Thu, Jan 12, 2006 at 07:51:22PM +0100, Ott? Havasv?lgyi wrote:
> Hi,
>
> If the join is to a primary key or notnull unique column(s), then
> inner join is also ok. But of course left join is the simpler case.
> An example:

Actually, you need both the unique/pk constraint, and RI (a fact I
missed in the email I just sent). Nullability is another consideration
as well. But there certainly are some pretty common cases that can be
optimized for.
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

pgsql-performance by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: Throwing unnecessary joins away
Next
From: Tom Lane
Date:
Subject: Re: Stable function being evaluated more than once in a single query