When the query does not meet the conditions for index coverage,if Innodb will use index condition pushdown by auto?
or how to explain these two thing by simple word or example.
When the query does not meet the conditions for index coverage,if Innodb will use index condition pushdown by auto?
or how to explain these two thing by simple word or example.
2
Answers
Index coverage: The index can fully satisfy the query without accessing the table data.
Index condition pushdown (ICP): The database engine pushes down certain conditions to the storage engine when there’s no full index coverage, to optimize the query.
In other words, index coverage is about the index’s capability, while ICP is a technique the database uses to optimize queries when there’s no full index coverage.
https://dev.mysql.com/doc/refman/en/index-condition-pushdown-optimization.html says:
And later in the same manual page:
(bold emphasis mine)
This means that ICP is mutually exclusive with covering index optimization. No query will use both optimizations.
Both optimizations are employed automatically, if the optimizer can find a way to use them. In some queries, these optimizations are not applicable.
A covering index is used when all the columns for a given table referenced in the query come from a single index. In that case, the full rows referenced by the index don’t need to be read at all.
ICP is used to avoid reading some full rows, by applying conditions to columns at the index level.