couchbase-lite-core
couchbase-lite-core copied to clipboard
CBL-6282: Replicator starts up slow for big database
Cherry-pick 711f886:
Optimize unsorted enumeration of BothKeyStore (#1858)
Use a different algorithm to enumerate a BothKeyStore when the sortOption is kUnsorted: just enumerate the live docs first, then the deleted ones. This removes the need to order the underlying enumerations, which in turn allows SQLite to use indexes when onlyConflicts is set.
This should fix CBL-4506
Code Coverage Results:
| Type | Percentage |
|---|---|
| branches | 68.45 |
| functions | 80.11 |
| instantiations | 33.97 |
| lines | 79.02 |
| regions | 76.23 |