谁帮我看看这个SQL,怎么效率这么低呢?在线等...

wlalw131415 2010-12-14 12:20:53
update TEMP_FACILITY_MITIGATION_INFO f
set f.DebtorRatingGrade = nvl((select r.RatingGrade99
from rating_record_pd_corporate r
where r.customerid = f.customerid
and (SUBSTR(r.ApproveTime, 0, 10) <=
f.recorddate and
(SUBSTR(r.InvalidDate, 0, 10) >
f.recorddate or
r.InvalidDate is null))
and r.procstatus = '40'
and rownum = 1),
'E')
where f.SendingOrg = '11111111111111111111111111111111'
and f.RecordDate = '2010-09-30'
and f.sendingdate = '2010-12-14 10:07:35';

说明:TEMP_FACILITY_MITIGATION_INFO 表要更新的记录有2000条
rating_record_pd_corporate 表里记录有一千多条
...全文
73 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
gelyon 2010-12-14
  • 打赏
  • 举报
回复
看看执行计划,是否是你内层子查询比较慢?
对你表rating_record_pd_corporate的customerid、procstatus加上索引呢,再对 ApproveTime、InvalidDate 加上一个函数索引

17,086

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧