pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Laurent Martelli <laurent.martelli@enercoop.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: IS NOT NULL and LEFT JOIN
Date: Mon, 20 Oct 2014 09:58:08 -0400
Message-ID: <3181.1413813488@sss.pgh.pa.us> (raw)
In-Reply-To: <5444D5FF.5070407@enercoop.org>
References: <544339CA.5090202@enercoop.org>
	<CAApHDvoqMm-hdoktQ+9ErGZ3rkF6=vgeHTJ-M6OeQepr1XLDoQ@mail.gmail.com>
	<5444D5FF.5070407@enercoop.org>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

Laurent Martelli <laurent.martelli@enercoop.org> writes:
> Do we agree that both queries are identical ?

No, they *aren't* identical.  Go consult any SQL reference.  Left join
conditions don't work the way you seem to be thinking: after the join,
the RHS column might be null, rather than equal to the LHS column.

			regards, tom lane


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (9+ messages)  latest in thread

Message-ID: <3181.1413813488@sss.pgh.pa.us>
Permalink:  ../3181.1413813488@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3181.1413813488@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, laurent.martelli@enercoop.org
  Subject: Re: IS NOT NULL and LEFT JOIN
  In-Reply-To: <3181.1413813488@sss.pgh.pa.us>

* 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