gpt4 book ai didi

mongodb - 我是否需要像 RDBMS 一样在一段时间后重新索引 MongoDB 集合

转载 作者:可可西里 更新时间:2023-11-01 09:08:57 25 4
gpt4 key购买 nike

我想获得一些关于重新索引 MongoDB 的知识。请原谅我问一些主观的问题。

问题是:MongoDB 是否需要像我们为 RDBMS 所做的那样定期重新索引,或者 Mongo 自动管理它。

感谢您的反馈

最佳答案

Mongodb takes care of indexes during routine updates. This operation may be expensive for collections that have a large amount of data and/or a large number of indexes.For most users, the reIndex command is unnecessary. However, it may be worth running if the collection size has changed significantly or if the indexes are consuming a disproportionate amount of disk space.

Call reIndex using the following form:

db.collection.reIndex();

引用:https://docs.mongodb.com/manual/reference/method/db.collection.reIndex/

关于mongodb - 我是否需要像 RDBMS 一样在一段时间后重新索引 MongoDB 集合,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22059836/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com