Answers.Body: <p>This is not a specific answer to your questions but an option for larger smart groups to improve performance is to use the CiviRules extension to manage group memberships. So when a certain activity happens a contact is added or removed from a standard group. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-04T14:31:11.693Z
Answers.LastActivityDate: 2017-08-04T14:31:11.693Z
Answers.UserDisplayName: KilakwaBT
Answers.Body: <p>Smart groups are kind of complicated. If you've got a small install, using the defaults will generally just work, i.e. there will be temporary caching that gets refreshed when necessary.</p>
  
  <p>To answer your first question though, smart groups are updated depending on the timeout configuration and/or the scheduled job, and also depending on urls being loaded.</p>
  
  <p>To answer your second question - if you mean disabled instead of hidden, then the answer is that I don't think they are ever updated. But if you mean when you're looking at the groups of an individual contact - then the smart groups are only calculated when you open the section of the page that displays them.</p>
  
  <p>In other words, there are quite a few clever ways that CiviCRM tries to cache smart group results to avoid long re-calculations.</p>
  
  <p>If you've got performance issues, especially with a larger install, then you'll want to think about the configuration under the Administer -> Customize Data and Screens -> Search settings. In there you can set a different default timeout for the smart group cache so that your site isn't constantly recalculating smart groups. You can also set this to a very large number and then use the system job to selectively regenerate the cache as appropriate for each smart group.</p>
  
  <p>BUT, this gets tricky and is often counter-intuitive about the results, you'll find quite a few discussions about optimal settings for this.</p>
  
  <p>The best advice (yes, not your question) is that if you're having issues, e.g. with slowness due to caches being rebuilt, then the first thing to do is to get rid of unused smart groups. A couple of smart groups that include all your contacts (e.g. all individuals) can really take a long time to regenerate for a large number of contacts.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-03T21:12:29.897Z
Answers.LastActivityDate: 2017-08-03T21:17:54.940Z
Answers.LastEditDate: 2017-08-03T21:17:54.940Z
Answers.UserDisplayName: Alan Dixon
Body: <p>What updates a smart group? Is it all based on the cron/scheduled job that runs updating the group members based on specific criteria?</p>
  
  <p>Additionally are hidden smart groups updated when the cron/schedule job runs or are hidden smart groups not included when smart groups are updated?</p>
  
Tags: <smartgroups><cron>
Title: How Smart Groups Work
ThreadText: # How Smart Groups Work
  
  (Asked by: username_0 on 2017-08-03)
  
  What updates a smart group? Is it all based on the cron/scheduled job that runs updating the group members based on specific criteria?
  
  Additionally are hidden smart groups updated when the cron/schedule job runs or are hidden smart groups not included when smart groups are updated?
  
  **Tags:** smartgroups, cron
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2017-08-03. Score: 7 | Accepted answer
  
  Smart groups are kind of complicated. If you've got a small install, using the defaults will generally just work, i.e. there will be temporary caching that gets refreshed when necessary.
  
  To answer your first question though, smart groups are updated depending on the timeout configuration and/or the scheduled job, and also depending on urls being loaded.
  
  To answer your second question - if you mean disabled instead of hidden, then the answer is that I don't think they are ever updated. But if you mean when you're looking at the groups of an individual contact - then the smart groups are only calculated when you open the section of the page that displays them.
  
  In other words, there are quite a few clever ways that CiviCRM tries to cache smart group results to avoid long re-calculations.
  
  If you've got performance issues, especially with a larger install, then you'll want to think about the configuration under the Administer -> Customize Data and Screens -> Search settings. In there you can set a different default timeout for the smart group cache so that your site isn't constantly recalculating smart groups. You can also set this to a very large number and then use the system job to selectively regenerate the cache as appropriate for each smart group.
  
  BUT, this gets tricky and is often counter-intuitive about the results, you'll find quite a few discussions about optimal settings for this.
  
  The best advice (yes, not your question) is that if you're having issues, e.g. with slowness due to caches being rebuilt, then the first thing to do is to get rid of unused smart groups. A couple of smart groups that include all your contacts (e.g. all individuals) can really take a long time to regenerate for a large number of contacts.
  
  
  ---
  
  ### Answer by username_1 on 2017-08-04. Score: 2
  
  This is not a specific answer to your questions but an option for larger smart groups to improve performance is to use the CiviRules extension to manage group memberships. So when a certain activity happens a contact is added or removed from a standard group.
  
  
  ---
  
  