I have one function which returns ref cursor. The function seem to perform well. I generated TKPROF, and also logged start & end timestamp in a table from begining & end of the function. It looks perfectly ok. But When I run this function 50 times in a second. The CPU goes 100%. I increased SGA size, it did not help. I was using union at one place, I changed it to union all, but that did not help either. What could be the problem?