叶子节点如何在innodb中分裂? [英] How does a leaf node split in innodb?

查看:438
本文介绍了叶子节点如何在innodb中分裂?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果记录按升序插入(通常主键是自动递增),那么每次拆分都会导致旧叶半满。因为记录按升序插入,所以后面的记录将被插入新的叶节点,直到下一个split.Old叶节点将保持半满状态。

实际上一个逻辑节点等于innodb中的物理页面。如果半满的页面导致浪费存储空间?



我尝试过:



参考参考:

b +树分割: Wiki B + tree

innodb b +树索引结构: InnoDB中的B + Tree索引结构 - Jeremy Cole

If the records are inserted in ascending order(usually primary key is auto-increment),so each split will cause the old leaf half-full.Since the records are inserted in ascending order,so the later records will be insert into the new leaf node until the next split.Old leaf node will keep half-full state.
Actually a logical node is equal to a physical page in innodb.So if the half-full page cause a waste of storage space?

What I have tried:

read reference:
b+tree split:Wiki B+ tree
innodb b+ tree index structure:B+Tree index structures in InnoDB - Jeremy Cole

推荐答案

一般来说,B +树节点平均约为65%-75%,并且它们并非全部是设计完整的。



至于浪费的空间,真实的ly取决于页面如何写入磁盘,但可能存在一些浪费。
Generally B+tree nodes are about ~65%-75% full on average, and yes they are not all full that is by design.

As for wasted space, that really depends on how the page is written to disk, but potentially there is some "waste".


这篇关于叶子节点如何在innodb中分裂?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆