I have a list which is use to store the users response from a polling app. The list saves response in the following format:
QuestionId | optionChosen
I want to show the users count against each option i.e how many users had chosen option A or B etc. For example, if a poll has 5 options namely A, B, C, D, E.
Currently, I am creating 5 Caml query and firing on the response list to get the count for each.
The other way to do is to get all the items for particular a QuestionId and then iterating the collection for each option to get its count.
Now my question is which one is better in terms of performance, assuming there are 5 options and 100 responses:
- CamlQuery:
- Loop:
P.S: List structure can not be change and list is in SharePoint online (does it matters)