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

Speed up creation of (don't populate) index on unused field for sparse index

    • Type: Icon: New Feature New Feature
    • Resolution: Won't Fix
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Index Maintenance
    • None
    • Query

      This would help when schemas change and a user needs to start using another field within a collection. The user would create an index on the new field, and instead of uselessly having to scan through every document, index creation would happen immediately.

      If collections kept track of which fields were in use, index creation for an unused could just be empty instead of having to check every document.

      Even if collections don't keep track of exact fields, they can use a bloom filter to approximately keep track.

      Finally, there should be an option to ensureIndex() that instantaneously creates an empty index instead of scanning through every document when the user is confident the collection does not contain documents that contain the field. The option can be

      {empty:true}

      or

      {populate:false}

      .

            Assignee:
            backlog-server-query Backlog - Query Team (Inactive)
            Reporter:
            dlee David Lee
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: