Oracle 表通过某字段查询出的数据按一定规则合并后存入新表,如何提高效率。用的是java。

A表
linkid oltid oltport basid basprot
1 001 oport1 42301 bport1
1 42301 oport2 002 bport2
2 ...
B表
linkid oltid oltport switchid switchport basid basport
1 001 oport1 42301 bport1 002 bport2
2 ...
A表的数据有两千多万条,以linkid去重后仍有近千万条,目前是用java去重后分页查询存入list,然后遍历list,用linkid去A表查数据,排序后多条组合成B表的一条,然后插入到B表。此方法效率太低,5分钟才插入1万条。

求各位大大,告知更为高效的操作方式,在此谢过!

不要每一条插入都去commit,你可以先生成sql脚本,再调用脚本一次性注入B表。

已在论坛得以解决,地址:http://bbs.csdn.net/topics/392287082