oracle 数据库多表关联更新如何提高速度

忆尘 2012-08-09 05:32:19
大家帮忙看下,下面的sql。大概更新15W左右数据,现在需要5分钟,怎么才能提高一下速度。ORACLE多表关联更新,还能怎么写???
update tb_rpt_jxc m
set (endnum, endjprice, endnetjprice, endprice, endcost, endnetcost, endtotal) = (select sum(c.count),
b.jprice,
b.netjprice,
a.price,
sum(c.cost),
sum(c.netcost),
sum(c.price *
c.count)
from tb_goods a,
tb_goodsorg b,
tb_goodsstockdetail c
where a.plucode =
b.plucode
and a.plucode =
c.plucode
and a.plucode =
m.plucode
group by b.jprice,
b.netjprice,
a.price)
where accdate = to_date('2012-07-25','yyyy-mm-dd') ;
...全文
561 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
忆尘 2012-08-14
  • 打赏
  • 举报
回复
我这个是在存储过程里面的!执行速度很慢~
ORAClE SE 2012-08-10
  • 打赏
  • 举报
回复
不要告诉我,你这sql是前台运行的。。。。
人生无悔 2012-08-09
  • 打赏
  • 举报
回复
tb_goodsorg表的plucode,jprice,netjprice建个联合索引,然后试下时间
忆尘 2012-08-09
  • 打赏
  • 举报
回复
。。。关键客户受不了~是不是我这写法,有问题?5分钟时间正常吗?
ORAClE SE 2012-08-09
  • 打赏
  • 举报
回复
把最少数据的表放在from最右边。
另少年,这点时间不算啥。

17,137

社区成员

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

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