Timeline for MongoDB Indexing - How many fields should I index?
Current License: CC BY-SA 4.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 10, 2019 at 19:24 | history | edited | Sy10100 | CC BY-SA 4.0 |
added 1 character in body
|
Jan 10, 2019 at 19:17 | comment | added | Sy10100 | @SotirisKaniras no I mean one by query. You can try to create a first index on {user.id:1, createdAt: -1} then make an explain plan on each query to check if the index is used, how many documents/keys are examined and see if the winning plan looks good ! | |
Jan 10, 2019 at 14:54 | comment | added | Sotiris Kaniras |
I would create one index for each query you mean a compound index, including all of the fields I mentioned?
|
|
Jan 10, 2019 at 10:46 | history | answered | Sy10100 | CC BY-SA 4.0 |