Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Prevent fallback to existing jobs index
The in-progress jobs query for the export feature relies on the presence of a very specific index to be fast on cozies with a lot of `io.cozy.jobs` documents. To make sure the index presence detection goes well, we forced a sort on the `worker` attribute. However, since `cozy-stack` uses an index on `worker` and `state` only, CouchDB fallbacks to this index instead of detecting the index we want does not exist and runs the slow `$or` query in-memory. See apache/couchdb#4511 for more details on this issue. To prevent this fallback we will sort on a second attribute not present in the existing `cozy-stack` index: `message.slug`.
- Loading branch information