下面这条查询语句是查文章的可是效率太。mysql直接没反应了。库了大概有300条左右的数据就查不动了。请高手帮忙优化优化这条语句tb_content --内容表
tb_content_reply -内容回复表
tb_mune --分类表a.province 是分类编号select a.*,b.name as typename,(select COUNT(*) from tb_content_reply where num=a.id)as num from tb_content a,tb_mune b where a.province=b.id order by time desc limit 0,30
请大虾帮忙改上面语句让我的数据库好受一些5555 页面直接超时掉了。cpu上到50%以上我用mysql 5
tb_content_reply -内容回复表
tb_mune --分类表a.province 是分类编号select a.*,b.name as typename,(select COUNT(*) from tb_content_reply where num=a.id)as num from tb_content a,tb_mune b where a.province=b.id order by time desc limit 0,30
请大虾帮忙改上面语句让我的数据库好受一些5555 页面直接超时掉了。cpu上到50%以上我用mysql 5
LZ可以试一下~
create index xxx2 on tb_mune(id,name)
create index xxx3 on tb_content_reply(num)