sql关联查询更新速度慢的问题

 

原语句html

update B b
set b.fid =
(select f.id from F f where f.bid = b.id) ;sql

能够考虑用oop

beginhtm

  for f in (select f.id,f.bid from F f) loopdate

    update B set b.fid=f.id where b.id=f.bid;select

  end loop;sql语句

end;数据

这样时间能够省略跟多倍  已1000条数据为例  第一条sql语句须要 27s  第二种 只须要 0.062s ;时间

参考文章:http://www.yyjjssnn.cn/articles/765.htmlloop

相关文章
相关标签/搜索