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

Comment on: "manual/reference/operator/aggregation/limit.txt"

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None

    Description

      We seem to have encountered a performance problem with $limit in aggregate queries.

      The query is very very slow (half a minute) - when the number of docs passed into the limit step are less than the limit size.

      For example, first stage is a $match that only finds 6 docs. Second stage is a sort on an indexed field. Third is a $limit=10.

      The query is instantaneous when there are lots of docs returned from stage 1. However, when there are only a few, the aggregate query is very very slow.

      Expected behavior: aggregate performance of $limit should be equivalent to a standard query's use of limit.

      Attachments

        Activity

          People

            Unassigned Unassigned
            dan@prattle.co Dan Salmo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              7 years, 20 weeks, 2 days ago