Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

231
Views
Does using a partial index over a regular field index affect overall insert performance for mongo collections?

I want to implement a partial index that indexes a subset of documents in my collection where documents in this subset contain a shared field not used in other documents outside the subset. Call this shared field "subset_field".

I know that using a partial index reduces the size of the index in memory, but when I want to insert new documents that do not have the shared "subset_field", will the partial index slow down the insert operation as much as a regular field index would?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

The documentation on partial indexes only mentions insertation in regards of unique fields:

A partial index with a unique constraint does not prevent the insertion of documents that do not meet the unique constraint if the documents do not meet the filter criteria.

But the doc on Write Op Performance does have a big note saying

MongoDB only updates a sparse or partial index if the documents involved in a write operation are included in the index.

So, the partial index is being used to check if it applies to the document but if it doesn't apply then the index update is skipped hence your performance improves.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!