oracle小记之游标和order by同时使用导致性能慢

游标与order by 放在同一级查询里面,数据大了以后会导致性能缓慢(5000条左右)。


如:

 select e.*,GET_PROJECT_UNITS(e.id) as unitNamess from t_project e   where 1=1 and e.pstatus<>0 order by e.pno,

其中函数GET_PROJECT_UNITS中使用游标了。

结果5000条左右的数据,慢了10秒左右。


后来,把order by 改成 group by 解决之。


你可能感兴趣的:(oracle小记之游标和order by同时使用导致性能慢)