-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Improve PouchDB query performances with partialIndex
The react-native PouchDB adapter does not handle partialIndexes: it means that any predicate in partialIndex will not be evaluated at indexing time, but at querying time. When dealing with huge database, this can be quite impactful because it will result in full-scan of huge indexes. Therefore, we now force the indexing of any field in partialIndex, to guarantee a doc will be indexed if and only if it has all the necessary attributes. We measured performances for this query: https://github.com/cozy/mespapiers/blob/ e456faaa00dcefef13c6eee88459caffcac4f2d4/src/queries/index.js#L64-L105 **Before:** Query time: 51 499 ms **After:** Query time: 1 854 ms
- Loading branch information
1 parent
5b0b12d
commit c6315e6
Showing
3 changed files
with
58 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters