-2

From MySQL CLI is there a way to get the execution plan of a query sourced from a file?

Assuming the following query in a file some-sql.sql

select *
from table

Called via:

mysql> source some-sql.sql

Is there a way to obtain an execution plan for this query?

nsfyn55
  • 14,875
  • 8
  • 50
  • 77

1 Answers1

1

Add 'explain' clause as first line in .sql file.

nsfyn55
  • 14,875
  • 8
  • 50
  • 77