{"action":"created","issue":{"url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/1209","repository_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios","labels_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/1209/labels{/name}","comments_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/1209/comments","events_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/1209/events","html_url":"https://github.com/couchbase/couchbase-lite-ios/issues/1209","id":146664759,"number":1209,"title":"CBLIncrementalStore Batching Support","user":{"login":"shadzik","id":2404568,"avatar_url":"https://avatars.githubusercontent.com/u/2404568?v=3","gravatar_id":"","url":"https://api.github.com/users/shadzik","html_url":"https://github.com/shadzik","followers_url":"https://api.github.com/users/shadzik/followers","following_url":"https://api.github.com/users/shadzik/following{/other_user}","gists_url":"https://api.github.com/users/shadzik/gists{/gist_id}","starred_url":"https://api.github.com/users/shadzik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shadzik/subscriptions","organizations_url":"https://api.github.com/users/shadzik/orgs","repos_url":"https://api.github.com/users/shadzik/repos","events_url":"https://api.github.com/users/shadzik/events{/privacy}","received_events_url":"https://api.github.com/users/shadzik/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/labels/core-data","name":"core-data","color":"006b75"},{"url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/labels/performance","name":"performance","color":"02e10c"}],"state":"open","locked":false,"assignee":{"login":"pasin","id":801454,"avatar_url":"https://avatars.githubusercontent.com/u/801454?v=3","gravatar_id":"","url":"https://api.github.com/users/pasin","html_url":"https://github.com/pasin","followers_url":"https://api.github.com/users/pasin/followers","following_url":"https://api.github.com/users/pasin/following{/other_user}","gists_url":"https://api.github.com/users/pasin/gists{/gist_id}","starred_url":"https://api.github.com/users/pasin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pasin/subscriptions","organizations_url":"https://api.github.com/users/pasin/orgs","repos_url":"https://api.github.com/users/pasin/repos","events_url":"https://api.github.com/users/pasin/events{/privacy}","received_events_url":"https://api.github.com/users/pasin/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2016-04-07T15:46:17Z","updated_at":"2016-04-08T08:12:03Z","closed_at":null,"body":"Dear CBL Team,\r\n\r\ntogether with a colleague of mine @pawelropa, we've tried to understand `CBLIncrementalStore` and it's capabilities of batching fetch requests in order to lower memory footprint in our target app.\r\n\r\nIn order to do so, we've created two sample projects that were supposed to show us the difference between batching in the `NSSQLiteStore` and `CBLIncrementalStore`.\r\n\r\nThe basic concept in both cases, was to seed the database with 10000 contacts on first run and on next runs load the data using an NSFetchResultsController with batching.\r\n\r\nThe two projects were kindly made available by @pawelropa in his repository:\r\n\r\nCore Data using `NSSQLiteStore`:\r\nhttps://github.com/pawelropa/BatchingTest_NSSQLLiteIncrementalStore\r\n\r\nCore Data using `CBLIncrementalStore`:\r\nhttps://github.com/pawelropa/BatchingTest_CBLIncrementalStore\r\n\r\nBy using XCode Profiling Tools, we've been able to see multiple fetch request in case of `NSSQLiteStore` (low memory footprint), as opposed to just one (all the data) in case of `CBLIncrementalStore` (much higher memory footprint).\r\n\r\nThe result indicates that the CBLIncrementalStore does not support batching using `NSFetchResultsControlle`r and the `fetchBatchSize` property of `NSFetchRequest`. Will that be supported in the future and is this possible to achieve now?\r\n\r\nAnalysing CBLInrementalStore we've spotted the usage of `CBLQuery` `limit` and `skip` functionality, which would indicate some kind of batching support, but we haven't been able to trigger it properly.\r\n\r\nWe would greatly appreciate your feedback.\r\n\r\n--------\r\n* Version:   1.2.0\r\n* Client OS: iOS 9.3\r\n* Server:  no server, locally\r\n"},"comment":{"url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/comments/207298959","html_url":"https://github.com/couchbase/couchbase-lite-ios/issues/1209#issuecomment-207298959","issue_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/1209","id":207298959,"user":{"login":"pawelropa","id":634593,"avatar_url":"https://avatars.githubusercontent.com/u/634593?v=3","gravatar_id":"","url":"https://api.github.com/users/pawelropa","html_url":"https://github.com/pawelropa","followers_url":"https://api.github.com/users/pawelropa/followers","following_url":"https://api.github.com/users/pawelropa/following{/other_user}","gists_url":"https://api.github.com/users/pawelropa/gists{/gist_id}","starred_url":"https://api.github.com/users/pawelropa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pawelropa/subscriptions","organizations_url":"https://api.github.com/users/pawelropa/orgs","repos_url":"https://api.github.com/users/pawelropa/repos","events_url":"https://api.github.com/users/pawelropa/events{/privacy}","received_events_url":"https://api.github.com/users/pawelropa/received_events","type":"User","site_admin":false},"created_at":"2016-04-08T08:12:02Z","updated_at":"2016-04-08T08:12:02Z","body":"@pasin With `fetchOffset` and `fetchLimit` we would need to implement functionality which `NSFetchResultsController` and `NSFetchRequest` provide, ourselves. But I am not sure if in the long run it would be a viable solution as many apps relay on `NSFetchResultsController` a lot. Anyway, now we will consider using `fetchOffset` and `fetchLimit` for now."}}