Answers.Body: <p>There's something wrong with your smart group with an ID of 95.  However, this is unlikely to be causing a performance problem, since this query simply isn't running.  If you can delete and recreate your smart group with an ID of 95, this error should go away.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-26T14:24:08.953Z
Answers.LastActivityDate: 2019-08-26T14:24:08.953Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>After a database was corrupted and reloaded from a backup. 
  Looking at the error log this appears to be where CiviCRM is hanging.</p>
  
  <blockquote>
    <p>CRM_Contact_BAO_GroupContactCache::load(Object(CRM_Core_DAO))</p>
  </blockquote>
  
  <p>Here is the debug information. </p>
  
  <blockquote>
    <p>[debug_info] => CREATE TEMPORARY TABLE
    civicrm_temp_group_contact_cache1632  (SELECT 95 as group_id, 
    contact_a.id as id   FROM civicrm_contact contact_a    LEFT JOIN
    civicrm_email ON (contact_a.id = civicrm_email.contact_id AND
    civicrm_email.is_primary = 1)   WHERE  (  ( 
    (NULLIF(civicrm_email.email, '') IS NOT NULL)  AND
    contact_a.do_not_email =  AND contact_a.is_opt_out =  AND
    contact_a.contact_type = 'Individual' )  )  AND (contact_a.is_deleted
    = 0)   AND contact_a.id NOT IN (
                                   SELECT contact_id FROM civicrm_group_contact
                                   WHERE civicrm_group_contact.status = 'Removed'
                                  AND   civicrm_group_contact.group_id = 95 ) ); [nativecode=1064 ** You have an error in your SQL syntax;
    check the manual that corresponds to your MySQL server version for the
    right syntax to use near 'AND contact_a.is_opt_out =  AND
    contact_a.contact_type = 'Individual' )  )  AND ' at line 1]</p>
  </blockquote>
  
  <p>Any advice on how to resolve this is appreciated. </p>
  
  <p>Thanks,
  Josh</p>
  
Tags: <mysql><cache>
Title: Everything In CRM is Slow - Errors With CRM_Contact_BAO_GroupContactCache
ThreadText: # Everything In CRM is Slow - Errors With CRM_Contact_BAO_GroupContactCache
  
  (Asked by: username_0 on 2019-08-26)
  
  After a database was corrupted and reloaded from a backup.
  Looking at the error log this appears to be where CiviCRM is hanging.
  
  > CRM\_Contact\_BAO\_GroupContactCache::load(Object(CRM\_Core\_DAO))
  
  Here is the debug information.
  
  > [debug\_info] => CREATE TEMPORARY TABLE
  > civicrm\_temp\_group\_contact\_cache1632 (SELECT 95 as group\_id,
  > contact\_a.id as id FROM civicrm\_contact contact\_a LEFT JOIN
  > civicrm\_email ON (contact\_a.id = civicrm\_email.contact\_id AND
  > civicrm\_email.is\_primary = 1) WHERE ( (
  > (NULLIF(civicrm\_email.email, '') IS NOT NULL) AND
  > contact\_a.do\_not\_email = AND contact\_a.is\_opt\_out = AND
  > contact\_a.contact\_type = 'Individual' ) ) AND (contact\_a.is\_deleted
  > = 0) AND contact\_a.id NOT IN (
  > SELECT contact\_id FROM civicrm\_group\_contact
  > WHERE civicrm\_group\_contact.status = 'Removed'
  > AND civicrm\_group\_contact.group\_id = 95 ) ); [nativecode=1064 \*\* You have an error in your SQL syntax;
  > check the manual that corresponds to your MySQL server version for the
  > right syntax to use near 'AND contact\_a.is\_opt\_out = AND
  > contact\_a.contact\_type = 'Individual' ) ) AND ' at line 1]
  
  Any advice on how to resolve this is appreciated.
  
  Thanks,
  username_0
  
  **Tags:** mysql, cache
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-08-26. Score: 2
  
  There's something wrong with your smart group with an ID of 95. However, this is unlikely to be causing a performance problem, since this query simply isn't running. If you can delete and recreate your smart group with an ID of 95, this error should go away.
  
  
  ---
  
  