September 22nd, 2003, 06:19 AM
Join Date: Sep 2003
Time spent in forums: < 1 sec
Reputation Power: 0
Update/Select query to long to complete
i have an requirement to update 250 thousands of records comparing againt another table that have 10 million records
The query is like
Update TABLE1 set COLUMN1 = value
Where Exists ( Select 'X' from TABLE2
Where InStr(sfc_GetPkeyPattern(TABLE1.COLUMN2), '''' || TABLE2.COLUMNX ||'''',1)>0 )
-- The user defined function sfc_GetPkeyPattern retruns a string ( max of 100 char. length ) pattern based on the input values.
if i run this query it takes about 3/4 hrs some time not returing the control at all.
when i tried to execute the query using select with join it took 1 minute to return the result, if use select withs sub query it took the same time ie 3/4 hrs
is there any way to fine tune this update query / what's wrong in this?
Thanks & Regards