Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-29241

WiredTigerRecordStore::updateRecord has an unnecessary WT_CURSOR.set_key

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 3.5.11
    • None
    • Storage
    • None
    • Fully Compatible
    • Storage 2017-05-29, Storage 2017-06-19, Storage 2017-07-10, Storage 2017-07-31

    Description

      WiredTigerRecordStore::updateRecord has an unnecessary WT_CURSOR.set_key.

      The key doesn't need to be re-set after the search, and, in fact, setting it here may slow down the subsequent WT_CURSOR.insert operation.

      The (untested) change I'm suggesting:

      *** wiredtiger_record_store.cpp.orig 2017-05-16 17:25:39.768013595 -0400
      --- wiredtiger_record_store.cpp.new   2017-05-16 17:25:45.920785403 -0400
      ***************
      *** 1434,1440 ****
                return {ErrorCodes::IllegalOperation, "Cannot change the size of a doc
      ument in the oplog"};
            }
            
      -     c->set_key(c, _makeKey(id));
            WiredTigerItem value(data, len);
            c->set_value(c, value.Get());
            ret = WT_OP_CHECK(c->insert(c));
      --- 1434,1439 ----
      

      Attachments

        Activity

          People

            keith.bostic@mongodb.com Keith Bostic (Inactive)
            keith.bostic@mongodb.com Keith Bostic (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: