其实该命令主要是在查看insertBuffer的时候用的比较多

一、\G和\g的区别

  1. \g
      在MySQL的sql语句后加上\g,效果等同于加上定界符,一般默认的定界符是分号;
mysql> show engine innodb status\g
+--------+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Type   | Name | Status                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
+--------+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| InnoDB |      |
=====================================
2022-04-20 23:34:15 0x9c8 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 3 seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: 1 srv_active, 0 srv_shutdown, 61 srv_idle
srv_master_thread log flush and writes: 0
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 0
OS WAIT ARRAY INFO: signal count 0
RW-shared spins 0, rounds 0, OS waits 0
RW-excl spins 0, rounds 0, OS waits 0
RW-sx spins 0, rounds 0, OS waits 0
Spin rounds per wait: 0.00 RW-shared, 0.00 RW-excl, 0.00 RW-sx
------------
TRANSACTIONS
------------
Trx id counter 30473
Purge done for trx's n:o < 30470 undo n:o < 0 state: running but idle
History list length 3
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 283158070472032, not started
0 lock struct(s), heap size 1136, 0 row lock(s)
---TRANSACTION 283158070471200, not started
0 lock struct(s), heap size 1136, 0 row lock(s)
---TRANSACTION 283158070470368, not started
0 lock struct(s), heap size 1136, 0 row lock(s)
--------
FILE I/O
--------
I/O thread 0 state: wait Windows aio (insert buffer thread)
I/O thread 1 state: wait Windows aio (log thread)
I/O thread 2 state: wait Windows aio (read thread)
I/O thread 3 state: wait Windows aio (read thread)
I/O thread 4 state: wait Windows aio (read thread)
I/O thread 5 state: wait Windows aio (read thread)
I/O thread 6 state: wait Windows aio (write thread)
I/O thread 7 state: wait Windows aio (write thread)
I/O thread 8 state: wait Windows aio (write thread)
I/O thread 9 state: wait Windows aio (write thread)
Pending normal aio reads: [0, 0, 0, 0] , aio writes: [0, 0, 0, 0] ,ibuf aio reads:, log i/o's:, sync i/o's:
Pending flushes (fsync) log: 0; buffer pool: 0
1020 OS file reads, 203 OS file writes, 38 OS fsyncs
0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 0, seg size 2, 0 merges
merged operations:insert 0, delete mark 0, delete 0
discarded operations:insert 0, delete mark 0, delete 0
Hash table size 34679, node heap has 0 buffer(s)
Hash table size 34679, node heap has 0 buffer(s)
Hash table size 34679, node heap has 0 buffer(s)
Hash table size 34679, node heap has 0 buffer(s)
Hash table size 34679, node heap has 0 buffer(s)
Hash table size 34679, node heap has 0 buffer(s)
Hash table size 34679, node heap has 1 buffer(s)
Hash table size 34679, node heap has 3 buffer(s)
0.00 hash searches/s, 0.00 non-hash searches/s
---
LOG
---
Log sequence number          25880484
Log buffer assigned up to    25880484
Log buffer completed up to   25880484
Log written up to            25880484
Log flushed up to            25880484
Added dirty pages up to      25880484
Pages flushed up to          25880484
Last checkpoint at           25880484
12 log i/o's done, 0.00 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total large memory allocated 136970240
Dictionary memory allocated 373269
Buffer pool size   8192
Free buffers       7049
Database pages     1139
Old database pages 440
Modified db pages  0
Pending reads      0
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 0, not young 0
0.00 youngs/s, 0.00 non-youngs/s
Pages read 997, created 142, written 155
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
No buffer pool page gets since the last printout
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len: 1139, unzip_LRU len: 0
I/O sum[0]:cur[0], unzip sum[0]:cur[0]
--------------
ROW OPERATIONS
--------------
0 queries inside InnoDB, 0 queries in queue
0 read views open inside InnoDB
Process ID=8064, Main thread ID=00000000000036D8 , state=sleeping
Number of rows inserted 0, updated 0, deleted 0, read 0
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s
Number of system rows inserted 0, updated 315, deleted 0, read 4651
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================|
+--------+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
  1. \G
    在MySQL的sql语句后加上\G,表示将查询结果进行按列打印,可以使每个字段打印到单独的行。即将查到的结构旋转90度变成纵向;
    (1)使用前,显示效果很差,全都是杠杠

(2)使用后,显示效果灰常好,清晰了很多,方便查询;但是记得加分号

二、打印参数详解

第一段:
*************************** 1. row ***************************
Type: InnoDB --存储引擎
Name:
Status:
=====================================
2015-04-17 10:37:02 7f1fc1fe9700 INNODB MONITOR OUTPUT --监控信息输出的时间

=====================================
Per second averages calculated from the last 14 seconds
-----------------

第二段:

BACKGROUND THREAD
-----------------
srv_master_thread loops: 0 srv_active, 0 srv_shutdown, 562 srv_idle
srv_master_thread log flush and writes: 562
----------

第三段:

SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 2
OS WAIT ARRAY INFO: signal count 2
Mutex spin waits 0, rounds 0, OS waits 0
RW-shared spins 2, rounds 60, OS waits 2
RW-excl spins 0, rounds 0, OS waits 0
Spin rounds per wait: 0.00 mutex, 30.00 RW-shared, 0.00 RW-excl
------------

第四段:

TRANSACTIONS
------------
Trx id counter 3842
Purge done for trx’s n:o < 2856 undo n:o < 0 state: running but idle
History list length 6 --记录undo日志的数量
LIST OF TRANSACTIONS FOR EACH SESSION:
—TRANSACTION 0, not started
MySQL thread id 2, OS thread handle 0x7f1fc1fe9700, query id 5 localhost root init
show engine innodb status
--------

第五段:

FILE I/O
--------
I/O thread 0 state: waiting for completed aio requests (insert buffer thread)
I/O thread 1 state: waiting for completed aio requests (log thread)
I/O thread 2 state: waiting for completed aio requests (read thread)
I/O thread 3 state: waiting for completed aio requests (read thread)
I/O thread 4 state: waiting for completed aio requests (read thread)
I/O thread 5 state: waiting for completed aio requests (read thread)
I/O thread 6 state: waiting for completed aio requests (write thread)
I/O thread 7 state: waiting for completed aio requests (write thread)
I/O thread 8 state: waiting for completed aio requests (write thread)
I/O thread 9 state: waiting for completed aio requests (write thread)
Pending normal aio reads: 0 [0, 0, 0, 0] , aio writes: 0 [0, 0, 0, 0] ,
ibuf aio reads: 0, log i/o’s: 0, sync i/o’s: 0
Pending flushes (fsync) log: 0; buffer pool: 0
318 OS file reads, 5 OS file writes, 5 OS fsyncs
0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s
-------------------------------------

buffer thread:插入缓冲线程

log thread:日志线程

read thread:读线程

write thread:写线程

第六段:

INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 0, seg size 2, 0 merges
merged operations:
insert 0, delete mark 0, delete 0
discarded operations:
insert 0, delete mark 0, delete 0
Hash table size 276671, node heap has 0 buffer(s)
0.00 hash searches/s, 0.00 non-hash searches/s

seg size 2:INSERT BUFFER的大小,2X16KB

ree list len 0:空闲列表的长度

Ibuf: size 1:合并记录页的数量
insert 0:INSERT BUFFER

delete mark 0:DELETE BUFFER

delete 0:PURGE BUFFER

discarded operations:Change Buffer发生merge时表已经被删除,无需再将记录合并到辅助索引中了

第七段:

LOG

Log sequence number 1649686 --当前的LSN号
Log flushed up to 1649686 --刷新后的LSN号
Pages flushed up to 1649686 --刷新和事物提交后的LSN号
Last checkpoint at 1649686 --写入到磁盘后的LSN号
0 pending log writes, 0 pending chkp writes
8 log i/o’s done, 0.00 log i/o’s/second
----------------------

第八段:

BUFFER POOL AND MEMORY
----------------------
Total memory allocated 137363456; in additional pool allocated 0
Dictionary memory allocated 50138
Buffer pool size 8191 --缓冲池的大小
Free buffers 8025 --剩余大小
Database pages 166 --数据库页
Old database pages 0 --旧数据库页
Modified db pages 0
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 0, not young 0
0.00 youngs/s, 0.00 non-youngs/s
Pages read 166, created 0, written 1
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
No buffer pool page gets since the last printout
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len: 166, unzip_LRU len: 0 --LRU(缓冲池最近最少使用),一共有166个页,unzip列表中有0个页
I/O sum[0]:cur[0], unzip sum[0]:cur[0]
--------------

第九段:
ROW OPERATIONS
--------------
0 queries inside InnoDB, 0 queries in queue
0 read views open inside InnoDB
Main thread process no. 27472, id 139774264338176, state: sleeping
Number of rows inserted 0, updated 0, deleted 0, read 0
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================

三、Mysql日志序列号LSN

概要:

  • LSN(log sequence number):日志序列号,是一个一直递增的整形数字,在MySQL5.6.3版本后占8个字节。它表示事务写入到日志的字节总量。LSN主要用于发生crash时对数据进行recovery!每个数据页、重做日志、checkpoint都有LSN。
  • LSN不仅存在于重做日志中,在每个数据页头部也会有对应的LSN号。在数据页头部,LSN记录当前页最后一次修改的LSN号,用于在recovery时对比重做日志LSN号决定是否对该页进行恢复数据。checkpoint也是有LSN号记录的,LSN号串联起一个事务开始到恢复的过程。

参数说明
(以下4个LSN是递减的,即: LSN1 ≥ LSN2 ≥ LSN3 ≥ LSN4 )

属性 说明
Log sequence number 当前系统最大的LSN号
log flushed up to 当前已经写入redo日志文件的LSN
pages flushed up to 已经将更改写入脏页的LSN号
Last checkpoint at 系统最后一次刷新buffer pool脏中页数据到磁盘的checkpoint

参考链接

  • https://blog.csdn.net/jasonlu888/article/details/45096885
  • https://blog.csdn.net/weixin_39997438/article/details/107737487
  • https://blog.csdn.net/sunsineq/article/details/120793940

关于命令SHOW ENGINE INNODB STATUS的一些细节相关推荐

  1. mysql innodb monitor_mysql:innodb monitor(show engine innodb status)探秘

    在旧的版本里面是show innodb status命令,新版本后改动了一些:show engine innodb status; 我们最熟悉的,应当就是show innodb status命令,可以 ...

  2. checkpoint机制,show engine innodb status

    show engine innodb status G 四个参数能反应出来什么 Checkpoint详解 引子 check point是做什么的 作用 Checkpoint所做的事情 checkpoi ...

  3. mysql 打印_故障分析 | MySQL:5.6大事务show engine innodb status故障一例

    作者:高鹏(网名八怪) 文章末尾有他著作的<深入理解 MySQL 主从原理 32 讲>,深入透彻理解 MySQL 主从,GTID 相关技术知识. 本文来源:转载自公众号-老叶茶馆, (作者 ...

  4. MYSQL-show engine innodb status

    mysql> show engine innodb status\G; *************************** 1. row ************************** ...

  5. mysql死锁分析工具show engine innodb status

    参考文章 <记录一次MySQL死锁的分析与解决过程> <mysql之show engine innodb status解读> <把MySQL中的各种锁及其原理都画出来&g ...

  6. show engine innodb status\G

    mysql> show engine innodb status\G *************************** 1. row *************************** ...

  7. show engine innodb status解读

    show engine innodb status解读 参考 https://www.cnblogs.com/xiaoboluo768/p/5171425.html show engine innod ...

  8. show engine innodb status和innodb锁监控

    目录 innodb monitor概述 innodb monitor的类型 innodb标准监控-Standard InnoDB Monitor innodb锁监控-InnoDB Lock Monit ...

  9. 【MySQL】MySQL 8 Show innodb status 命令改变

    1.概述 MySQL 8 中的名称Show innodb status 已经修改为show engine innodb status. ysql> Show innodb status\G; E ...

  10. unknown error mysql_解决MySQL执行SQL文件时报Error: Unknown storage engine 'InnoDB'的错误

    我运行了一个innoDB类型的sql文件,报了Error: Unknown storage engine 'InnoDB'错误,网上查了很多方法,但是都没办法真正解决我的问题,后来解决了,在这里总结一 ...

最新文章

  1. Linux常用命令学习(shell 脚本)
  2. RabbitMQ (三)消息重试
  3. 《全民捕鱼》游戏分析
  4. PMCAFF微分享 | 阿檬:如何设计好工具型软件?产品经理必备技能
  5. Hive的基本操作-排序
  6. [讨论帖] 程序员如何赚外快?
  7. 创建txt文件指令_Linux云计算教程全套视频合集:WORKDIR 指令讲解
  8. c#winform演练 ktv项目 实现播放完了一曲自动播放下一曲的功能
  9. thinkphp v5.0.11漏洞_ThinkPHP(5.1.x ~ 5.1.31 5.0.x ~ 5.0.23)GetShell漏洞
  10. HTML5学习笔记---Html5简单理解,发展情况...
  11. eclipse-阶段四-Server Tomcat v8.5 Server at localhost failed to start.
  12. minio 文件服务器,5分钟解决SpringBoot集成minio文件服务器的过程
  13. Android Studio 工具栏添加图标
  14. Windows下搭建kms激活服务器
  15. 内部收益率计算公式用计算机,用excel怎么计算内部收益率?
  16. Exploiting Spatial Structure for Localizing Manipulated Image Regions
  17. GAN之野狼DiscoGAN
  18. Unity3D for VR 学习(5): VR Gaze Input
  19. android+4.2+浏览器,一款小巧的安卓浏览器 Via浏览器 v4.2.8
  20. 1.3一摞烙饼的问题

热门文章

  1. arduino控制JQ8900-16P语音模块
  2. android中国卫星,安卓健中国首场卫星会现场提问精选
  3. 会计计算机操作步骤,2011年会计证《初级电算化》计算机基本操作讲解
  4. 从Linux服务器下载文件到window本地电脑
  5. 闭关修炼---网络原理之TCP协议
  6. [兴趣使然]用python在命令行下画jandan像素超载鸡
  7. 利用 HBuilderX 设置CSS样式会员注册页面
  8. 【2013南京区域赛】部分题解 hdu4802—4812
  9. AMC数学竞赛报名时间、参赛对象、奖项等信息大全
  10. error:无法将“vue”项识别为 cmdlet、函数、脚本文件或可运行程序的名称