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万条。
求各位大大,告知更为高效的操作方式,在此谢过!