如何提高这条语句的性能
UPDATE FactLogin_201305 a,
 Leads_2012 b
SET a.theCount = b.factCount,
 a.theRoi = b.roi > 0
WHERE
a.allotStep = b.allotStep
AND a.salesType = b.salesType
AND a.cityOrder = b.cityOrder
AND a.salary = b.salary
AND a.gender = b.gender
AND a.education = b.education
AND a.ageStep = b.ageStep
AND a.gzt10 = b.gzt10;MySQL性能优化update

解决方案 »

  1.   

    create index xxx on 记录多的表 (allotStep,salesType,cityOrder,salary,gender,education,ageStep,gzt10);
      

  2.   

    在两表的连接字段上建立索引
    即WHERE 中的字段
    allotStep,salesType,cityOrder,salary,gender,education,ageStep,gzt10
      

  3.   

    在where 字段创建索引allotStep,salesType,cityOrder,salary,gender,education,ageStep,gzt10
      

  4.   

    SET a.theCount = b.factCount,
     a.theRoi = b.roi > 0这是什么意思