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

Version match expressions

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • Query Optimization

      Match expressions are now stored persistently in the catalog as part of the document validation and partial index features. Particularly in the case of partial indexes, this can make it difficult to safely change the semantics of the match language (which we will inevitably want to do from time to time).

      As an example, suppose we have some match expression M which matches document x. A user creates a partial index whose partialFilterExpression contains M, resulting in a single index key for document x. In a future version, we change the semantics of M so that it matches both x and y. On upgrade, the index becomes broken in that it contains no index key for y. Queries using the index will incorrectly miss y because of this the absence of this key.

      In order to avoid such situations, we should introduce a notion of versioning in the match language. Persisting this version on disk would allow us to know which set of matching semantics to apply to collections or indexes created on older versions. We could allow users to specify the version they wish to use while querying, which would allow us to avoid breaking legacy applications. Breaking changes would be more friendly if we can document old match expression versions as deprecated and then remove support after some grace period. Right now, such changes require all applications to adjust immediately as part of upgrade.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: