请教一句mysql语句优化

pwtitle 2004-12-09 05:12:14
select artid as articleID,chid as chID,title,art_head.auid as authorID, author.name as author, owner as editorID, e1.nickname as editor, art_head.nodeID, path ,created as createTime, begin as beginTime, updateTime, updateUser, hit ,isSubject, isEditorCommend, e2.nickname as updateName from art_head
left join author on art_head.auid=author.auid
left join editor e1 on e1.userid=owner
left join editor e2 on e2.userid=updateUser
where art_head.deleted='F' and artid in (35642,31271,27896,27819,27778,27777,27757,27747,27705,27704,27660,27645,27643,27633,27631,27583,27578,27552,27548,27545,27534,27506,27500,27491,27476,27475,27474,27467,27336,27292,27135,27050,27041,27030,27021)

order by artid desc



请教一下这句该如何优化?当我的in数据达到1000个时候php脚本就超时了。cpu占用达到100%,请教了。
...全文
75 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
mathematician 2004-12-10
  • 打赏
  • 举报
回复
我看挺好的,外连接消耗资源的确要多些,但具体还是要看你的需求。

http://www-900.ibm.com/developerWorks/cn/dmdd/library/techarticles/0207purcell/index.shtml
walkany 2004-12-09
  • 打赏
  • 举报
回复
哈,厉害居然设计出这么复杂的东西,建议重新做整体设计,推翻所有的数据库结构和事务设计逻辑结构.

56,678

社区成员

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

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