mysql索引分类 性能分析

索引分类

image

image

性能分析

  • 查看执行频次 show global status like 'Com_______'

  • 查看慢查询日志是否开启 show variables like 'slow_query_log';

  • 查看是否支持查看详情 select @@have_profiling

  • 是否打开 select @@profiling;

  • 打开 set profiling=1

  • 查看详情 show profiles;

  • 指定行的sql语句在各阶段的耗时 show profile for query 行号

  • 执行计划 explain SQL语句

image

image

posted @ 2026-01-29 13:17  雨花阁  阅读(3)  评论(0)    收藏  举报