0

I have a MySQL Query.

When I run without derived table, the execution time is about 6 sec. However, if I run with derived table, the execution takes less than 1 sec. I have seen the EXPLAIN SELECT PLAN of the query. I do not get much out of it. I can't add indexes on tables or use view or procedures.

However, I am not sure which query to move with derived query or simple query. AND does I need to consider the EXPLAIN result, or the actual execution time for selection of best option.

msrd0
  • 7,816
  • 9
  • 47
  • 82
kayra
  • 228
  • 3
  • 10
  • You say you "do not get much out of" the `EXPLAIN`. Does that mean there's not much output from EXPLAIN, or you are having difficulty deciphering the information it returns. The MySQL Reference manual provides some information about the EXPLAIN output: [http://dev.mysql.com/doc/refman/5.5/en/execution-plan-information.html](http://dev.mysql.com/doc/refman/5.5/en/execution-plan-information.html) – spencer7593 Aug 08 '14 at 18:47
  • I do not understand the explain more. – kayra Aug 08 '14 at 18:49

1 Answers1

0

Yes, you should consider both the EXPLAIN output and the actual execution time.

I have lots of queries that have inline views ("derived tables" in MySQL parlance). And some of those run much faster than alternate queries that return equivalent results, but which don't use inline views.

spencer7593
  • 106,611
  • 15
  • 112
  • 140