摘要: SELECT tx.trx_id FROM information_schema.innodb_trx tx WHERE tx.trx_mysql_thread_id = connection_id(); 阅读全文
posted @ 2021-06-04 20:08 larybird 阅读(352) 评论(0) 推荐(0) 编辑
摘要: 本文记录一些MySQL运行时状态的命令和方法,用于优化MySQL查询等。 查看当前查询任务 基本用法 使用命令:show processlist;可以查看当前系统运行的查询任务,执行结果如下: mysql> show processlist; + + + + + + + + + | Id | Use 阅读全文
posted @ 2021-06-04 19:19 larybird 阅读(1894) 评论(0) 推荐(0) 编辑
摘要: 查看执行时间步骤 1.show profiles; 2.show variables; 查看profiling 是否是on状态; 3.如果是off,则执行命令 set profiling=1; 4.执行SQL语句 5.show profiles; 就可以查询到SQL语句的执行时间 数据库设计: 支持 阅读全文
posted @ 2021-06-04 18:51 larybird 阅读(1669) 评论(0) 推荐(1) 编辑