Skip to main content
InterviewHubPRO
Section Overview
Q21

Question 21 of 50

Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

42%
MySQL & InnoDB (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

How do you analyze `EXPLAIN` output fields (type, key, rows, Extra)?

senior LevelmysqlAdvanced Internals

In Simple Words:

  • type (Access type, from best to worst): system > const (unique key lookup) > eq_ref (unique join) > ref (non-unique index) > range (index range scan) > index (full index scan) > ALL (fatal full table scan!).
  • key: The actual index name utilized by MySQL.
  • rows: Estimated number of rows MySQL must examine.
  • Extra:
    • Using index: Good! Covering index utilized.
    • Using where: Filter evaluated after fetching rows.
    • Using index condition: Index Condition Pushdown (ICP) active.
    • Using filesort: Bad! Sorting required memory/disk sorting.
    • Using temporary: Bad! Temporary table created on disk.