Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major - P3 Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5.5
    • Component/s: Querying
    • Labels:
      None
    • Backport:
      No
    • # Replies:
      11
    • Last comment by Customer:
      true

      Description

      Right now with an $all query we just look up the first field in the index. We could instead try out all/some number of fields using the query optimizer.

        Issue Links

          Activity

          Hide
          DisU
          added a comment - - edited

          Why isn't this bug part of the Mongo documentation? It's been known for over a year and a half, and since it's not documented I just assumed that doing $all queries on indexed fields would be fast because the most trivial way of implementing it is by doing index intersection.

          It would be better to mark $all as not implemented, because that's its current status. It's completely useless, as there are absolutely no guarantees it would ever finish (I mean ever in the web sense of user requests timing out).

          Show
          DisU
          added a comment - - edited Why isn't this bug part of the Mongo documentation? It's been known for over a year and a half, and since it's not documented I just assumed that doing $all queries on indexed fields would be fast because the most trivial way of implementing it is by doing index intersection. It would be better to mark $all as not implemented, because that's its current status. It's completely useless, as there are absolutely no guarantees it would ever finish (I mean ever in the web sense of user requests timing out).
          Hide
          auto
          added a comment -

          Author:

          {u'date': u'2012-10-26T03:27:48-07:00', u'name': u'giveturtle', u'email': u'yanir@giveable.co'}

          Message: Added comment about $all's inefficiency

          See issue https://jira.mongodb.org/browse/SERVER-1000
          Branch: master
          https://github.com/mongodb/docs/commit/14fe6b73933026825d36b6699f987150b6b33214

          Show
          auto
          added a comment - Author: {u'date': u'2012-10-26T03:27:48-07:00', u'name': u'giveturtle', u'email': u'yanir@giveable.co'} Message: Added comment about $all's inefficiency See issue https://jira.mongodb.org/browse/SERVER-1000 Branch: master https://github.com/mongodb/docs/commit/14fe6b73933026825d36b6699f987150b6b33214
          Hide
          auto
          added a comment -

          Author:

          {u'date': u'2012-10-29T13:33:08-07:00', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

          Message: merge: SERVER-1000
          Branch: master
          https://github.com/mongodb/docs/commit/d5aa64d9ab19f10097255a3df7b4c07175641bb3

          Show
          auto
          added a comment - Author: {u'date': u'2012-10-29T13:33:08-07:00', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'} Message: merge: SERVER-1000 Branch: master https://github.com/mongodb/docs/commit/d5aa64d9ab19f10097255a3df7b4c07175641bb3
          Hide
          Antoine Girbal
          added a comment -

          Was just thinking about this: since we now have much faster count() operation on a clean range, why not use it to improve $all?
          Mongo can first iterate over elements of $all and if it can make use of fast count then it should check which one returns fewer elements.
          Most of the time matches in a $all are equalities on fields covered by index, so the optimization will be available.

          Show
          Antoine Girbal
          added a comment - Was just thinking about this: since we now have much faster count() operation on a clean range, why not use it to improve $all? Mongo can first iterate over elements of $all and if it can make use of fast count then it should check which one returns fewer elements. Most of the time matches in a $all are equalities on fields covered by index, so the optimization will be available.
          Hide
          Hari Khalsa
          added a comment -

          We handle this via index intersection.

          Show
          Hari Khalsa
          added a comment - We handle this via index intersection.

            People

            • Votes:
              44 Vote for this issue
              Watchers:
              38 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                17 weeks, 2 days ago
                Date of 1st Reply: