Re: "not in" clause too slow?

From: Rodrigo De León <rdeleonp(at)gmail(dot)com>
To: "Ottavio Campana" <ottavio(at)campana(dot)vi(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: "not in" clause too slow?
Date: 2007-09-21 14:19:54
Message-ID: a55915760709210719k1202df02u29542bd05b8f9652@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 9/21/07, Ottavio Campana <ottavio(at)campana(dot)vi(dot)it> wrote:
> My problem is that if I run the same command on another
> table with 378415 rows, it is terribly slow.

How much is "terribly slow"?

Did you VACUUM ANALYZE?

Anyways, try this:

SELECT * FROM MYTABLE T1
LEFT JOIN COPY_MYTABLE T2
ON T1.ID = T2.ID
WHERE T2.ID IS NULL

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2007-09-21 14:26:26 Re: autovacuum
Previous Message Ciprian Dorin Craciun 2007-09-21 14:17:20 Re: Using RETURNING with INTO inside pgsql