• MYSQL 索引页 结构图


    create table t( a int(11) not null auto_increment,b char(3) default null,primary key(a));
    mysql> select * from t;
    +----+------+
    | a  | b    |
    +----+------+
    |  1 | aaa  |
    |  2 | bbb  |
    |  3 | ccc  |
    |  4 | ddd  |
    |  5 | eee  |
    |  6 | fff  |
    |  7 | ggg  |
    |  8 | hhh  |
    |  9 | iii  |
    | 10 | jjj  |
    +----+------+
    10 rows in set (0.00 sec)
    hexdump -C t.ibd

     

    锁结构与索引页对比

    RECORD LOCKS space id 142 page no 3 n bits 80 index `PRIMARY` of table `test`.`t` trx id 31785 lock_mode X Record lock, heap no 1 PHYSICAL RECORD: n_fields 1; compact format; info bits 0 0: len 8; hex 73757072656d756d; asc supremum;; Record lock, heap no 2 PHYSICAL RECORD: n_fields 4; compact format; info bits 0 0: len 4; hex 80000001; asc ;; 1: len 6; hex 000000007c12; asc | ;; 2: len 7; hex 8f000001460110; asc F ;; 3: len 3; hex 616161; asc aaa;; Record lock, heap no 3 PHYSICAL RECORD: n_fields 4; compact format; info bits 0 0: len 4; hex 80000002; asc ;; 1: len 6; hex 000000007c13; asc | ;; 2: len 7; hex 90000001b70110; asc ;; 3: len 3; hex 626262; asc bbb;; Record lock, heap no 4 PHYSICAL RECORD: n_fields 4; compact format; info bits 0 0: len 4; hex 80000003; asc ;; 1: len 6; hex 000000007c18; asc | ;; 2: len 7; hex 93000001b80110; asc ;; 3: len 3; hex 636363; asc ccc;; Record lock, heap no 5 PHYSICAL RECORD: n_fields 4; compact format; info bits 0 0: len 4; hex 80000004; asc ;; 1: len 6; hex 000000007c19; asc | ;; 2: len 7; hex 940000020a0110; asc ;; 3: len 3; hex 646464; asc ddd;; Record lock, heap no 6 PHYSICAL RECORD: n_fields 4; compact format; info bits 0 0: len 4; hex 80000005; asc ;; 1: len 6; hex 000000007c1a; asc | ;; 2: len 7; hex 950000014b0110; asc K ;; 3: len 3; hex 656565; asc eee;; Record lock, heap no 7 PHYSICAL RECORD: n_fields 4; compact format; info bits 0 0: len 4; hex 80000006; asc ;; 1: len 6; hex 000000007c1b; asc | ;; 2: len 7; hex 960000014c0110; asc L ;; 3: len 3; hex 666666; asc fff;; Record lock, heap no 8 PHYSICAL RECORD: n_fields 4; compact format; info bits 0 0: len 4; hex 80000007; asc ;; 1: len 6; hex 000000007c20; asc | ;; 2: len 7; hex 99000001a10110; asc ;; 3: len 3; hex 676767; asc ggg;; Record lock, heap no 9 PHYSICAL RECORD: n_fields 4; compact format; info bits 0 0: len 4; hex 80000008; asc ;; 1: len 6; hex 000000007c21; asc |!;; 2: len 7; hex 9a0000014f0110; asc O ;; 3: len 3; hex 686868; asc hhh;; Record lock, heap no 10 PHYSICAL RECORD: n_fields 4; compact format; info bits 0 0: len 4; hex 80000009; asc ;; 1: len 6; hex 000000007c22; asc |";; 2: len 7; hex 9b000001500110; asc P ;; 3: len 3; hex 696969; asc iii;; Record lock, heap no 11 PHYSICAL RECORD: n_fields 4; compact format; info bits 0 0: len 4; hex 8000000a; asc ;; 1: len 6; hex 000000007c23; asc |#;; 2: len 7; hex 9c000001a40110; asc ;; 3: len 3; hex 6a6a6a; asc jjj;;
  • 相关阅读:
    美化滚动条
    js 格式转化
    vue 实现 前端生成随机验证码
    Vue.js CLI4 Vue.config.js标准配置
    在鼠标右键 新建 添加md文件
    节流和防抖
    关于IE 浏览器 GET 请求缓存问题
    VSCode 背景插件
    Java后台开发Tomcat添加https支持小程序开发过程
    InnoDB与MyISAM等存储引擎对比
  • 原文地址:https://www.cnblogs.com/zengkefu/p/5620840.html
Copyright © 2020-2023  润新知