Use the EXPLAIN Keyword
If your query is running slow, the EXPLAIN command provides a quick overview of the query plan. Examining the query plan may help to identify possible sources of the inefficiency. You can use it to derive possible improvements to the physical database design.
To retrieve the query plan, run the EXPLAIN command followed by the actual SQL query.
For more information about analyzing the query plans with the EXPLAIN keyword, see EXPLAIN SQL Command.