Nested OREPLACE leads to poor performance

Database

Nested OREPLACE leads to poor performance

Hi,

I am using this condition in UPDATE and SELECT statements and to process this condition takes a lot of time. The column 'recall_string' (Varchar(2000)) is in a table of 100 million records.

Any suggestions to improve the performance of this condition?

WHERE

COALESCE(length(OREPLACE(OREPLACE(OREPLACE(OREPLACE(OREPLACE(OREPLACE(OREPLACE(OREPLACE(OREPLACE(OREPLACE(OREPLACE(PREV.recall_string,'0'),'1'),'2'),'3'),'4'),'5'),'6'),'7'),'8'),'9'),'-')),0) = 1

Thanks,

Pradeep

1 REPLY
Junior Supporter

Re: Nested OREPLACE leads to poor performance

Use oTRANSLATE() instead.

HTH

Cheers.

Carlos.