Re: Force a merge join?

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Doug Fields <dfields-pg-general(at)pexicom(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Force a merge join?
Date: 2002-05-16 01:00:07
Message-ID: 20020516110007.A16632@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2002-05-16 01:01:14 Re: Help Please on partial index
Previous Message jtv 2002-05-16 00:20:59 Re: [INTERFACES] C & C ++Program Problem