Re: [GENERAL] Except operation

From: <kaiq(at)realtyideas(dot)com>
To: Adriaan Joubert <a(dot)joubert(at)albourne(dot)com>
Cc: Satyajeet Seth <csa98016(at)cse(dot)iitd(dot)ernet(dot)in>, pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Except operation
Date: 1999-12-02 17:07:23
Message-ID: Pine.LNX.4.10.9912021103300.21346-100000@picasso.realtyideas.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

how about I'm a sql92 lover? :-)

the idea is to use index. but the engine only use index when it sees
"where". so, how about add "where w.tid = w.tid" to the first (or
both) select on the two sides of the except?

not tested. if work, please let us know, thanks.

Kai
On Thu, 2 Dec 1999, Adriaan Joubert wrote:

> 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 Bruce Momjian 1999-12-02 17:44:27 Re: [GENERAL] Upper/lower case passwords
Previous Message Mark Jewiss 1999-12-02 16:48:34 Upper/lower case passwords