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: Lío <jgonzalezsuareNO_at_SPAMnexo.es>
Date: Sun, 20 Sep 1998 03:37:35 GMT
Message-ID: <360457bc.1741177@news.mad.ibernet.es>


I think the problem is not rtrim in particular. When you are comparing a table column with a value in a sql statement, the SQL tunning guide advise you to try to avoid applying functions on the table column.
For example, statement #1 is worse than statement #2

Statement #1



SELECT field1, field2
FROM table_a
WHERE constant * field3 = numeric_value

Statement #2



SELECT field1, field2
FROM table_a
WHERE field3 = numeric_value / constant

El Thu, 17 Sep 1998 16:26:27 -0500, "InfoTech Consulting, Inc." <dmorse_at_iquest.net> escribio:

>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'
>
>... this one returns data almost immediately:
>SELECT field1, field2
>FROM table_a
>WHERE field3 = 'value' and
>field4 LIKE 'value%'
>
>Is the rtrim() function a performance hog?
>

--
Regards!
Lío.
jgonzalezsuareNO_at_SPAM.nexo.es
(Remove NO and SPAM if you want to email me) Received on Sat Sep 19 1998 - 22:37:35 CDT

Original text of this message

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