{"action":"closed","issue":{"url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-iOS-OSX/issues/28","labels_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-iOS-OSX/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-iOS-OSX/issues/28/comments","events_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-iOS-OSX/issues/28/events","html_url":"https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/issues/28","id":101453355,"number":28,"title":"Slow query from localdatastore","user":{"login":"FreudGit","id":1793380,"avatar_url":"https://avatars.githubusercontent.com/u/1793380?v=3","gravatar_id":"","url":"https://api.github.com/users/FreudGit","html_url":"https://github.com/FreudGit","followers_url":"https://api.github.com/users/FreudGit/followers","following_url":"https://api.github.com/users/FreudGit/following{/other_user}","gists_url":"https://api.github.com/users/FreudGit/gists{/gist_id}","starred_url":"https://api.github.com/users/FreudGit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FreudGit/subscriptions","organizations_url":"https://api.github.com/users/FreudGit/orgs","repos_url":"https://api.github.com/users/FreudGit/repos","events_url":"https://api.github.com/users/FreudGit/events{/privacy}","received_events_url":"https://api.github.com/users/FreudGit/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-iOS-OSX/labels/discussion","name":"discussion","color":"eeeeee"}],"state":"closed","locked":false,"assignee":{"login":"richardjrossiii","id":699752,"avatar_url":"https://avatars.githubusercontent.com/u/699752?v=3","gravatar_id":"","url":"https://api.github.com/users/richardjrossiii","html_url":"https://github.com/richardjrossiii","followers_url":"https://api.github.com/users/richardjrossiii/followers","following_url":"https://api.github.com/users/richardjrossiii/following{/other_user}","gists_url":"https://api.github.com/users/richardjrossiii/gists{/gist_id}","starred_url":"https://api.github.com/users/richardjrossiii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardjrossiii/subscriptions","organizations_url":"https://api.github.com/users/richardjrossiii/orgs","repos_url":"https://api.github.com/users/richardjrossiii/repos","events_url":"https://api.github.com/users/richardjrossiii/events{/privacy}","received_events_url":"https://api.github.com/users/richardjrossiii/received_events","type":"User","site_admin":false},"milestone":null,"comments":10,"created_at":"2015-08-17T15:53:33Z","updated_at":"2015-08-17T18:34:22Z","closed_at":"2015-08-17T18:34:22Z","body":"Using iPhone 5(on sim it was instant), query fromlocaldatastore take a bit more than 2 seconds to get approx 600 results. (very more that sqlite request)\r\n\r\nThe funny thing are that querying and get results from online a near faster!!  :)\r\n\r\nTo reproduce:  \r\n- Get online data and pin it (queryDataFromParse)\r\nClose the app(or not)\r\n- get all data from LocalDatastore (queryShareFromParse_UsingLocalDataStore)\r\n\r\n-(void) queryShareFromParse_UsingLocalDataStore {\r\n    NSLog(@\"--[%s:%d]\",__PRETTY_FUNCTION__,__LINE__);\r\n    PFQuery *query = [PFQuery queryWithClassName:@\"A_Sharing\"];\r\n    query.limit = 1000;\r\n    [query fromLocalDatastore];\r\n    NSError *error;\r\n    NSArray *aContents=[query findObjects:&error];\r\n    if (!error) {\r\n        NSLog(@\"--[%s:%@]\",__PRETTY_FUNCTION__,@\"->Results received\");\r\n    }\r\n}\r\n\r\n\r\n\r\n-(void) queryDataFromParse {\r\n    NSLog(@\"--[%s:%d]\",__PRETTY_FUNCTION__,__LINE__);\r\n    PFQuery *query = [PFQuery queryWithClassName:@\"A_Sharing\"];\r\n    [query orderByDescending:@\"updatedAt\"];\r\n    query.limit = 10000;\r\n    [query findObjectsInBackgroundWithBlock:^(NSArray *aContents, NSError *error) {\r\n        //if (error) return;\r\n        if (aContents.count>0) {\r\n            [PFObject pinAll:aContents];\r\n            PFObject *pfObject=aContents[0];\r\n        }\r\n    }];\r\n}\r\n\r\nI can provide sample and ApplicationId to your private email."}}