© Guy Harrison, Michael Harrison 2021
G. Harrison, M. HarrisonMongoDB Performance Tuninghttps://doi.org/10.1007/978-1-4842-6879-7_6

6. Query Tuning

Guy Harrison1   and Michael Harrison2
(1)
Kingsville, VIC, Australia
(2)
Derrimut, VIC, Australia
 

In almost all applications, the majority of database time is spent in data retrieval. A document can only be inserted or deleted once, but will typically be read many times between updates, and even updates must retrieve the data before performing their work. Therefore, much of our MongoDB tuning efforts focus on finding data and in particular the find() statement, which is the workhorse of MongoDB data retrieval.

Caching Results

Back in the dim dark days when Guy worked primarily with SQL-based databases, a wise ...

Get MongoDB Performance Tuning: Optimizing MongoDB Databases and their Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.