Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-24637

Fix Nuxeo Drive Audit query

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 8.10, 9.10
    • Fix Version/s: 9.10-HF06, 10.2
    • Component/s: Nuxeo Drive
    • Release Notes Description:
      Hide

      Great Optimisation

      The query returning documents that have changed since last query has been greatly optimised, releasing resources on the Elasticsearch server.

      Show
      Great Optimisation The query returning documents that have changed since last query has been greatly optimised, releasing resources on the Elasticsearch server.
    • Sprint:
      nxAI Sprint 10.2.1, nxAI Sprint 10.2.2

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 5 hours
                  5h