Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

229
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda