From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Laurent Martelli <laurent@aopsys.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: optimizing select ... not in (select ...)
Date: Mon, 13 Aug 2001 11:59:48 -0400 (EDT)
Message-ID: <200108131559.f7DFxmS19276@candle.pha.pa.us> (raw)
In-Reply-To: <87bslkayl8.fsf@lolo.aopsys>
Can it be redone using NOT EXISTS?
> 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/
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
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: pgman@candle.pha.pa.us, laurent@aopsys.com
Subject: Re: optimizing select ... not in (select ...)
In-Reply-To: <200108131559.f7DFxmS19276@candle.pha.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