optimizing select ... not in (select ...)

From: Laurent Martelli <laurent(at)aopsys(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: optimizing select ... not in (select ...)
Date: 2001-08-13 13:17:23
Message-ID: 87bslkayl8.fsf@lolo.aopsys
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)aopsys(dot)com http://www.bearteam.org/~laurent/

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message agutier 2001-08-13 13:43:18 Re: REFERENCES constraint
Previous Message Laurent Martelli 2001-08-13 13:13:17 Re: Donations?