摘要: 今天优化了多条SQL语句。都是EXPLAIN的功劳,分析SQL子句的执行顺序和执行情况,一木了然,下来看具体分析:[优化多表联合查询]explain SELECT sql_no_cache pker.*,pk.* FROM ng_game_pk AS pk ,ng_game_pker AS pker where pker.pkid = pk.id and (pker.act_uid = 1 OR pker.def_uid = 1) AND pk.type <>4 GROUP BY pk.id limit 10;+----+-------------+-------+-------- 阅读全文
posted @ 2012-09-28 15:22 zaric 阅读(1992) 评论(0) 推荐(0) 编辑