From the course: MongoDB Essential Training
Unlock the full course today
Join today to access over 24,200 courses taught by industry experts.
Performance - MongoDB Tutorial
From the course: MongoDB Essential Training
Performance
- [Instructor] Aggregation pipelines are super powerful, but they also require more RAM and CPU than CRUD operations. So you'll want to keep an eye on performance issues with them, especially if the amount of data you are processing is large, the operation will be run frequently or the operation is intended to provide real time data fast. Luckily, MongoDB allows you to see information about how aggregation pipelines and other queries perform fairly easily. Let's look at it on the terminal. All right, so I have prepared a query here that we are going to use to see some performance information from MongoDB. In the first line here, you can see we are using the movies connection, and then we are calling the explain method and we are passing it a string that says executionStats. That will tell MongoDB that we are not actually interested in the results of the aggregation pipeline that we want to execute here,…
Contents
-
-
-
-
-
-
-
An overview of stages1m 47s
-
(Locked)
$group4m 14s
-
(Locked)
$bucket5m 15s
-
(Locked)
$unwind3m 18s
-
(Locked)
$merge and $out3m 59s
-
(Locked)
$function3m 27s
-
(Locked)
$lookup4m 44s
-
(Locked)
Performance10m 38s
-
(Locked)
Challenge: Write aggregation pipelines24s
-
(Locked)
Solution: Write aggregation pipelines5m 18s
-
-
-
-