Re: [GENERAL] Except operation

From: Adriaan Joubert <a(dot)joubert(at)albourne(dot)com>
To: Satyajeet Seth <csa98016(at)cse(dot)iitd(dot)ernet(dot)in>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Except operation
Date: 1999-12-02 06:42:10
Message-ID: 384614C2.5D11E898@albourne.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Satyajeet Seth wrote:
>
> Hi
> The query:
> select * from webdata except select * from webdata1;
> takes abysmally long .How can I optimise it?
> The particulars are:

You could try

select * from webdata w
where not exists
(select * from webdata1 w1
where w1.tid=w.tid
...
)

If you have the correct indexes on webdata1 this can be quite fast.

Adriaan

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Fabian.Frederick 1999-12-02 08:56:39 [GENERAL] DB Statistics
Previous Message Lincoln Yeoh 1999-12-02 01:40:32 Re: [GENERAL] Re: pgsql-general-digest V1 #550