请教如何提高UPDATE千万数据和INSERT千万条数据的效率问题
aps21 2009-09-18 11:00:33 1、现在有TABLEA表,该表中有三百万条数据,要将TABLEA表中数据导到TABLEB中,在插入之前已经将TABLEB表中索引删除,我现在是用merge into 实现的,速度非常慢;
merge into tableb b
using (select phone
from tablea) b
on (a.phone= b.phone)
when matched then
update set a.phone = a.phone
when not matched then
insert(a.phone) values(b.phone);
2、现在有TABLEC表,该表中有千万条数据,如果UPDATE TABLEC全表的话,用语句:update tableb set readmail = readmail || ',3'很慢;
请教高手我要实现这两个功能,该如何优化以达到速度最快最优效果?
真诚的感谢每一位回复的人,谢谢。