加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – MongoDB不断查询命名空间

发布时间:2020-12-17 04:39:08 所属栏目:百科 来源:网络整理
导读:在我的rails应用程序中我使用mongoid并在日志之前几乎每个查询,即使在相同的请求,它也 MONGODB dbname['system.namespaces'].find({}) 这是做什么的?这是性能问题吗?我可以以某种方式缓存,所以它不必一直这样做或至少阻止它堵塞日志? 编辑:这是日志的相
在我的rails应用程序中我使用mongoid并在日志之前几乎每个查询,即使在相同的请求,它也
MONGODB dbname['system.namespaces'].find({})

这是做什么的?这是性能问题吗?我可以以某种方式缓存,所以它不必一直这样做或至少阻止它堵塞日志?

编辑:这是日志的相关部分

Processing by FilesController#new as HTML
Started GET "/" for 127.0.0.1 at Fri Sep 09 15:59:43 -0700 2011
[Barista] Compiling all scripts for barista
[Barista] Compiling all coffeescripts
[Barista] Copying all javascripts
MONGODB db['system.namespaces'].find({})
MONGODB db['users'].find({:_id=>BSON::ObjectId('4e6a949935d3e9726b000001')})
MONGODB db['system.namespaces'].find({})
MONGODB db['files'].find({:token=>"nonssb38"})

解决方法

这种情况发生在Mongoid,直到3.0出现.请注意,这只发生在开发模式中,所以它没什么大不了的.

参考文献:

> https://github.com/mongoid/mongoid/issues/1465
> https://github.com/mongoid/mongoid/issues/1291

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读