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

Home -> Community -> Usenet -> c.d.o.server -> SQL Performance Help

SQL Performance Help

From: Brian Kelly <bjkelly_at_gmail.com>
Date: 14 Dec 2006 21:14:17 -0800
Message-ID: <1166159657.577616.304870@79g2000cws.googlegroups.com>


I'm working on an auto population program and this program has to execute thousands of SQL statements. Each SQL statement really dumbs down the comparing field using Oracle's built in functions lower() and about 6 replace()'s. These REALLY slow down the execution of each of these statements ALOT. A statement, for example might be like this.

UPDATE blah
SET field1='whatever',field2='whatever'
WHERE replace(replace(replace(lower(comparison_field),'-'),'.'),'\') LIKE '%keyword%';

However, I've also grouped similar statements together like this

UPDATE blah
SET field1='whatever',field2='whatever'
WHERE replace(replace(replace(lower(comparison_field),'-'),'.'),'\') LIKE '%keyword1%'
OR replace(replace(replace(lower(comparison_field),'-'),'.'),'\') LIKE
'%keyword2%'

OR replace(replace(replace(lower(comparison_field),'-'),'.'),'\') LIKE
'%keyword3%'

OR ...;

The grouped statements take [insert # of LIKE's comparisons here] times longer then the first statement due to the fact that it has to re-execute these functions for every comparison. Is there any way to execute the functions once and then reference that result later in the same SQL statement? Any help would be appreciated. Received on Thu Dec 14 2006 - 23:14:17 CST

Original text of this message

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