Re: Force a merge join? - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Force a merge join?
Date
Msg-id 20020516110007.A16632@svana.org
Whole thread Raw
In response to Force a merge join?  (Doug Fields <dfields-pg-general@pexicom.com>)
Responses Re: Force a merge join?
Re: Force a merge join?
List pgsql-general
On Wed, May 15, 2002 at 03:31:30PM -0400, Doug Fields wrote:

[Much snipped about mergejoins]

>         AND LOWER(a.email) = LOWER(b.email);

There's your problem. You're not comparing the two columns, you're comparing
the two columns after running through a function, so it can't use the index.

Try creating an index on LOWER(email) instead of just email.

HTH,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Canada, Mexico, and Australia form the Axis of Nations That
> Are Actually Quite Nice But Secretly Have Nasty Thoughts About America

pgsql-general by date:

Previous
From: Sean Chittenden
Date:
Subject: Should be easy enough to get this result (or is it possible?)...
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Help Please on partial index