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
如何优化此查询?
答案 0 :(得分:2)
顺便说一句,如果您不知道“已经消失”的含义,请查看手册: http://dev.mysql.com/doc/refman/5.0/en/gone-away.html