I have a question regarding two indices which were created for one of our collection on MongoDB Atlas.
Both are regular compound indices which are structured as follows:
Type of fields is as follows:
- structureNode: ObjectID
- date: ISODate
- kind: string
- posGroup: string
- source: string
What confuses me is the following observation:
The size of index (1) is greater than the size of index (2). (see screenshot attached)
Both indices are fully built and (2) contains all fields that are available in (1).
Thus, I expect index (2) to be at least the size of index (1).
Q: Why is it that index (1) is larger than index (2)?
Is this some kind of compression issue?
Has the unique flag on index (2) any influence on index size?