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

ArraySet with collation doesn't leverage already computed collation keys

    • Query Execution

      When we add CollatorInterface* to ArraySet, two things happen:
      1. To calculate hash of string, we will generate a collation key and hash it instead of a raw string. There is no obvious way around it, as it is the best way to get collation-aware hash of a string.

      2. When comparing strings, we will compare them according to the given CollatorInterface.

      Generating collation key is expensive operation AND comparing strings with collation is more expensive than just byte-wise compare.

      It leads to linear lookup being faster for up to 50 elements in hash set.

      We can try to speed it up by using generated collation keys for byte-wise compare instead of doing string compare with collation.

            Assignee:
            backlog-query-execution Backlog - Query Execution
            Reporter:
            ivan.fefer@mongodb.com Ivan Fefer
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: