MongoDB Single field index vs Compound index - Create indexes and tune MongoDB queries Performance

preview_player
Показать описание
This tutorial shows how to index your collection to speed up queries and sort, and the difference between Single field index and Compound indexes.

00:16 Created the first query
04:19 Query profiling
04:55 Introduction to Single Field index (performance tuning)
07:11 Performance profiling using "executionStats" tool
12:20 Indexes the right way - introduction to compound indexes
19:34 Conclusion

#Mongodb #mongo #nosql #mongodbtutorial #mongodbIndexes #tutorialMongodb #mongo-indexes
Рекомендации по теме
Комментарии
Автор

Anyone reading this before watching - I guarantee this video is legit better than 99% videos on mongodb index on Youtube. A must watch for everyone. Thanks for uploading.

AbhishekPathak
Автор

keep up good work!!! looking forward multi-index

BullishBuddy
Автор

Great job. What would been nice is to show, how more scenarios of when the index takes affect. For instance, If you moved the pridicted_salary $gt query into the first position, would it have still used the gender index?

KrisMeister
Автор

Great Video, Sir. I see you made all the queries in a database that dont change after the indexes are created. So, if I add more documents to a collection after the index was created, will the new document be indexed or do I need to create (update?) the index again? Thank you for the great content.

LobisomemCearence
Автор

I have one question. Lets say we have an index on collection as below
1, last_name: 1})
And we execute below queries,
1) expRun.find({"last_name":"Johnson", "address.state":"New York"})
2) York", "last_name":"Johnson"})
Both would use same index and both would have same performance

mandarkulkarni
Автор

Hi Sir, I understood everything clearly, but have a doubt regarding compound indexing if the second value isn't a primitive type, like in this case if we had salary as ref types that is ids that too array of _ids....for example we wanna index todos per in event collection we have reference of todos, then how would we do compound indexing. Looking forward to your reponse

neelabhdutta
join shbcf.ru