Mysql 语句汇总(性能篇)

查询mysql 哪些表正在被锁状态:

show open TABLES where In_use > 0;

show open table from XXX(数据库名);//查看数据库哪些表正在使用In_use 以及锁定Name_locked

show global status like 'table_locks%';
//Table_locks_immediate 发生表锁定操作, 但表锁定后马上释放
//Table_locks_waited  发生表锁定, 并因此具有锁等待

posted @ 2016-03-28 18:34  Mars、少年  阅读(256)  评论(0编辑  收藏  举报