improve 'where not exists' query..

From: Noel Whelan <noel(dot)whelan(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: improve 'where not exists' query..
Date: 2005-10-25 20:46:52
Message-ID: 1eb3081c0510251346w76949a22oa9b7a1232d71c823@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm wondering if there's an ideal way to improve the efficiency of this
query:

SELECT i.id <http://i.id> FROM items i
WHERE (NOT (EXISTS (SELECT c.id <http://c.id>
FROM contacts c WHERE (c.id <http://c.id> = i.id <http://i.id>))));

It takes a while to execute, clearly. Thank you,

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Janning Vygen 2005-10-25 20:49:10 Re: the best way to catch table modification
Previous Message Oliver Elphick 2005-10-25 20:33:32 Re: Why different execution times for different instances for the