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) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Change Logging - Performance Issue
Pages: [1]

Author Topic: Change Logging - Performance Issue  (Read 246 times)

mrpaul

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
Change Logging - Performance Issue
December 21, 2014, 11:04:30 am
Hi there

I've enabled logging on our production site, but getting timeouts due to the length of times the queries take to return. 

To try and resolve it, I've converted all the table engines from ARCHIVE to InnoDB as recommended by Eileen here: http://forum.civicrm.org/index.php/topic,32225.msg137892.html#msg137892

I haven't added any indexes, as not sure what to add.

Any recommendations, suggestions, ideas on how to resolve this?

For example - this from the mySQL slow log:
Query_time: 657.225739
Lock_time: 0.000114 Rows_sent: 0  Rows_examined: 290549070


Code: [Select]
   
use civicrm;
SET timestamp=1419186263;
SELECT DISTINCT lt.id FROM `civicrm`.`log_civicrm_note` lt
WHERE log_conn_id = 60 AND
      log_date BETWEEN DATE_SUB('20141221181314', INTERVAL 10 SECOND)
AND DATE_ADD('20141221181314', INTERVAL 10 SECOND)
      AND ( entity_id = 110556 AND entity_table = 'civicrm_contact' )
OR (entity_id IN (SELECT note.id FROM civicrm.log_civicrm_note note
WHERE note.entity_id = 110556 AND note.entity_table = 'civicrm_contact')
AND entity_table = 'civicrm_note');

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: Change Logging - Performance Issue
December 21, 2014, 02:00:35 pm

u'll need to at least add an index to entity_id, entity_table in the two log tables mentioned below. Also on conn_id and date

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Change Logging - Performance Issue

This forum was archived on 2017-11-26.