自定义函数引发的性能问题
2014-07-07 13:04
281 查看
---执行1次 select count(1) from LOAN_DUEBILLDATA bd left join LOAN_CONTRACTDATA bc on bd.RelativeSerialNo2 = bc.SerialNo where nvl(bd.ActualMaturity, bd.Maturity) <= '2014/08/06' and nvl(bd.ActualMaturity, bd.Maturity) >= '2014/07/07' and (bd.FinishDate is null or bd.FinishDate = '') and (bc.ManageUserID = '00717' or getCustomerManager(bc.CustomerId) = '00717') ----返回4条记录 ---getCustomerManager函数里的sql执行3619次 SELECT USERID FROM CUSTOMER_BELONG WHERE CUSTOMERID = :B1 AND BELONGATTRIBUTE='1' select count(1) from LOAN_DUEBILLDATA bd left join LOAN_CONTRACTDATA bc on bd.RelativeSerialNo2 = bc.SerialNo where nvl(bd.ActualMaturity, bd.Maturity) <= '2014/08/06' and nvl(bd.ActualMaturity, bd.Maturity) >= '2014/07/07' and (bd.FinishDate is null or bd.FinishDate = '') and (bc.ManageUserID = '00717' or getCustomerManager(bc.CustomerId) = '00717'); 初步改写为: select count(1) from LOAN_DUEBILLDATA bd, LOAN_CONTRACTDATA bc, (select CustomerId FROM CUSTOMER_BELONG WHERE BELONGATTRIBUTE='1') be where bd.RelativeSerialNo2 = bc.SerialNo(+) and nvl(bd.ActualMaturity, bd.Maturity) <= '2014/08/06' and nvl(bd.ActualMaturity, bd.Maturity) >= '2014/07/07' and (bd.FinishDate is null or bd.FinishDate = '') and be.CustomerId = bc.CustomerId and (bc.ManageUserID = '00717' or be.customerid = '00717')
相关文章推荐
- Session_End引发的性能问题!
- 可能引发性能问题的几个写法,看看你占哪一个
- 自引用外键引发的性能问题解决案例
- 2013-05-02 SQL语句远程调用(remote)引发的性能问题
- 2013-04-16由MERGE JOIN SEMI引发的性能问题
- 使用Ajax控件引发性能问题
- String.intern()引发的性能问题
- 小案例分享,11G新特性引发的严重性能问题【附AWR截图】
- mysql - 为magento性能测试修改innodb的innodb_buffer_pool_size而引发的问题
- 记一个由MemCached引发的性能问题
- [原]由clob引发的性能问题所想到的
- PHP保持SESSION问题以及由SESSION性能引发的一些思考
- 如何诊断Oracle Redo Log引发的性能问题
- Convert、Parse、TryParse、(int)区别及可能引发性能问题
- 一个单引号引发的MYSQL性能问题分析
- 可能引发性能问题的几个写法,看看你占哪一个.
- Flash插件10.1绘制曲线引发的性能问题
- 一个列别名引发的性能问题,兼谈产品设计等(2010-11-15)
- 百万数据引发的性能瓶颈问题
- 由Memcached使用不当而引发性能问题的两个经验总结