0

I would like to see view's sql query that is executed in runtime. I found this method in google, hook_views_pre_execute, but I am really beginner in drupal. Where I have to apply this method, when I put this method as project_views_pre_execute in template.php, nothing is shown and I don't know why, is it needed to write it in custom module?

Any suggestion is greatly appreciated.

3
  • try devel module.
    – echo
    Commented Oct 15, 2015 at 9:00
  • Could you explain me detail, pls.
    – SAWAUNG
    Commented Oct 15, 2015 at 9:09
  • You could use this module to view the queries log for the page being loaded with their execution time.
    – echo
    Commented Oct 15, 2015 at 9:19

1 Answer 1

0

The Devel module provides a SQL query log for debugging/performance testing. You can enable this under Configuration > Development > Devel settings (/admin/config/development/devel) and by setting Display query log option.

enter image description here

Once enabled, the bottom of the page will contain all SQL queries executed in page rendering. For your needs, you'll need to look for views_plugin_query_default::execute function calls (the where column) to see the SQL query executed for your view.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.