[SERVER-32511] Does WiredTiger have performance issue when update a large array of a document Created: 02/Jan/18  Updated: 21/Mar/18  Resolved: 12/Feb/18

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Question Priority: Major - P3
Reporter: Roben Assignee: Kelsey Schubert
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

As the doc said here https://docs.mongodb.com/manual/core/write-performance/#document-growth-and-the-mmapv1-storage-engine
```
For the MMAPv1 storage engine, if an update operation causes a document to exceed the currently allocated record size, MongoDB relocates the document on disk with enough contiguous space to hold the document. Updates that require relocations take longer than updates that do not, particularly if the collection has indexes. If a collection has indexes, MongoDB must update all index entries. Thus, for a collection with many indexes, the move will impact the write throughput.
```
Would this affect WiredTiger ? The official doc said nothing about it and we don't know if we frequently push something into an array of a document and cause the document growth, would it cause performance issues ?



 Comments   
Comment by Kelsey Schubert [ 12/Feb/18 ]

Hi narychen,

The issue described by quoted section is specific to MMMAPv1. In WiredTiger, there is a layer of indirection between the document indexed and it's location on disk, consequently a change in disk location would not require all indexes to be updated. MMAPv1 and WiredTiger have very different performance characteristics and I would recommend testing your schema and access patterns to ensure performance matches your expectations.

However, please note that the SERVER project is for reporting bugs or feature suggestions for the MongoDB server. For MongoDB-related support regarding schema design and best practices, please post on the mongodb-user group or Stack Overflow with the mongodb tag. A question like this involving more discussion would be best posted on the mongodb-users group.

Kind regards,
Kelsey

Generated at Thu Feb 08 04:30:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.