mongo python用pymongo find 获取数据感觉很慢for each in db.find(projection={"_id":1, "title":1, "core":1, content":1}):
没有做 where, 只有 project, 经过 5万条document的测试:
消耗 300多秒。
这个速度应该不科学吧。
是不是我 的 pymongo 写法错误,或者 mongo 有 快速的find 方法?
因为是线性查找,所以比较慢,可以读取到hashtable里面搜索
你也可以查看一下性能分析报告db.find(projection={"_id":1, "title":1, "core":1, content":1}).explain()