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

Add no-op delimiter stage to aggregation to prevent pipeline optimizations

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: Aggregation Framework
    • Labels:
      None

      Description

      MongoDB will perform a variety of sequencing and coalescing optimizations to an aggregation pipeline.  These are very helpful and the list of available modifications continues to grow over time.

      However in some situations these modifications have a negative impact on performance.  In such cases, it would be beneficial to have additional control over how the pipeline is split.

      As an arbitrary example, consider that there is a workaround in SERVER-7568 that involves injecting a $project between a $match and $sort to modify the indices eligible for use by the operation.  Notably SERVER-26442 is a request to introduce an additional optimization that would "break" this workaround.  For that reason, workaround such as that are not something that we would guarantee to behave the same across versions.  

      Introducing a dedicated stage such as  {$hint: {delimitPipeline: true}} would provide additional control if needed in specific situations.  

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-query-optimization Backlog - Query Optimization
              Reporter:
              christopher.harris Christopher Harris
              Participants:
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated: