Avoid calls to BSONObj::stripFieldNames in SortedDataIndexAccessMethod::findSingle

XMLWordPrintableJSON

    • Storage Execution NAMER
    • Fully Compatible
    • Execution Team 2023-10-30
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In SortedDataIndexAccessMethod::findSingle, there is a call to BSONObj::stripFieldNames which walks the BSONObj and allocates a new one. For simple IDHack queries where _id is a scalar, this is unnecessary since field names are not stored in the keystring.

      I do not know if this function can be omitted in all cases though as I am not very familiar with key string.

      POC: https://github.com/10gen/mongo/commit/b2fe0cbb1697e55daa60991389e951bcc9eb8aed

              Assignee:
              Gregory Noma
              Reporter:
              Mark Benvenuto
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: