[Home]   [TOC]

Study_Database_MySQL_Explain  
MySQL Explain
Updated Nov 19, 2012 by jht5...@gmail.com

Explain

  • explain <QUERY>;

Profile

  • SELECT @@profiling;
    查看是否已经打开Profile
  • SET profiling = 1;
    打开Profile
  • <execute sql query>;
    执行SQL语句
  • show profiles;
    查看做过Profile的SQL
  • show profile for query <N>;
    打印对应SQL的Profile数据

参考资料

[1]. http://dev.mysql.com/doc/refman/5.6/en/explain-output.html
[2]. http://hi.baidu.com/gguoyu/item/4a588a0f41b9cb69d55a115f