Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: rtrim() performance nightmare???

Re: rtrim() performance nightmare???

From: John Oliver <John_at_yellowstone.co.uk>
Date: Fri, 18 Sep 1998 09:12:43 +0100
Message-ID: <360215FB.C27D79B3@yellowstone.co.uk>


InfoTech Consulting, Inc. wrote:
>
> I was testing the performance of a query today and noticed the following
> query took a LONG TIME to run (when using rtrim() function):
>
> SELECT field1, field2
> FROM table_a
> WHERE field3 = 'value' and
> rtrim(field4) = 'value'
>
> Thanks,
> Dave Morse

Any function used in this way will prevent an index being used (if there is one), since the value must be fetched and then the function applied to it, before the match can be tested.
In this case, use

	and field4 LIKE 'value%'
	and rtrim(field4) = 'value'

--
Regards,
John. Received on Fri Sep 18 1998 - 03:12:43 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US