为何我都oracle数据库做update或insert时,更新或插入几百几千很快,十万条要半个小时左右,近百万以上就5个小时以上,要是几百万条以上,就遥遥无期,有一次800多万条想一次性做插入操作,结果50多个小时还没结束,最后只好终止。
以前好像做更新或插入几千万条也很快。
现在用都插入语句是:
insert /*+append+*/ into mytest.xl1 (dh,sj,vi) select /*+ no_merge(a2) use_hash(a2) */ dh,sj,sum(jj) over(order by dh,sj rows between var50 PRECEDING and current row) as vi from mytest.xl a2 where a2.sj<20170000 and a2.sj>20160700;
update a1 set var51=(select vi from ( select /*+ no_merge(a2) use_hash(a2) */ dh,sj,sum(jj) over(order by dh,sj rows between var50 PRECEDING and current row) as vi
from a3 ) a2 where a2.dh=a1.dh and a1.sj=a2.sj );



