2 回答
- 最新
- 投票最多
- 评论最多
0
Hi
- What is the DocDB version used here?
- How many indexes for the collection? Update() operations will go faster with less indexes. For the collection you shared, a better index is filed (obj2.id, obj3.status, obj1.id)
- Is there a way you may add hint to force the index using?
From the DocBD doc: https://docs.aws.amazon.com/documentdb/latest/developerguide/functional-differences.html#functional-differences.explain
Amazon DocumentDB emulates the MongoDB 4.0 API on a purpose-built database engine that utilizes a distributed, fault-tolerant, self-healing storage system. As a result, query plans and the output of explain() may differ between Amazon DocumentDB and MongoDB. Customers who want control over their query plan can use the $hint operator to enforce selection of a preferred index.
- From the MongoDB doc: https://www.mongodb.com/docs/manual/reference/method/db.collection.updateMany/ There seems to be a new feature in version 4.2.1 to add hint in the updateMany() function. See if this is available in the DocDB 4.0 version. Maybe not.
- is there is a way to bulkwrite for the same result using updateMany, and is that going to be faster?
- If you have support plan, I would suggest reach to us through a support case and our team can help investigate further.
0
- Try with bulkwrite
- DocumentDB is using write concern with majority so it may cost time to wait for the last reply
已回答 1 年前
相关内容
- AWS 官方已更新 1 年前
- AWS 官方已更新 1 年前