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

Allow $exists to efficiently use indexes

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      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

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: