Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Index perfomance when using function within SQL
Tue, Mar 4 2008 1:19 PMPermanent Link

"Halim Boumedjirek"
Consider the following queries:
Select * from "customer" where "email"='MYEMAIL@DOMAIN>COM'
and
Select * from "customer" where UPPER(email)='MYEMAIL@DOMAIN.COM'

As you can see, the only difference is the UPPER function. Also, the
customer table has an index on the email field.

I tested both queries and I found out that the second query is not using any
index. it takes forver to execute. What should I do to speed it up?
Please note that I tried to set my index case-ins property to true. It gave
me the same results.

Thank you,
-Halim

Tue, Mar 4 2008 2:40 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Halim,

<< I tested both queries and I found out that the second query is not using
any index. it takes forver to execute. What should I do to speed it up?
Please note that I tried to set my index case-ins property to true. It gave
me the same results. >>

Use this query with a case-insensitive index in order to have it be
optimized:

Select * from "customer" where UPPER(email)=UPPER('MYEMAIL@DOMAIN.COM')

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Mar 4 2008 2:44 PMPermanent Link

"Halim Boumedjirek"
That did it.
Thank you,
-Halim
"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote in message
news:DA2FB2B9-051B-4902-9EF7-F2B27C48677B@news.elevatesoft.com...
> Halim,
>
> << I tested both queries and I found out that the second query is not
> using any index. it takes forver to execute. What should I do to speed it
> up? Please note that I tried to set my index case-ins property to true. It
> gave me the same results. >>
>
> Use this query with a case-insensitive index in order to have it be
> optimized:
>
> Select * from "customer" where UPPER(email)=UPPER('MYEMAIL@DOMAIN.COM')
>
> --
> Tim Young
> Elevate Software
> www.elevatesoft.com
>

Image