pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurent Martelli <laurent@aopsys.com>
To: pgsql-sql@postgresql.org
Subject: optimizing select ... not in (select ...)
Date: 13 Aug 2001 15:17:23 +0200
Message-ID: <87bslkayl8.fsf@lolo.aopsys> (raw)

I have this query :

select distinct on (Pictures.PictureID) * from Pictures where Pictures.PictureID not in (select distinct PictureID from Keywords);

and I find it a bit slow. Does anybody have suggestions to run this
faster ? (I have indexes on PictureID on both Pictures and Keywords) 

-- 
Laurent Martelli
laurent@aopsys.com              http://www.bearteam.org/~laurent/



view thread (5+ messages)  latest in thread

Message-ID: <87bslkayl8.fsf@lolo.aopsys>
Permalink:  ../87bslkayl8.fsf@lolo.aopsys/
Also on:    postgresql.org/message-id/87bslkayl8.fsf@lolo.aopsys

 · 

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: laurent@aopsys.com
  Subject: Re: optimizing select ... not in (select ...)
  In-Reply-To: <87bslkayl8.fsf@lolo.aopsys>

* 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