如何提高mysql update性能

SuperCustomer 2013-06-28 08:21:57
如何提高这条语句的性能
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;
...全文
275 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
rucypli 2013-06-28
  • 打赏
  • 举报
回复
SET a.theCount = b.factCount, a.theRoi = b.roi > 0 这是什么意思
Rotel-刘志东 2013-06-28
  • 打赏
  • 举报
回复
在where 字段创建索引allotStep,salesType,cityOrder,salary,gender,education,ageStep,gzt10
WWWWA 2013-06-28
  • 打赏
  • 举报
回复
在两表的连接字段上建立索引 即WHERE 中的字段 allotStep,salesType,cityOrder,salary,gender,education,ageStep,gzt10
ACMAIN_CHM 2013-06-28
  • 打赏
  • 举报
回复
create index xxx on 记录多的表 (allotStep,salesType,cityOrder,salary,gender,education,ageStep,gzt10);

56,677

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧