mysql从另一个表中更新表的性能

时间:2014-09-04 10:17:36

标签: mysql

我有两个mysql表,

table_A = 2500000+(行) table_B = 6000000+(行)

我需要从table_B中的数据更新table_A中的行(使用多线程应用程序)

最快的方法是什么

选项A

update table_b b (select col_a,col_b from table_a where col_c=%s) b set a.col_a=b.col_a, a.col_b=b.col_b flag='C' where col_c=%s

选项B

data=select col_a,col_bfrom table_a where col_c=%s
update table_b set col_a=%s,col_b=%s,flag='C' where col_c=%s

选项C

左连接table_b with table_a

0 个答案:

没有答案