Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-27990

SAP Lucene Sorting Optimization - readCounter for Full Table Scans

    XMLWordPrintable

Details

    • We collect Jira feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

    Description

      NOTE: This suggestion is for JIRA Server. Using JIRA Cloud? 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:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: