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

Scan protection handle could be cached in BasePage

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 10.4.1.3
    • 10.4.1.3
    • Store
    • None
    • Performance

    Description

      Each time a leaf node in a B-tree is visited in an index scan, a scan protection row is locked and unlocked. Both the lock operation and the unlock operation will allocate a new RecordId object representing the scan protection row (the unlock operation additionally allocates a PageKey object for the RecordId). Since the scan protection handle created will be identical (seen from equals()) each time it is created for a page, it would make sense to cache it in BasePage. Then we only need to allocate the protection handle for a page once for as long as it stays in the page cache. This would save three object allocations per single-record lookup via index.

      Attachments

        1. derby-2878-3a.diff
          12 kB
          Knut Anders Hatlen
        2. derby-2878-3.stat
          0.6 kB
          Knut Anders Hatlen
        3. derby-2878-3.diff
          14 kB
          Knut Anders Hatlen
        4. derby-2878-2.diff
          4 kB
          Knut Anders Hatlen
        5. derby-2878-1b.diff
          4 kB
          Knut Anders Hatlen
        6. derby-2878-1.stat
          0.2 kB
          Knut Anders Hatlen
        7. derby-2878-1.diff
          4 kB
          Knut Anders Hatlen

        Activity

          People

            knutanders Knut Anders Hatlen
            knutanders Knut Anders Hatlen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: