Uploaded image for project: 'Jira Cloud'
  1. Jira Cloud
  2. JRACLOUD-27990

SAP Lucene Sorting Optimization - readCounter for Full Table Scans

    XMLWordPrintable

Details

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      NOTE: This suggestion is for JIRA Cloud. Using JIRA Server? See the corresponding suggestion.

      Regression & Mitigation: Measurements have shown that the query response time has drastically improved for most queries. However for those queries that have no filter restrictions („Full Table Scan Scenario“) the performance has decreased. Probably the current JIRA implementation is optimized for such a „Full Table Scan Scenario“. Good performance results have been achieved by a mixed approach.

      Mixed Approach: For this mixed approach a read counter is introduced that counts the number of document read accesses. Additional an array pointer that can be assigned the field values of all Lucene index documents is used.

      private long readCounter;
      private Object[] allValues; 
      InternalFieldComparator2(int numHits, String fieldP, final LuceneFieldSorter sorter)
      {
        readCounter = 0;
        allValues = null;
      }
      /*
      For each read access to a Lucene document the counter is increased. If the counter is higher than 4000,  a full table scan is assumed, and the old approach of retrieving all Lucene index documents is used. The old approach is faster if all documents have to be read anyway. 
      */
      public Object getValueFromDoc(int doc)
      {
        readCounter ++;
        if (readCounter > 4000) 
        {      
          if (allValues == null) {
           try 
           {
             allValues = getLuceneValues(field, reader);
           } 
           catch (IOException e) 
           {
              allValues = new Object[reader.maxDoc()];
          }
      }
       else ...       
      
      

      Attachments

        Issue Links

          Activity

            People

              tcampbell Trevor Campbell (Inactive)
              rbal Rick
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: