Field and Subfield Indexing Efficiency

I have such documents stored in the collection:

{
    _id : ...
    sender: {memberid:<something>, name:<something>}
}

I index the collection by subfield sender.memberid. I read somewhere that indexing by subfile is less efficient (by performance) than by field, so changing the structure of the document to:

{
    _id: ...
    senderid: ...
    sendername: ...
}

and indexing senderidwill lead to faster insertions and search queries, but the article did not explain why. Is there any difference in these two approaches, and if so, why?

+3
source share
1 answer

. , . , . .

- , .

. , , , .

+2

All Articles