pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim C. Nasby <jnasby@pervasive.com>
To: Ott? Havasv?lgyi <havasvolgyi.otto@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Throwing unnecessary joins away
Date: Fri, 13 Jan 2006 18:22:05 -0600
Message-ID: <20060114002205.GP9017@pervasive.com> (raw)
In-Reply-To: <34608c0c0601121051r52c707f6l@mail.gmail.com>
References: <34608c0c0601120418n1af567b9n@mail.gmail.com>
	<43C64CFB.9030504@barettadeit.com>
	<34608c0c0601120541wd910da3s@mail.gmail.com>
	<5269.1137081233@sss.pgh.pa.us>
	<34608c0c0601120900l7d26073dp@mail.gmail.com>
	<1137085382.3959.16.camel@state.g2switchworks.com>
	<34608c0c0601121051r52c707f6l@mail.gmail.com>

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



view thread (10+ messages)

Message-ID: <20060114002205.GP9017@pervasive.com>
Permalink:  ../20060114002205.GP9017@pervasive.com/
Also on:    postgresql.org/message-id/20060114002205.GP9017@pervasive.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: jnasby@pervasive.com, havasvolgyi.otto@gmail.com
  Subject: Re: Throwing unnecessary joins away
  In-Reply-To: <20060114002205.GP9017@pervasive.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox