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

Stop storing NUL terminators in Document and Value

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Labels:
      None
    • Query Execution
    • Fully Compatible

      We currently store NUL bytes at the end of the keys in a Document and anything that uses string-like storage in Value, even though in both cases we also store explicit lengths both for efficency and in the case of Value to correctly handle embedded NUL bytes in the middle of the string. This dates to a brief period when StringData required that str[size] was valid and pointed to a NUL byte. Since this is no longer the case, we should stop storing them. This will allow storing longer strings (up to 14 bytes from 13) inline in Value, and should reduce the size of Documents by reducing the probability that we need to skip bytes so the next Value will be properly aligned.

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            mathias@mongodb.com Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: