I tried searching the Mongo documentation, but I can’t find any details on whether queries on unique indexes will be faster than queries on non-ideal indexes (given the same data)
Therefore, I understand that a unique index will have high selectivity and good performance. But, given two fields whose concatenation is unique, will a non-specific composite index work slower than a unique composite index?
I suggest that unique indexes can slow down inserts as uniqueness needs to be verified. But is a read performance improvement a unique index, if any, really worth it?
mongodb mongodb-indexes unique-index
Zaid masud
source share