Answers.Body: <p>What is the number of participants you have?</p>
  
  <p>depending of the entity, getCount is just a wrapper around get, so it might be the issue if you have lots of participants.</p>
  
  <p>I haven't looked for participants, but writing (and contributing that back to civicrm core) a custom getCount api with a simplier query that only does select count() would probably makes it way faster</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-06T11:05:36.440Z
Answers.LastActivityDate: 2015-07-06T11:05:36.440Z
Answers.UserDisplayName: Xavier
Body: <p>I want to show how many spots we have left in an event, but it takes like 20 seconds to get the number of participants using the getCount action. What else can I do to get that number?</p>
  
Tags: <civievent>
Title: Participant getCount is too slow
ThreadText: # Participant getCount is too slow
  
  (Asked by: username_0 on 2015-07-03)
  
  I want to show how many spots we have left in an event, but it takes like 20 seconds to get the number of participants using the getCount action. What else can I do to get that number?
  
  **Tags:** civievent
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-07-06. Score: 2
  
  What is the number of participants you have?
  
  depending of the entity, getCount is just a wrapper around get, so it might be the issue if you have lots of participants.
  
  I haven't looked for participants, but writing (and contributing that back to civicrm core) a custom getCount api with a simplier query that only does select count() would probably makes it way faster
  
  
  ---
  
  