couchbase-lite-core icon indicating copy to clipboard operation
couchbase-lite-core copied to clipboard

faster start of replicator

Open KraemerDEM opened this issue 3 years ago • 1 comments

When starting a replicator there are 3 queries done on the local database which are not using the correct index. This leads to a very long time until the first reaction from the replicator occurs. I had a 3GB sqlite database file on an IPad which took several minutes(!) to complete these queries. This PR ensures the appropriate indexes are used and the queries are completed almost instantly.

KraemerDEM avatar Mar 22 '22 11:03 KraemerDEM

What is the plan for this? Should we accept just the undisputed half?

borrrden avatar May 25 '22 01:05 borrrden

@KraemerDEM , as Jens pointed it out, it should not need to use "ORDER BY key." How did you get it to use ORDER BY?

jianminzhao avatar May 09 '23 01:05 jianminzhao

@KraemerDEM, as @jens pointed out, the query should not use "ORDER BY key". How did you get it to use "ORDER BY" ?

jianminzhao avatar May 09 '23 02:05 jianminzhao

Well, as @snej also pointed out, it's because in BothKeyStore::newEnumeratorImpl the sort order is changed as options.includeDeleted is set?

KraemerDEM avatar May 11 '23 05:05 KraemerDEM

. @KraemerDEM BothKeyStore starts in release/3.1 branch. I assume you were using release/lithium. Which version of CBL are you using?

jianminzhao avatar May 11 '23 22:05 jianminzhao

@jianminzhao I was using the git master branch at that time.

KraemerDEM avatar May 19 '23 05:05 KraemerDEM

The underlying cause of this issue is resolved in commit #711f886899b23b

jianminzhao avatar Aug 30 '23 16:08 jianminzhao