Search code examples
mysqlsqldatabaseexplain

Is it possible to execute multiple explains in one query in mysql?


is it possible to have more than 1 explains in one single query

eg. something like

(EXPLAIN SELECT * FROM tablea) UNION (EXPLAIN SELECT * FROM tableb) 

such that this one single query returns explain results of 2 queries instead of just one


Solution

  • Uh no. You can do;

    EXPLAIN SELECT * FROM tablea UNION SELECT * FROM tableb