Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-7082

A rotten comment in IndexStatisticsDaemonImpl.java

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • None
    • None
    • None
    • None

    Description

      When I read the code of DataDictionaryImpl.java, I found a comment:

       

       private void setHeapRowEstimate(TransactionController tc, long tableId,
                                          long rowEstimate)
                  throws StandardException {
              // DERBY-4116: If we know the row count, update the store estimated row
              // count for the table.
              ScanController sc = tc.openScan(
          ...
      }

      The comment mentions DERBY-4116. I found that DERBY-4116 modified AlterTableConstantAction.java, and the patch is as follows:

       

       

       

      @@ -779,6 +782,33 @@@@ -779,6 +782,33 @@  
        } // for each leading column (c1) (c1,c2)....   
      } // for each index.
      ++ // DERBY-4116 if there were indexes we scanned, we now know the row count.
      + // Update statistics should update the store estimated row count for the table.
      + // If we didn't scan an index and don't know, numRows will still be -1 and
      + // we skip the estimatedRowCount update.
      + 
      + if (numRows == -1)
      + return;
      + 
      + ScanController heapSC = tc.openScan(td.getHeapConglomerateId(),
      + false// hold
      + 0,      // openMode: for read
      + TransactionController.MODE_RECORD, // locking
      + TransactionController.ISOLATION_READ_UNCOMMITTED, //isolation level
      + null,   // scancolumnlist-- want everything.
      + null,   // startkeyvalue-- start from the beginning.+ 0,
      + null,   // qualifiers, none!
      + null,   // stopkeyvalue,+ 0);
      + 
      + try { 
      + heapSC.setEstimatedRowCount(numRows);
      + } finally { 
      + heapSC.close();
      + }
      + }
      

      The patch modified the updateStatistics method. However, the method is totaly rewritten by follow-up commits, and the method does not contain the above added lines any more.  

       

       

      I am wondering whether IndexStatisticsDaemonImpl.java mentions a rotten issue report (DERBY-4116--), in that all the modifications of this issue do not appear in the latest version.

       

      Would you please check the problem? If it is, the reference of DERBY-4116 shall be removed from the comment of  DataDictionaryImpl.java.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ackelcn ackelcn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: