Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于MySQL索引篇有句话歧义疑问 #293

Open
semanym opened this issue Nov 20, 2024 · 0 comments
Open

关于MySQL索引篇有句话歧义疑问 #293

semanym opened this issue Nov 20, 2024 · 0 comments

Comments

@semanym
Copy link

semanym commented Nov 20, 2024

在文章 /mysql/index/2000w.html#单表建议值 结尾有这么一段话
”MySQL 为了提高性能,会将表的索引装载到内存中,在 InnoDB buffer size 足够的情况下,其能完成全加载进内存,查询不会有问题。”
这句话略有疑问,我理解的是:内存足够会把整个索引装载在内存中,这样查询的时候就减少了磁盘IO。但是我在网上貌似并没有看到准确的有类似的说法?
而且这句话也很容易质疑,一般来说是有磁盘IO装载某一页的索引,而原文说的“表的索引”范围是多大呢?“全加载进内存”的“全”是全部吗?是整个表的索引?包含叶子节点吗(也就是数据)?一个千万级别的表,B+树的第二层大约有(1280 ^2)页,这也不太可能装载进内存吧?
对此话略有疑惑

@semanym semanym changed the title 关于MySQL索引歧义疑问 关于MySQL索引篇有句话歧义疑问 Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant