Derby
  1. Derby
  2. DERBY-4512

Avoid unnecessary lookup in transaction table when adding transaction

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.6.1.0
    • Fix Version/s: 10.6.1.0
    • Component/s: Store
    • Labels:
      None
    • Bug behavior facts:
      Performance

      Description

      TransactionTable.add() first checks if the Hashtable trans contains a transaction with the same id as the one being added. If it does, add() does nothing. If there is no such transaction, a new TransactionTableEntry is created and put into the Hashtable.

      I believe that TransactionTable.add() is never called on a transaction that has already been added to the table. If this is the case, there's no point in checking the Hashtable first. Instead, we could just create a new TransactionTableEntry and add it unconditionally. This would reduce the number of (synchronized) Hashtable calls and could improve the performance in scenarios like the one described in DERBY-3092.

      1. assert.diff
        0.6 kB
        Knut Anders Hatlen
      2. txtab-noblanks.diff
        2 kB
        Knut Anders Hatlen
      3. txtab.diff
        2 kB
        Knut Anders Hatlen

        Issue Links

          Activity

          Knut Anders Hatlen created issue -
          Knut Anders Hatlen made changes -
          Field Original Value New Value
          Attachment assert.diff [ 12430017 ]
          Knut Anders Hatlen made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Knut Anders Hatlen made changes -
          Attachment txtab-noblanks.diff [ 12430387 ]
          Attachment txtab.diff [ 12430388 ]
          Knut Anders Hatlen made changes -
          Issue & fix info [Patch Available]
          Knut Anders Hatlen made changes -
          Status In Progress [ 3 ] Closed [ 6 ]
          Issue & fix info [Patch Available]
          Fix Version/s 10.6.0.0 [ 12313727 ]
          Resolution Fixed [ 1 ]
          Knut Anders Hatlen made changes -
          Link This issue relates to DERBY-3092 [ DERBY-3092 ]
          Knut Anders Hatlen made changes -
          Link This issue is related to DERBY-4517 [ DERBY-4517 ]
          Gavin made changes -
          Workflow jira [ 12488003 ] Default workflow, editable Closed status [ 12799557 ]

            People

            • Assignee:
              Knut Anders Hatlen
              Reporter:
              Knut Anders Hatlen
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development