Page Timer and Query

To configure the Devel module, navigate to administer> settings > devel (admin/settings/ devel). The settings page has options for enabling the page timer and the query log. The information they generate will be visible to users with the Access Devel Information permission.

The Query Execution Threshold field is the threshold in milliseconds for queries to be considered slow. Queries that exceed this threshold or execute more than once will be highlighted in the query log that appears at the bottom of each screen (when this log is turned on). You can adjust this threshold to give you the most meaningful data.

In many cases, Drupal will perform a set of queries and actions, only to redirect you to a screen or path other than the one you requested. A classic example of this is the 404 Not Found screen. For example, you request the page for node/4711, but there is no node with that ID, so Drupal tells you it can't find it. The problem this presents for debugging is that the SQL queries for the first part of the operation—the part where Drupal looks up 4711 and doesn't find anything—are not included in the query log because of the redirection that occurs thereafter. The Display Redirection Page field takes care of this problem by alerting you when a redirect is about to occur and waiting for your input before the redirect is carried out. This gives you the chance to inspect the queries that occur prior to the redirection as well as after.

0 0

Post a comment