-
Type: Improvement
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 8.10, 9.10
-
Component/s: Nuxeo Drive
-
Release Notes Description:
-
Epic Link:
-
Sprint:nxAI Sprint 10.2.1, nxAI Sprint 10.2.2
Nuxeo Drive gets the most recent audit Id using an inefficient query on Elasticsearch. I can see in the slow.log that these queries are taking about 2.5 seconds on a index with 948148 docs.
A matchAll() query is being used with sorting, instead we should put a filter on it.
For example, for this query it returns in 71ms on the same data.
{ "query": { "bool": { "filter": [ { "range": { "logDate": { "gte": "2018-03-7T00:00:00.000Z"}}} ] } } , "sort": { "_id": { "order": "desc" } } , "size":1 }
If we can specify a day filter this will be cached for all users.