EXPLAIN shows what the optimizer expects to happen. When a query is slow anyway, I want to know what really happened, and MariaDB has a statement for that.
ANALYZE SELECT * FROM orders WHERE customer = 'ann';
The output has the same columns as EXPLAIN plus a few that start with r_. rows is the estimate, r_rows is what was actually read, and r_filtered is the share of rows that survived the WHERE. When rows says 10 and r_rows says 400000, the optimizer worked with bad statistics, and ANALYZE TABLE orders is the first thing I’d try.
A low r_filtered on a big table means the server reads lots of rows only to throw them away, which usually points at a missing or unused index. For more detail, ANALYZE FORMAT=JSON SELECT ... adds timings per step.
Unlike EXPLAIN, this executes the statement. For a SELECT that is fine. ANALYZE UPDATE and ANALYZE DELETE exist too, and they really change your data. Wrap those in a transaction and roll back, or run them on a copy. MySQL has a similar feature under another name, EXPLAIN ANALYZE, with different output.
Further reading: ANALYZE statement