V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
MySQL 5.5 Community Server
MySQL 5.6 Community Server
Percona Configuration Wizard
XtraBackup 搭建主从复制
Great Sites on MySQL
Percona
MySQL Performance Blog
Severalnines
推荐管理工具
Sequel Pro
phpMyAdmin
推荐书目
MySQL Cookbook
MySQL 相关项目
MariaDB
Drizzle
参考文档
http://mysql-python.sourceforge.net/MySQLdb.html
zhao1014
V2EX  ›  MySQL

索引树高会影响磁盘 I/O 次数吗?

  •  
  •   zhao1014 · Jul 26, 2022 · 2404 views
    This topic created in 1371 days ago, the information mentioned may be changed or developed.

    MySQL 把数据页加载进内存后再检索索引树,那不是内存 I/O 么跟磁盘 I/O 啥关系?磁盘 I/O 不是在加载数据页( B+Tree 节点)时才触发么?

    5 replies    2022-08-01 16:26:37 +08:00
    JeromeCui
        1
    JeromeCui  
       Jul 26, 2022
    非叶子节点也是 B+树的节点,存在磁盘上啊
    LeegoYih
        2
    LeegoYih  
       Jul 26, 2022
    树高会影响 IO 次数,用 B+Tree 树就是这个原因,比 B-Tree 更矮更胖。

    数据页是从磁盘加载到内存中的,如果发现数据不在当前页,可能在下一页,才会去磁盘继续加载页。
    Jooooooooo
        3
    Jooooooooo  
       Jul 26, 2022
    搜 buffer pool
    Aresxue
        4
    Aresxue  
       Aug 1, 2022   ❤️ 1
    当前,因为不是所有数据都在 buffer pool 里面,一般情况下 B+树只有根节点才是常驻内存的。
    zhao1014
        5
    zhao1014  
    OP
       Aug 1, 2022
    @Aresxue 记岔了,我以为一次 I/O 能把整个树加载进内存呢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3000 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 15:13 · PVG 23:13 · LAX 08:13 · JFK 11:13
    ♥ Do have faith in what you're doing.