{"action":"created","issue":{"url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/1462","repository_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios","labels_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/1462/labels{/name}","comments_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/1462/comments","events_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/1462/events","html_url":"https://github.com/couchbase/couchbase-lite-ios/issues/1462","id":179309430,"number":1462,"title":"Behavior of indexUpdateMode = .UpdateIndexBefore","user":{"login":"Cyclic","id":553800,"avatar_url":"https://avatars.githubusercontent.com/u/553800?v=3","gravatar_id":"","url":"https://api.github.com/users/Cyclic","html_url":"https://github.com/Cyclic","followers_url":"https://api.github.com/users/Cyclic/followers","following_url":"https://api.github.com/users/Cyclic/following{/other_user}","gists_url":"https://api.github.com/users/Cyclic/gists{/gist_id}","starred_url":"https://api.github.com/users/Cyclic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cyclic/subscriptions","organizations_url":"https://api.github.com/users/Cyclic/orgs","repos_url":"https://api.github.com/users/Cyclic/repos","events_url":"https://api.github.com/users/Cyclic/events{/privacy}","received_events_url":"https://api.github.com/users/Cyclic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-26T18:57:31Z","updated_at":"2016-09-26T19:37:51Z","closed_at":null,"body":"I've set indexUpdateMode to .UpdateIndexBefore to get the count of documents from a view after inserting a new document; however, the view takes minutes to return the new count of documents. The server itself is updated immediately, and I can query for the document. Is there a way to get the count of documents from a view before the index has completed? It doesn't seem correct for the view to take this long to update the index.\r\n\r\nThanks!\r\n--------\r\n* Version:   1.3.1\r\n* Client OS: iOS 10\r\n* Server:    Couchbase 4.1\r\n"},"comment":{"url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/comments/249674378","html_url":"https://github.com/couchbase/couchbase-lite-ios/issues/1462#issuecomment-249674378","issue_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/1462","id":249674378,"user":{"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},"created_at":"2016-09-26T19:37:51Z","updated_at":"2016-09-26T19:37:51Z","body":"> around 500 or so. It’s not blocking the main thread, it’s just that the count isn’t updated for some time.\r\n\r\n500 docs should be done really fast. I have ran some testing to index 1000 docs (alone without any other operations), the index can be done in less than 100 ms. Can you do some profiling and see if the update index is really slow or not? You may also check if the there are any other database intensive operations occur in the app at the same time?\r\n\r\n> Does a liveQuery also require the indexes to be updated (my understanding is yes)?\r\n\r\nYes."}}
{"actor":{"display_login":"pasin"}}