Inspect a MySQL query plan with EXPLAIN
Ask MySQL how it plans to execute a SELECT before changing indexes or query structure.
Prefix a read query with EXPLAIN to inspect the plan MySQL selects. Look at the chosen key, access type, estimated rows, and extra notes. Estimates are not a substitute for measuring the query with representative data.
EXPLAIN
SELECT id, email
FROM users
WHERE status = 'active';
Use EXPLAIN ANALYZE only when it is available in your MySQL version and you are comfortable with the statement actually executing.
Review commands and snippets before using them in your environment. Examples are not executed by LeafDeft.