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

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

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • v1.3.11
    • None
    • manual
    • None

    Description

      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:

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:
              8 years, 48 weeks, 5 days ago