MySQL Index Condition
Pushdown(ICP)性能优化法实
这篇章主要介绍MySQL Index Condition Pushdown(ICP)性能优化
法实,本讲解概念介绍、原、实践案、案分析、ICP的使限
制等内容,需要的朋友可以参考下
概念介绍
Index Condition Pushdown (ICP)是MySQL 5.6 版本中的新特性,是种在
存储引擎层使索引过滤数据的种优化式。
a 当关闭ICP时,index 仅仅是data access 的种访问式,存储引擎通过
索引回表获取的数据会传递到MySQL Server 层进where条件过滤。
b 当打开ICP时,如果部分where条件能使索引中的字段,MySQL Server 会
把这部分下推到引擎层,可以index过滤的where条件在存储引擎层进
数据过滤,将所有通过index access的结果传递到MySQL server层进
where过滤.
优化效果:ICP能减少引擎层访问基表的次数和MySQL Server 访问存储引
擎的次数,减少io次数,提查询语性能。
原
Index Condition Pushdown is not used:
1 Get the next row, first by reading the index tuple, and then by using
the index tuple to locate and read the full table row.
2 Test the part of the WHERE condition that applies to this table. Accept
or reject the row based on the test result.
Index Condition Pushdown is used
1 Get the next row s index tuple (but not the full table row).
2 Test the part of the WHERE condition that applies to this table and can
be checked using only index columns.
If the condition is not satisfied, proceed to the index tuple for the next