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

Allow $exists to efficiently use indexes

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Duplicate
    • None
    • None
    • None
    • None

    Description

      Currently our indexes use null for both literal null and document doesn't contain such a value. The document has to be fetched to make a distinction between these two things. This means that what should be a simple use of an index turns into scanning many documents. Not needing to fetch documents (for instance, having a

      {no such field}

      bson type) to determine this would allow for indexes to be used efficiently in both $exists : true queries and other queries when using compound indexes without have to create both sparse and non-spare indexes to service different types of queries.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              charlie.page@10gen.com Charlie Page
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: