[SERVER-5878] Allow hashed indexes to be unique Created: 18/May/12  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: 2.1.2
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Kevin Matulef Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 14
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Gantt Dependency
has to be done before SERVER-8031 Allow dropping the _id index when you... Closed
Related
is related to SERVER-2001 option to hash shard key Closed
Assigned Teams:
Query Optimization
Participants:

 Description   

Currently hashed indexes are not allowed to be unique (due to potential hash collisions on the keys). Uniqueness can be enforced on a field if a non-hashed index is created on the same field, but this is inefficient.

It should be possible to create a unique hashed index by checking for a match on the actual document (not just on the key in the index) before insertion.



 Comments   
Comment by Asya Kamsky [ 22/Jan/19 ]

It's not clear whether this is something that can be done. Flagging for discussion at needs triage.

Generated at Thu Feb 08 03:10:07 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.