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

Make call to `getKeys` in `IndexAccessMethod::findSingle` faster

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.4.0-rc2
    • Component/s: Querying
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Query 2016-10-31
    • Linked BF Score:
      0

      Description

      The call to `getKeys` in `IndexAccessMethod::findSingle` is very costly, causing a 2-5% reduction in the humber of ops per second for simple update queries.

      To test this, I ran microbenchmarks comparing a recent master commit (b4d550) to the same code but without the call to `getKeys`, yielding the following results:

      Storage Engine # threads increase in ops/second
      mmapv1 1 2.07%
      mmapv1 2 3.68%
      mmapv1 4 5,10%
      mmapv1 8 5,70%
      wiredTiger 1 2.38%
      wiredTiger 2 2.82%
      wiredTiger 4 2.30%
      wiredTiger 8 3.07%

      Simply removing the call will not suffice, as it is needed for when there are non-default collations on the _id field. Geert Bosch suggested that implementing a cheap way to check if there is a non-default collation on the _id (possible by either adding a boolean field somewhere that keeps track fo this or by iterating over the indexes to check) would make it possible to avoid the call in the cases where it isn't necessary.

        Attachments

          Activity

            People

            Assignee:
            marko.vojvodic Marko Vojvodic
            Reporter:
            sam.rossi Samuel Rossi (Inactive)
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: