Answers.Body: <p>The gccache one is group contact cache. You probably have a cron job that rebuilds the group contact cache periodically, or it can also happen when the cache expires.</p>
  <p>The other ones come from either</p>
  <ul>
  <li>converting to utf8mb4, which you probably only ran once but it would have run on every table</li>
  <li>turning on advanced logging (administer - system settings - misc) which also you probably would have only turned on once, but it will also partially run when you do something like add a custom field</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-02T07:57:35.933Z
Answers.Text: Thanks Demerit. Can I ask a foillow up? I did once turn on advance logging but it is turned off now and I think I did convert to  utf8mb4. Are you saying that these thongs will still be impacting on the sql minutes?
Answers.UserDisplayName: Caroline B
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-02T11:09:57.467Z
Answers.Text: Ok, then those two shouldn't anymore.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-01T15:53:33.633Z
Answers.LastActivityDate: 2021-06-01T15:53:33.633Z
Answers.UserDisplayName: Demerit
Body: <p>My host has said one of my sites is using too many sql minutes.
  I have a list of sql queries (20 in total) which are using the most system resources.</p>
  <p>The information starts</p>
  <pre><code>'civicrm_tmp_e_gccache_50974519e3a17388f13e9f857d1c2320'
  #    SHOW CREATE TABLE `database_civicrm`.`civicrm_tmp_e_gccache_50974519e3a17388f13e9f857d1c2320`
  #    SHOW TABLE STATUS FROM `database_civicrm` LIKE 'civicrm_contact'
  #    SHOW CREATE TABLE `database_civicrm`.`civicrm_contact`
  #    SHOW TABLE STATUS FROM `database_civicrm` LIKE 'civicrm_activity_contact'
  #    SHOW CREATE TABLE `database_civicrm`.`civicrm_activity_contact`
  #    SHOW TABLE STATUS FROM `database_civicrm` LIKE 'civicrm_activity'
  #    SHOW CREATE TABLE `database_civicrm`.`civicrm_activity`
  #    SHOW TABLE STATUS FROM `database_civicrm` LIKE 'civicrm_group_contact'
  #    SHOW CREATE TABLE `database_civicrm`.`civicrm_group_contact`
  </code></pre>
  <p>How can I match this information up with something my civicrm is doing? This query has run for 172seconds and run 1239 times - although I'm not sure over what time period.</p>
  <p>Thanks
  Caroline</p>
  
Tags: <mysql>
Title: sql queries using too many resources
ThreadText: # sql queries using too many resources
  
  (Asked by: username_0 on 2021-06-01)
  
  My host has said one of my sites is using too many sql minutes.
  I have a list of sql queries (20 in total) which are using the most system resources.
  The information starts
  'civicrm_tmp_e_gccache_50974519e3a17388f13e9f857d1c2320'
  #    SHOW CREATE TABLE `database_civicrm`.`civicrm_tmp_e_gccache_50974519e3a17388f13e9f857d1c2320`
  #    SHOW TABLE STATUS FROM `database_civicrm` LIKE 'civicrm_contact'
  #    SHOW CREATE TABLE `database_civicrm`.`civicrm_contact`
  #    SHOW TABLE STATUS FROM `database_civicrm` LIKE 'civicrm_activity_contact'
  #    SHOW CREATE TABLE `database_civicrm`.`civicrm_activity_contact`
  #    SHOW TABLE STATUS FROM `database_civicrm` LIKE 'civicrm_activity'
  #    SHOW CREATE TABLE `database_civicrm`.`civicrm_activity`
  #    SHOW TABLE STATUS FROM `database_civicrm` LIKE 'civicrm_group_contact'
  #    SHOW CREATE TABLE `database_civicrm`.`civicrm_group_contact`
  
  How can I match this information up with something my civicrm is doing? This query has run for 172seconds and run 1239 times - although I'm not sure over what time period.
  Thanks
  Caroline
  
  **Tags:** mysql
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-06-01. Score: 1 | Accepted answer
  
  The gccache one is group contact cache. You probably have a cron job that rebuilds the group contact cache periodically, or it can also happen when the cache expires.
  
  The other ones come from either
  
  * converting to utf8mb4, which you probably only ran once but it would have run on every table
  * turning on advanced logging (administer - system settings - misc) which also you probably would have only turned on once, but it will also partially run when you do something like add a custom field
  
  > **Comments:**
  > **username_0**: Thanks username_1. Can I ask a foillow up? I did once turn on advance logging but it is turned off now and I think I did convert to  utf8mb4. Are you saying that these thongs will still be impacting on the sql minutes?  
  > **username_1**: Ok, then those two shouldn't anymore.  
  
  ---
  
  