Getting a performance boost with the best usage of indexes, by understanding what’s the data structure, how it works’s/stored, how is it loaded into memory. How Query optimization make’s decision to select indexes.
Getting a performance boost with the best usage of indexes, by understanding what’s the data structure, how it works’s/stored, how is it loaded into memory. How Query optimization make’s decision to select indexes.
_Basic understanding of indexes is required i.e what are indexes, index types, creating them. [https://docs.mongodb.com/manual/indexes/_](https://docs.mongodb.com/manual/indexes/)
Index on a filed/fields is stored in order that we specify using B-Tree data structure. Stored in ordered Let see what does it mean’s and how it help’s.
Index is created on the value of the filed referencing to the actual document stored.
snipped from: MognoDB university
Using B-Tree indexes significantly reduces the number of comparison to find the document.
snipped from: MognoDB university
Likewise in below picture we can see with index(sky blue line) even adding document still limit the number of document examined in comparison to without index/collscan.
snipped from: MognoDB university
Let’s see/visualize how the index are stored on disk. Index stored on disk is managed by the database storage engine itself.
db.getCollection("movieTicket")
.ensureIndex({"showDate":1, "seatNo":1, "status":1});
How the index ({“showDate”:1, “seatNo”:1, “status”:1}) is stored on disk.
showDate_1_seatNo_1_status_1
LIKE | COMMENT | SHARE | SUBSCRIBEIn this tutorial, I will discuss the basic query or command of MongoDB Database. We will learn how to Create, Delete, and ...
LIKE | COMMENT | SHARE | SUBSCRIBEIn this tutorial, I will discuss how to install MongoDB Database.Blog: http://aspdotnetexplorer.blogspot.comLike our page -...
LIKE | COMMENT | SHARE | SUBSCRIBEIn this tutorial, I will discuss the basic query or command of MongoDB Database. We will learn how to insert, Delete the d...
Enroll for free demo to acquire the best knowledge on the schema-less database from live industry experts through MongoDB training
LIKE | COMMENT | SHARE | SUBSCRIBEIn this tutorial, I will discuss the basic query or command of MongoDB Database. We will learn how to Create, Delete, and ...