Slow query with related geopoints


I’m working on an app that has to show objects on a map. The objects could be filtered by the user and the total amount of rows in the table is about 6000. Cause of the limit of 100 rows per page I wrote a for loop for retrieving all the data requested by the user.
The table has 9 columns 2 of which are relations one to one, one with a geopoint and the other with another table. If a make a simple query (for example “power>100”) I get these results:

  1. With autoload only on geopoint and using single step retrieve for the other relation: ~5.5s per page
  2. Using single step retrieve on both geopoint and the other relation: ~4s per page
  3. Using single step retrieve only on geopoint: ~3s per page
  4. Using single step retrieve only on the other relation: ~1s per page
  5. Without retrieving relations: ~0.5s per page

Each page is about 50 kb including relations.
I need to retrieve the geopoints because I have to show the objects on a map but the query is too slow.
I’m thinking about moving the geopoints to the table as two column (latitude and longitude) to solve this problem, but I would like to know whether it is supposed to be so or there is a problem and how to solve it. I’m using backendless cloud service.

Thanks in advance

Generally speaking, the more data you load, the slower it will be. If you add relations on top of it, they will also increase the response time. I would recommend creating an API service that includes all the logic for retrieving and combining the data using our API. Your client app would be using the service instead loading the data directly.

Thank you for the response, I’m new on backendless so it will take some time to try the API service.

I need to let the user make custom query on the table, then show the results of the query on a map. With the API service is there a limit on the response size? I mean is there the same limit of 100 rows for response that I got using the iOS SDK? Because if there is the same limit I don’t understand why it should be quicker.

No, there is no limit on the response size with the API service. It will be quicker because the API service runs on the server. Therefore multiple requests (to get 100 objects at a time) from service to the core Backendless will be faster.