Slow in retrieving records

Sometimes when we try to fetch the data using query ‘[backendless.persistenceService find:[TblCategory class] dataQuery:dataQuery responder:resCategory];’. Responder takes time to reponse. Is there something I am missing before calling this query?

Can you give me your project for investigating?
Or send the query code and your appId & secretKey -> slavav@themidnightcoders.com

Hi Aman,

I implemented the project with your query (I’ve fixed it!) in non-stop mode .

 
 
 
 
 
 
 
 
 
 
 
-(id)categoryHandler:(id)response { 
 
 printf("Query time: %g\n", 1000*[[NSDate date] timeIntervalSinceDate:startTime]); 
 
 [self nonStopQuery]; 
 
 return response; 
 
} 
 
 
 
 
-(void)errorHandler:(Fault *)fault { 
 
 NSLog(@"tServer reported an error: %@", fault); 
 
} 
 
 
 
 
-(void)tblCategoryQuery { 
 
 
 
 startTime = [NSDate date]; 
 
 
 
 
 BackendlessDataQuery *dataQuery = [BackendlessDataQuery new]; 
 
 QueryOptions *queryOptions = [QueryOptions new]; 
 
 queryOptions.related = [NSMutableArray arrayWithArray:@[@"subcategory",@"subcategory.retailer",@"subcategory.retailer.beacons",@"subcategory.retailer.location"]]; 
 
 dataQuery.queryOptions = queryOptions; 
 
 Responder *resCategory = [Responder responder:self selResponseHandler:@selector(categoryHandler:) selErrorHandler:@selector(errorHandler:)]; 
 
 [backendless.persistenceService find:[TblCategory class] dataQuery:dataQuery responder:resCategory]; 
 
} 
 
 
 
 
-(void)nonStopQuery { 
 
 
 
 dispatch_time_t interval = dispatch_time(DISPATCH_TIME_NOW, 1ull*NSEC_PER_MSEC*500); 
 
 dispatch_after(interval, dispatch_get_main_queue(), ^{ 
 
 [self tblCategoryQuery]; 
 
 }); 
 
}


These are my results:

http://support.backendless.com/public/attachments/5ef8f8f331de3d8cef530d3573c5f605.png</img>

I don’t see any problem.
Can you try this app - how will be your results ?

Regards,
Slava

Aman,

What is the status of this? Have you tried Slava’s code?

Mark

Hi Slava,

I have sent you the sample code at slavav@themidnightcoders.com.

Thanks,
Aman

Aman,

Please see my response to your email.

Mark

Hi Mark and Slava,

This issue has been resolved by using asynchronous call of method registerDeviceToken . I appreciate your help in this. Thanks!