简单Update语句,但是效率忽快忽慢~~

wgqqgw wgqqgw 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
这是一句简单的update一句,有时候跑只要10秒,有时候跑要10分钟甚至20分钟,是怎么回事?是服务器、数据库性能的问题?有其他东西抢资源?

update tmp_report t1
set report_type='项目'
where exists (select 1 from v_detail t2
where t1.report_num=t2.report_num
and t1.report_detail_num=t2.report_detail_num
and t2.num_answer in (1,2,3)
and t2.question_type=1299);

tmp_report 中有索引在report_num和report_detail_num;10万行记录;
v_detail 中的主键是report_num和report_detail_num以及几个别的字段;千万行记录。

这么写规范吗?怎么写才能更规范更快?
Oracle新手求教。
...全文

相关推荐

评论 7
收藏 已收藏
分享
返回顶部
wgqqgw
基础和管理 17,379 成员 95,111 内容