CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • displaying mysql query for debug
Pages: [1]

Author Topic: displaying mysql query for debug  (Read 1326 times)

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
displaying mysql query for debug
February 07, 2010, 04:05:58 am
hey,

i was wondering what the best way to display the mysql queries that are run during page load is.

in the end, i turned on query logging in mysql because i couldn't see a CiviCRM way of doing it, but that file was getting huge pretty quickly and it wasn't easy to navigate (lots of unecessary queries) I thought there was maybe a constant i could define in civicrm.settings.php that would output all queries at the top of the page / in a pop up somwhere, but i can't find that documented. maybe i imagined it...

FWIW, the reason I wanted to do this was that in 2.2.3 the activities tab was showing an artificially high count for activities for contacts that had sent emails.  Turns out that it was counting a email to 30 people as 30 activities, whereas it was only showing as one row in the activity tab.  (I guess this maybe fixed now and i did try and replicate on demo but there is no send email functionality). 

Maybe there is a better way to debug this kind of thing.  any suggestions?
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: displaying mysql query for debug
February 07, 2010, 06:46:39 am

in 2.2.x and prior we were creating 1 activity per email sent. we improved this in 3.0 and create one activity for the entire set of email / civimailing

you can use the drupal devel module and use that to display/log queries. civicrm is integrated with that (which i was unaware of till a few weeks back!)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: displaying mysql query for debug
February 07, 2010, 03:28:36 pm
great answer, thanks :)
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • displaying mysql query for debug

This forum was archived on 2017-11-26.