Core Server
  1. Core Server
  2. SERVER-484

Sparse Indexes (WAS: Add an "ignore missing" option to indexes)

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major - P3 Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7.4
    • Component/s: Indexing
    • Labels:
      None
    • Environment:
      All
    • Backport:
      No
    • # Replies:
      10
    • Last comment by Customer:
      false

      Description

      The proposal is for another index option to be added that marks an index as not including any documents with missing index values in the index. For composite indexes this would ignore any documents where all the index values are missing. I would suggest if the index values are present but set to null they probably should be included in the index.

      This would save considerable space and time when inserting into polymorphic collections where an index is only designed to affect a subset of the collection.

      This would provide a large benefit to unique indexes, allowing a unique index to be created where only a percentage of the records in a collection are eligible to participate in the index. Currently it is not apparantly possible to add a unique index to a polymorphic collection where many records do not have the field to be indexed.

        Activity

        Hide
        Scott Hernandez
        added a comment -

        I have added another issue for Partial Indexes: http://jira.mongodb.org/browse/SERVER-785

        I think it would be able to take care of most of what this issue needs. The only challenging part would be to create a partial index that excludes "missing" value, as well as Nulls.

        Show
        Scott Hernandez
        added a comment - I have added another issue for Partial Indexes: http://jira.mongodb.org/browse/SERVER-785 I think it would be able to take care of most of what this issue needs. The only challenging part would be to create a partial index that excludes "missing" value, as well as Nulls.
        Hide
        Remon van Vliet
        added a comment -

        Voted on this. Mongo lends itself very well for user profile data and such but this issue blocks that for lazy registration and the like. Any eta on this?

        Show
        Remon van Vliet
        added a comment - Voted on this. Mongo lends itself very well for user profile data and such but this issue blocks that for lazy registration and the like. Any eta on this?
        Hide
        auto
        added a comment -

        Author:

        {'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}

        Message: basic sparse indexes working SERVER-484
        /mongodb/mongo/commit/e55fa7eb47873abe3236b3e1686d2a337dd6a86a

        Show
        auto
        added a comment - Author: {'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'} Message: basic sparse indexes working SERVER-484 /mongodb/mongo/commit/e55fa7eb47873abe3236b3e1686d2a337dd6a86a
        Hide
        auto
        added a comment -

        Author:

        {'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}

        Message: more tests for sparse indexes SERVER-484
        /mongodb/mongo/commit/e869a8e02c1209536edd3af6856084ddd2101274

        Show
        auto
        added a comment - Author: {'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'} Message: more tests for sparse indexes SERVER-484 /mongodb/mongo/commit/e869a8e02c1209536edd3af6856084ddd2101274
        Hide
        Scott Hernandez
        added a comment -

        Currently this only supports a single field. See http://jira.mongodb.org/browse/SERVER-2193 for compound index support.

        Show
        Scott Hernandez
        added a comment - Currently this only supports a single field. See http://jira.mongodb.org/browse/SERVER-2193 for compound index support.

          People

          • Votes:
            25 Vote for this issue
            Watchers:
            18 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since reply:
              3 years, 19 weeks, 3 days ago
              Date of 1st Reply: