Covering Indexes & Index Condition Pushdown (ICP)0%

Covering Indexes & Index Condition Pushdown (ICP)

Advanced13 min readUpdated: 2026-09-12
Study Materials

Covering Indexes & Index Condition Pushdown (ICP)

Two of the most impactful performance optimizations in modern MySQL database engineering are Covering Indexes and Index Condition Pushdown (ICP). Both drastically slash disk I/O and CPU overhead by resolving queries directly inside the storage engine.


1. Covering Indexes: Zero Double Lookups

A Covering Index is not a special type of index; it is an indexing design pattern where an index contains all the columns requested by a query (SELECT, WHERE, ORDER BY, GROUP BY).

When an index is covering:

  1. 1
    InnoDB satisfies the entire query solely by reading the secondary index B+Tree.
  2. 2
    It never touches the clustered index or physical table rows!
  3. 3
    In EXPLAIN output, the Extra column displays: Using index.
SQL
-- Problem Query:
SELECT customer_id, order_date, total_amount
FROM orders
WHERE status = 'SHIPPED';
 
-- Standard Index on (status):
-- Requires fetching PK, then doing a double lookup to read order_date and total_amount.
 
-- High-Performance Covering Index:
CREATE INDEX idx_orders_covering
ON orders (status, customer_id, order_date, total_amount);

Now, MySQL reads everything directly from idx_orders_covering, completely bypassing table page lookups!


2. Index Condition Pushdown (ICP)

Prior to MySQL 5.6, when a query had multiple conditions on a composite index where some conditions could not be resolved by tree traversal (e.g., due to a range or wildcard), the storage engine fetched the full row and sent it up to the MySQL Server layer for filtering.

Index Condition Pushdown (ICP) pushes condition evaluation down into the storage engine:

  • The storage engine evaluates index columns against query predicates before reading the full table row.
  • If the row does not qualify, InnoDB discards it immediately without reading the clustered index!
  • In EXPLAIN output, the Extra column displays: Using index condition.
SQL
-- Table has index on (zipcode, last_name, first_name)
SELECT * FROM people
WHERE zipcode = '90210'
AND last_name LIKE '%son'
AND address LIKE '%Main%';

With ICP:

  1. 1
    InnoDB uses zipcode = '90210' to navigate the index tree.
  2. 2
    InnoDB inspects last_name LIKE '%son' directly inside the index leaf before fetching the table row!
  3. 3
    Only rows matching the pattern cause a clustered index lookup for address.

Inspecting and Enabling ICP

ICP is enabled by default in MySQL:

SQL
-- Check optimizer switch settings for ICP
SELECT @@optimizer_switch LIKE '%index_condition_pushdown=on%';
 
-- Toggle ICP
SET optimizer_switch = 'index_condition_pushdown=on';

Multiple Choice Questions

1. What defines a "Covering Index"?

A. An index that covers every table in the database B. An index that contains all columns requested by a query, allowing execution without touching base table rows C. A primary key that covers all foreign keys D. An index encrypted with SSL Answer: B Explanation: A covering index satisfies the entire query from the index tree alone, avoiding clustered index table lookups entirely.


2. What indicator appears in EXPLAIN's Extra column when a covering index is used?

A. Using temporary B. Using filesort C. Using index D. Using where only Answer: C Explanation: The presence of Using index in the Extra column signifies that the query was resolved entirely within the secondary index structure.


3. What does Index Condition Pushdown (ICP) accomplish?

A. Pushes database updates to client machines B. Evaluates WHERE filter conditions inside the storage engine index layer before fetching base rows C. Automatically compresses index files D. Disables locks during bulk inserts Answer: B Explanation: ICP pushes filtering logic down into the storage engine, drastically reducing the number of times full table rows must be fetched.


4. What appears in EXPLAIN's Extra column when ICP is active for a query?

A. Using index condition B. Using MRR C. Using pushed filter D. Using index only Answer: A Explanation: Using index condition indicates that Index Condition Pushdown is actively filtering candidate rows at the storage engine level.


5. Why do covering indexes dramatically improve high-concurrency read throughput?

A. They convert SQL into C++ binaries B. They reduce buffer pool memory churn and eliminate random I/O from double lookups C. They bypass ACID transaction logs D. They execute queries in parallel threads Answer: B Explanation: Covering indexes avoid the secondary clustered index lookup, drastically lowering disk reads and memory page contention.


Next Lesson

Full-Text Search Indexes (MATCH ... AGAINST)

Continue learning with hands-on practice, examples, and exercises in the upcoming topic.

Practice Quiz

Test your understanding of this lesson with 5 questions. Each question has one correct answer.

PrevNext