Index-Condition-Pushdown.md


Index Condition Pushdown (ICP)

ICP opened automatically

What does ICP do?

example:

Table:

create table t(
    a int,
    b int,
    key(a,b)
);

Query:

select * from t where a like 'A%' and b=2;

Without ICP

MySQL scan rows match a like 'A%' first using secondary index, then scan rows match b=2 using primary index.

With ICP

MySQL scan rows match a like 'A%' and b=2 using secondary index, since b is the second column of key(a,b).