EXPLAIN

Shows how the database plans to run a query, so you can see why it is slow.

Also called: query plan, slow query

Source
General
Language
SQL

In plain English

Look at type (ALL means a full scan), key (which index is used) and rows (how many it expects to read).

Example

EXPLAIN showed a full table scan; an index fixed it.

In code

EXPLAIN SELECT * FROM bookings WHERE guest_email = 'ana@example.com';

Learn more

Related terms

Added 2026-11-30 · Last reviewed 2026-11-30