Re: SQL question - problem with INTERSECT - Mailing list pgsql-general

From hubert depesz lubaczewski
Subject Re: SQL question - problem with INTERSECT
Date
Msg-id 20001102144449.A7284@gruby
Whole thread Raw
In response to SQL question - problem with INTERSECT  ("Keith L. Musser" <kmusser@idisys.com>)
List pgsql-general
On Thu, Nov 02, 2000 at 06:50:07AM -0500, Keith L. Musser wrote:
> > upper(a.word) = 'JIM' or upper(a.word) = 'JONES'
> > upper(s.word) = 'HELLO' or upper(s.word) = 'THERE'
> Interesting possibility.  Unfortunately, the outer select ends up being
> a sequential scan over the entire messages table, where at each row the
> message id is looked up sequentially in the nested query.

did you try my quesry with "upper's" in it?
if so then is your index on a.word or on upper(a.word)?
try making functional indies, and of course vacuum'im tables to make indices
work.
this query *should* work with indices.

depesz

--
hubert depesz lubaczewski
------------------------------------------------------------------------
     najwspanialszą rzeczą jaką dało nam nowoczesne społeczeństwo,
      jest niesamowita wręcz łatwość unikania kontaktów z nim ...

pgsql-general by date:

Previous
From: Andy Corteen
Date:
Subject: Re[2]: autostart postgresql
Next
From: Justin Foster
Date:
Subject: Memory Leak