[SERVER-47657] Add 'unique' and 'sparse' parameters to index signature Created: 20/Apr/20  Updated: 29/Oct/23  Resolved: 03/Mar/21

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Improvement Priority: Major - P3
Reporter: Bernard Gorman Assignee: Yoon Soo Kim
Resolution: Fixed Votes: 0
Labels: qexec-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Documented
is documented by DOCS-14277 Investigate changes in SERVER-47657: ... Closed
Related
related to SERVER-62636 setFeatureCompatibilityVersion 4.4 su... Closed
related to SERVER-47766 Remove FCV guard on partialFilterExpr... Closed
related to SERVER-47659 Add 'wildcardProjection' parameter to... Closed
is related to SERVER-25023 no way to index the same fields with ... Closed
Backwards Compatibility: Fully Compatible
Sprint: Query Execution 2021-02-22, Query Execution 2021-03-08
Participants:
Case:
Linked BF Score: 40

 Description   

At present, an index's signature - that is, the combination of parameters which uniquely identify the index - is defined by its keypattern and collation. No index can be created if its signature is equivalent to an existing index. SERVER-25023 seeks to add the partialFilterExpression parameter to this list, such that multiple partial indexes could be built on the same fields so long as their filters are different.

We should also add the unique and sparse parameters to the index signature. At present, it is not possible to build a sparse index on a particular key pattern if an existing non-sparse index is already present. Users who wish to move from a full index to a sparse index have little option but to drop the existing index before building the sparse version. A similar situation exists for users who wish to introduce a uniqueness constraint on a field which is already indexed. Workarounds do exist in these situations, but they are ugly and more labour-intensive than should be necessary.



 Comments   
Comment by Githook User [ 03/Mar/21 ]

Author:

{'name': 'Yoonsoo Kim', 'email': 'yoonsoo.kim@mongodb.com', 'username': 'yun-soo'}

Message: SERVER-47657 Added unique and sparse to index signature
Branch: master
https://github.com/mongodb/mongo/commit/8865b969a8ccd01311e7bf3678bdf3453c92d338

Generated at Thu Feb 08 05:14:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.