improve 'where not exists' query.. - Mailing list pgsql-general

From Noel Whelan
Subject improve 'where not exists' query..
Date
Msg-id 1eb3081c0510251346w76949a22oa9b7a1232d71c823@mail.gmail.com
Whole thread Raw
Responses Re: improve 'where not exists' query..  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-general
I'm wondering if there's an ideal way to improve the efficiency of this query:

SELECT i.id FROM items i 
WHERE (NOT (EXISTS (SELECT c.id
FROM contacts c WHERE (c.id = i.id))));

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

pgsql-general by date:

Previous
From: Oliver Elphick
Date:
Subject: Re: Why different execution times for different instances for the
Next
From: Bob Pawley
Date:
Subject: Getting Stated