【发布时间】:2018-06-13 07:37:22
【问题描述】:
我知道如果一个表太大,索引就很难放入buffer_pool, 所以使用索引可能会导致大量的随机磁盘IO。所以全表扫描, 一般来说,它可能比索引扫描快得多,即使它只读取大约 %1 行。
What I am confused about is :
[0] If there are a big table( 30 millions rows),and many small tables(each table can be fit into memory(buffer)),
will the big table also affect query about small tables ?
My logic is <======>
the buffer is shared by the whole database, so the big table will take most of buffer.
So the indexes of small tables can also hardly be fit into buffer(or it's often
removed from the buffer). Then the above conclusion(full table scan vs index scan) can be applied to this case .
[1] When the big table are partitioned into may small tables(in just one machine), the situation of buffer should keep identical.
So such partition cannot solve this problem(full table scan vs index scan), right? so the "big table" should not mean "one big table", but the "huge database or the sum of data is large"
总而言之,我的加入对吗?如果错了,为什么?请给我一个提示。非常感谢。
【问题讨论】:
标签: mysql database caching innodb