Details
-
Bug
-
Resolution: Won't Do
-
Major - P3
-
None
-
*Location*: https://docs.mongodb.com/manual/core/index-compound/
*User-Agent*: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
*Referrer*: https://docs.mongodb.com/manual/core/index-partial/
*Screen Resolution*: 1366 x 768
Description
If you have a collection that has both a compound index and an index on its prefix (e.g.
{ a: 1, b: 1 }and
{ a: 1 }), if neither index has a sparse or unique constraint, then you can remove the index on the prefix (e.g.
{ a: 1 }). MongoDB will use the compound index in all of the situations that it would have used the prefix index.
if neither "prefix index" has a sparse or unique constraint ? is a valid statement.
Because if the Compound index has unique constraint does it matters ? still mongodb is not using "prefix index"
From DOCS-10305
what if i have unique index on {a,b} but not on {a}}} and I removed {{{a} how will it effect ?
why it's document neither of them should have unique index ?