Cyrve: EXPLAIN for Devel query log - #D7CX

The query log feature of devel.module has faithfully served us since 2002, relatively unchanged. Since then, the web learned about AJAX and now devel for Drupal 7 finally gets with the times.

In the ops column of the screenshot above, you will see three ajax links titled P, A, E. Those stand for Placeholders, Arguments, and EXPLAIN. They work as follows:

  • Placeholders. This is the default presentation of a query. Here we see SQL with placeholders instead of values. This is the most compact representation.
  • Arguments. This link retrieves the same SQL replaces placeholders with actual values. This presentation is helpful for debugging and for copy/paste into you mysql editor for optimization.
  • EXPLAIN. This link shows the EXPLAIN output for the query. This is super helpful for optimizing any slow query.

Also, The far right column is helpful for knowing which slave server actually executed a given query (master/slave is a new feature of D7).read more