Database Reference
In-Depth Information
Using the profiler log
1. In order to demonstrate the efficiency of the profiler engine, assume you have a
database with a collection. This collection contains 100,000 records with the fol-
lowing schema:
{
"_id": ObjectId("533b1f9ae4671f0000000004"),
"x": "1"
}
2. Then, using the setProfilingLevel function, we enable the profiler for the
database as shown in the following screenshot:
3. For this example, we use 10 for the second parameter of the setProfilin-
gLevel function, which defines the slow operation threshold in milliseconds.
To produce an operation with a slow execution time, we can query testcol-
lection and sort all the results descending till field x . This is shown in the fol-
lowing screenshot:
Search WWH ::




Custom Search