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

Refactor QuerySettings.indexHints idl definition to always be std::vector<IndexHintSpec>

    XMLWordPrintableJSON

Details

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

    Description

      Currently, QuerySettings are defined as:

        QuerySettings:
          description: >-
            Struct representing possible settings that may be applied to a given query.
          fields:
            indexHints:
              type:
                variant: [IndexHintSpec, array<IndexHintSpec>]
              optional: true
            queryEngineVersion:
              type: QueryEngineVersion
              optional: true

      While specifying a variant provides additional flexibility to the user (they can either provide an array of index hint specs or a single object), this creates rather ugly code on the server side.

      As part of this patch, we would refactor this (introduce custom serializer/deserializer methods), such that user can still specify IndexHintSpec or an array of specs, while we in code always have a vector of IndexHintSpecs.

      The goal would be to define the serializer, deserializer methods as well as adding tests to ensure their correctness and adjust the breaking code, as now vector<IndexHintSpec> will be used.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated: