I have a stored procedure which queries in 5 secs.
Recently i have added a UDF in select
select col1,col2,col3,UDF_function(col1),col4 from table inner join table 1 ..........11 tables are joined here.
after adding udf_function() my query execution time is taking minimum 15 mins which is horrible. Kindly help me to how to improve the performance.
the function returns the values of a column as comma seperated string. it means i am looping through the records in the function.
The reason why i am using UDF is becos of the below table structure and requirement
p.k col1 col2 col3 1 x z 2 v q 3 n w 4 m e
f.k 1 a 1 b 1 c 2 a 2 d
col1 col2 1 a,b,c 2 a,d 3 4
This is mainly to avoid duplicates
Thanks in advance Usha
Im not clear behind your reasons for doing this.
You say "This is mainly to avoid duplicates" surely, is that you want the distinct characters in the columns ?
Please provide a better example , as SQL script would be perfect
answered Nov 04, 2009 at 05:47 AM