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 »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Db logging - tables that shouldn't be logged
Pages: [1]

Author Topic: Db logging - tables that shouldn't be logged  (Read 746 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Db logging - tables that shouldn't be logged
November 10, 2013, 03:21:32 pm
Hi, I'm noticing db size blow out due to logging being on for some tables that have a lot of unimportant stuff written to them. I can delete the triggers but they come back.

The table that seems truly unnecessary to log which is a stand out for me is the civicrm_job_log table - the fact there is a cleanup routine on this suggests the data does not have a long term value & I would suggest we specifically remove it from this table.

The other tables that I am noticing are mailing response tables (bounces etc) (& some custom value tables which is customer specific issue).

Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Db logging - tables that shouldn't be logged
November 11, 2013, 12:23:13 am
I think the logging of custom tables should be an option when you create the custom group?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Db logging - tables that shouldn't be logged
November 11, 2013, 01:09:10 am
I think 4.4 onwards we no longer log tables like civicrm_job_log, I can't seem to find an issue though ..

Kurund
Found this reply helpful? Support CiviCRM

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: Db logging - tables that shouldn't be logged
November 11, 2013, 07:08:01 am

i dont think custom groups should be treated specially :) If we are going to making logging optional, we should give that option for all tables.

In 4.3 onwards, we dont log, log tables, read only tables and cache tables for performance reasons (and they are not useful either)

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

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
Re: Db logging - tables that shouldn't be logged
November 13, 2013, 07:12:16 pm
There is also an opportunity for reducing bloat by comparing all fields for old vs new in the trigger and only writing if there is an actual change. Our code is running many update queries that don't change the data, leading to unnecessary log table bloat. I might be wrong, but changing a single field on a contact edit form will as I understand it result in many records in many tables being updated because our libraries / packages don't do this work for us. Putting such cheques into the triggers for non log tables would significantly reduce disk access and improve performance even when logging is off. It would also make it easier to make sense of the logs for an entry / record / contact. unfortunately when I tried to prototype this I found that cancelling the write ended up creating errors bubbling up from mysql to php in a way that would have required chequing particular mysql error codes on every db write, and I didn't think our writes all went through our DAOs so the scope was too big to handle for a small client's budget.
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Db logging - tables that shouldn't be logged
November 13, 2013, 07:15:16 pm
Hmm - my experience was mysql checks for the change - but sometimes civi causes 2 changes to acheive no result - which causes bloat. This used to be the case around the 'is_primary' field where it existed but was fixed.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
Re: Db logging - tables that shouldn't be logged
November 13, 2013, 07:56:05 pm
That's possible. My investigation was a long time ago and in response to a query / concern from BackOffice Thinking.
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Db logging - tables that shouldn't be logged

This forum was archived on 2017-11-26.