日期:2014-05-16  浏览次数:20717 次

MYSQL5.1这段sql执行死机
取出文章标题表前十个(到文章内容表中找对应内容)
select uid, username, pre_home_blog.blogid, subject, FROM_UNIXTIME(dateline, '%Y-%m-%d %H:%i:%S') shijian, message from pre_home_blog
left join (select blogid, message from pre_home_blogfield order by blogid desc) blogcontent on pre_home_blog.blogid = blogcontent.blogid
order by dateline desc limit 0, 10

哪里的问题呢

------解决方案--------------------
语法没错 

order by blogid desc这个没什么意思吧
------解决方案--------------------
能不能简单的介绍一下表和字段的含义呢
------解决方案--------------------
explain select uid, username, pre_home_blog.blogid, subject, FROM_UNIXTIME(dateline, '%Y-%m-%d %H:%i:%S') shijian, message from pre_home_blog
left join (select blogid, message from pre_home_blogfield order by blogid desc) blogcontent on pre_home_blog.blogid = blogcontent.blogid
order by dateline desc limit 0, 10

贴出来看一下,估计是语句执行需要过长时间,如果有可能建议优化一下。