Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-77468 Implement $querySettings agg stage
  3. SERVER-77790

Add support for showDebugQueryShape parameter in $querySettings

    • Type: Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • QE 2023-06-12, QE 2023-06-26, QE 2023-07-10, QE 2023-07-24, QE 2023-08-07, QE 2023-08-21, QE 2023-09-04, QE 2023-09-18, QE 2023-10-02, QE 2023-10-16, QE 2023-10-30, QE 2023-11-13, QE 2023-11-27
    • 0

      As part of this ticket we need to implement a new $_internalDebugQueryShape aggregation expression and integrate it into $querySettings agg stage.

      This expression will take the incoming BSONObj of the command and will call the corresponding function query_shape::extractQueryShape(). Similar method call is performed in setQuerySettings and removeQuerySettings commands in order to extract QueryShape from the given BSONObj command.

      For inspiration on how to implement an aggregation expression, one could look at SERVER-68686

       

      Instead of introducing a new agg expression, we could compute the QueryShape directly in DocumentSourceQuerySettings::createFromBson() where we populate the queue with the Documents, where we add additional attribute to each of the documents.

      This approach should be much simpler, involves less code changes and is more performant.

       

      However, neither of the approaches are easy due to the cyclic dependency between QueryShape module and Aggregate command. Curious if SERVER-79736 solves this problem

            Assignee:
            catalin.sumanaru@mongodb.com Catalin Sumanaru
            Reporter:
            denis.grebennicov@mongodb.com Denis Grebennicov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: