oracle update太慢优化

tb_e_zw_nrllb_temp 量700225
gsm_user  量109398337

--优化前 两种update

--说明:gsm_user是视图存在GSM_USER_ID索引,tb_e_zw_nrllb_temp有user_id索引,使用以下两种方法都更新时间超5h+导致不能更新成功
--1
 update tb_e_zw_nrllb_temp t
   set t.msisdn = (select  msisdn from from gsm_user a
                  where to_char(a.GSM_USER_ID) = b.user_id
                  and b.settle_month = p_month_id))
   where .settle_month = p_month_id;
--2
merge into tb_e_zw_nrllb_temp t
  using gsm_user a
  on (to_char(a.GSM_USER_ID) = t.user_id  )
  when matched then
     update set
       t.msisdn =   a.MSISDN
     where t.settle_month = p_month_id;
 commit;

--优化后  

--优化后时间耗费主要在insert上,insert的select查询比较快,因此又想办法优化inser

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值