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

Avoid linear lookup for allowed indexes in applyQuerySettings()

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • Query Execution

    Description

      As part of SERVER-79181 QuerySettings are now applied to the query, before planning is performed.

      applyQuerySettings() looks at the index hints for the given collection and then removes all of the indexes, which are not present in the settings.indexHints.allowedIndexes list.

      Currently, this is done as a for loop over all of the indexes and an additional for loop over all of the hints, however, this could be speed up by doing a hash set lookup into set of all allowed index names and set of allowed index patterns. This approach has already been employed by index filters mechanism (https://github.com/mongodb/mongo/blob/965ec692dedf1f1bebad2c28ba54d9f21a9d25ea/src/mongo/db/query/get_executor.cpp#L207)

      This way we would speed up the QuerySettings application on the hot path

      Attachments

        Activity

          People

            backlog-query-execution Backlog - Query Execution
            denis.grebennicov@mongodb.com Denis Grebennicov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: