Recipe 54: Formatting Views queries
Note
Ingredients
Devel module: http://drupal.org/project/devel
Instant SQL Formatter: http://www.dpriver.com/pp/sqlformat.htm
Chrome Browser (Optional): http://www.google.com/chrome
The Views module constructs a query to select and sort specific data from a Drupal site. The Views UI greatly eases the task of writing Structured Query Language (SQL). This recipe enables the display of the Views query along with a utility for "pretty-printing" for easier reading.
Install the Devel module.
Go to the Devel module settings at
admin/settings/devel
and enable the collection and display of query information.Open a page with a view. Find views_build_view in a list of functions at the bottom of the page. The Devel module is displaying the full query and the time that it took to run in milliseconds. Consider using Google's Chrome browser for this text search. Chrome helpfully displays markers on the browser scrollbar signaling where all the search results are located on...