I have a collection having about 10 million records. And I have a field key1
defined for round about 50,000 records. Now if I wish to index upon key1
how much space would actually be allotted. I mean would it be of order of 10 million units approx or 50,000 units for that index.
Also how does mongo manages index if values corresponding to key is of different type. For example. Lets say we have key2
for which we have 1,000 records storing strings, while other 1,000 records storing array. So how would index be created if one creates an index on key2
.
My first question is a genuine problem I wish to get resolved. Second one is just for curiosity sake.