If I don’t change the WHERE clause on a query, why would the count return a number larger than the rows of data? At least I think that is what is happening.
Your where clause condition contains relation.
In this case Backendless will make the join request which will return the number of occurrences from the resulting Cartesian set instead of the number of entries.
Hi @olhadanylova - Thanks for the explanation. I don’t follow that 100%, but that is OK. How do I go about fixing the issue? I have more than 100 records I need to loop through, and getting the count is how it is done in this example -
The key element in the algorithm is to loop through the entire data set using pageSize and offset and check if the size of the response is less than the page size.
This algorithm will perform much better as it does not have any dependency on the API call obtaining the size of the collectoin (i.e. count).
I need some guidance. Using your algorithm on a semi-large table, say 9000 rows (completely reasonable for a city table), would result in 90 rapid API calls.
So am I stuck between a rock and a hard place here? I either use count, which isn’t great for performance (per your comment) but is a single API call, or make 90 calls in a few seconds.
I am looking for suggestions on performance best practices as those will become very important shortly.