-
Type: New Feature
-
Resolution: Won't Fix
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Index Maintenance
-
None
-
Query
-
(copied to CRM)
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}.
- is duplicated by
-
SERVER-14772 Create a way to add an empty sparse index, skipping iteration of the collection
- Closed