Dear MongoDB friends,
I have a document structure with the default _id and three other elements. I need to determine an IDs set of the data. The query I use for this includes all document fields (except the _id) . I made the following observation:
If you create an compound index from all fields (incl. _id!) to aggregate the result to a list of _ids you save the FETCH phase and get a PROJECTION_COVERED phase (in comparison to an index without the _id). This seems to be a good swap.
But for me it feels weird to put an index on all fields. Is this a smell?
Thanks for discussion.