Mysql SQL优化

1、sql语句优化

可以查看牛人博客:https://www.cnblogs.com/linyue09/p/9869163.html

2、mysql性能查看

1、查看 profile 开启情况
    select @@profiling;
    开启profile:set profiling = 1;
    
2、查看执行的 SQL 列表
    show profiles;
    
3、查询指定 ID 的执行详细信息
    show profile for query Query_ID;
    
4、获取 CPU、 Block IO 等信息
    show profile block io,cpu for query Query_ID;

    show profile cpu,block io,memory,swaps,context switches,source for query Query_ID;

    show profile all for query Query_ID;

 

posted @ 2020-08-21 11:06  小白啊小白,Fighting  阅读(149)  评论(0编辑  收藏  举报