Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> SQL Performance Help
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