侧边栏壁纸
博主头像
流苏小筑 博主等级

行动起来,活在当下

  • 累计撰写 139 篇文章
  • 累计创建 57 个标签
  • 累计收到 9 条评论

目 录CONTENT

文章目录

musql分析海量数据

Administrator
2019-08-08 / 0 评论 / 0 点赞 / 2 阅读 / 0 字

show profiles

show profiles:默认关闭
show variables like '%profiling%'
set profiling = on
show profiles会记录所有所有sql查询语句所花的时间
缺点:只能看到全部的总时间

show profile all

精确分析:show profile all for query 上一部查询的Query_id

全局日志

默认关闭:show global variables like '%general_log%';
set global general_log = 1
set global log_output = 'table'
开启后会记录所有sql,会被记录到mysql自带的数据库里面的general_log表里

0

评论区