Skip to content
Free since 2015. Built for the engineers who keep things running.

cat /articles/improve-mongodb-performance-using-projection.md

Databases

Improve MongoDB Performance Using Projection

This article documents all my findings and analysis on how much performance was improved using projection in MongoDB. At the end of this article, we will be able to know whether MongoDB query performance will be improved by leveraging projection. Without further ado, let’s start.

medium.com11 Aug 2020 · summary

article --summary

The summary

This article documents all my findings and analysis on how much performance was improved using projection in MongoDB. At the end of this article, we will be able to know whether MongoDB query performance will be improved by leveraging projection. Projection is “a document given to a query that specifies which fields MongoDB returns in the result set.” The experiments I would like to perform here are: Unfortunately, the answer is no. However, the performance will improve if those returning fields are all indexed, and we will talk about this in the next section. We can improve the query performance, and make it 250 times faster using Covered Query compared to without indexes.

Editorial note: This is a summary of an article first published by medium.com. The full piece is on their site.

articles --latest

Latest articles

New from the blogs we follow and the community.

All articles

newsletter --weekly

DevOps Weekly, minus the noise.

The best reads, new jobs and upcoming events, in one email a week.