MySQL 服务器已消失错误
Warning: mysql_query() [function.mysql-query]:
MySQL server has gone away in filename.php on line 201
查询:
SELECT * FROM ta
LEFT JOIN tb ON ta_id = tb_oid
LEFT JOIN tc ON ta_id = tc_oid
LEFT JOIN td ON ta_id = td_oid
WHERE
ta_time1 > 0 OR ta_time2 > 0 OR
tb_time1 > 0 OR tb_time2 > 0 OR
tc_time1 > 0 OR tc_time2 > 0 OR
td_time1 > 0 OR td_time2 > 0
GROUP BY td_id
ORDER BY
ta_time1 DESC, ta_time2 DESC,
tb_time1 DESC, tb_time2 DESC,
tc_time1 DESC, tc_time2 DESC,
td_time1 DESC, td_time2 DESC
LIMIT 0, 40
我如何优化这个查询?
Warning: mysql_query() [function.mysql-query]:
MySQL server has gone away in filename.php on line 201
query:
SELECT * FROM ta
LEFT JOIN tb ON ta_id = tb_oid
LEFT JOIN tc ON ta_id = tc_oid
LEFT JOIN td ON ta_id = td_oid
WHERE
ta_time1 > 0 OR ta_time2 > 0 OR
tb_time1 > 0 OR tb_time2 > 0 OR
tc_time1 > 0 OR tc_time2 > 0 OR
td_time1 > 0 OR td_time2 > 0
GROUP BY td_id
ORDER BY
ta_time1 DESC, ta_time2 DESC,
tb_time1 DESC, tb_time2 DESC,
tc_time1 DESC, tc_time2 DESC,
td_time1 DESC, td_time2 DESC
LIMIT 0, 40
How can i optimise this query?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
顺便说一句,如果您不知道“has gone gone”是什么意思,请查看手册:
http://dev.mysql.com/doc/refman/5.0 /en/gone-away.html
By the way, if you don't know what "has gone away" means, please check the manual:
http://dev.mysql.com/doc/refman/5.0/en/gone-away.html