Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-4015

Document performance impacts of $min without $max (and vice-versa)

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • v1.3.11
    • Affects Version/s: None
    • Component/s: manual
    • Labels:
      None

      When the $min query specifier is used without a corresponding $max, the upper index bound is the end of the index. This means that a query which uses $min but not $max may potentially scan from the lower bound all the way to the end of the index. This may be a considerable performance impact, compared to an equivalent query which lacks $min. This behaviour, and the corresponding recommendation to always use $min and $max together, should be noted on the following pages:

      Similarly when $max is used without $min - the lower bound is the start of the index, and the query may scan from the start of the index up to the upper bound. This again may be much less performant than an equivalent query without $max. This behaviour, and the corresponding recommendation to always use $min and $max together, should be noted on the following pages:

            Assignee:
            andrew.aldridge@mongodb.com Andrew Aldridge
            Reporter:
            kevin.pulo@mongodb.com Kevin Pulo
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              9 years, 7 weeks, 5 days ago