Re: "not in" clause too slow?

From: Ottavio Campana <ottavio(at)campana(dot)vi(dot)it>
To: Alban Hertroys <a(dot)hertroys(at)magproductions(dot)nl>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: "not in" clause too slow?
Date: 2007-09-25 08:47:16
Message-ID: 46F8CB14.5020705@campana.vi.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alban Hertroys ha scritto:
> Ottavio Campana wrote:
>> 2) how can I speed it up? by using indexes? or by changing the query?
>
> Do you have indices on mytable.id and copy_mytable.id?
> Does using NOT EXISTS get you any better results?

Eventually I had to select not all the table fields but only the primary
key and successively loop on the table again. Thus I've been able to
exploit the indexes.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2007-09-25 08:59:09 Re: "not in" clause too slow?
Previous Message Devrim GÜNDÜZ 2007-09-25 08:07:37 Re: PgpoolAdmin installation