pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Marlowe <smarlowe@g2switchworks.com>
To: Exner, Peter <Exner@his.de>
Cc: Richard Broersma Jr <rabroersma@yahoo.com>
Cc: SQL Postgresql List <pgsql-sql@postgresql.org>
Subject: Re: How to find entries missing in 2nd table?
Date: Wed, 12 Jul 2006 13:13:18 -0500
Message-ID: <1152727998.14241.24.camel@state.g2switchworks.com> (raw)
In-Reply-To: <507847EF2B23D748BAC77799DA52D0EC6FD63F@mailbox.his.de>
References: <507847EF2B23D748BAC77799DA52D0EC6FD63F@mailbox.his.de>

On Wed, 2006-07-12 at 03:06, Exner, Peter wrote:
> Hi, 
> 
> what about
> 
> SELECT controller_id FROM control
> WHERE controller_id NOT IN
> (SELECT DISTINCT controller_id FROM datapack);

That one works too, but it's generally not as fast as the left join / is
null query on large tables.  Give the two a try on a test set and you
should see the speed difference.



view thread (13+ messages)  latest in thread

Message-ID: <1152727998.14241.24.camel@state.g2switchworks.com>
Permalink:  ../1152727998.14241.24.camel@state.g2switchworks.com/
Also on:    postgresql.org/message-id/1152727998.14241.24.camel@state.g2switchworks.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-sql@postgresql.org
  Cc: smarlowe@g2switchworks.com, Exner@his.de, rabroersma@yahoo.com
  Subject: Re: How to find entries missing in 2nd table?
  In-Reply-To: <1152727998.14241.24.camel@state.g2switchworks.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