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

ruby-on-rails – auto_explain_threshold_in_seconds

发布时间:2020-12-17 04:22:22 所属栏目:百科 来源:网络整理
导读:运行WEBrick时,我收到的信息低于给定的消息. auto_explain_threshold_in_seconds is set but will be ignored because your adapter does not support this feature. Please unset the configuration to avoid this warning. 我在用: gem ‘rails’,‘3.2.1
运行WEBrick时,我收到的信息低于给定的消息.

auto_explain_threshold_in_seconds is set but will be ignored because
your adapter does not support this feature. Please unset the
configuration to avoid this warning.

我在用:

gem ‘rails’,‘3.2.13’
gem ‘mysql‘

WEBrick 1.3.1
ruby 1.9.3 (2013-02-22) [i386-mingw32]

有人可以帮助我知道 – 为什么我得到这个以及如何解决它?

解决方法

如上所述,您可以注释掉配置,错误会消失,但它试图告诉您,您的查询速度很慢,而您可能想知道那里发生了什么.

如果你尝试mysql2 gem而不是mysql gem它应该工作.

这似乎是undefined method `explain’ for #<ActiveRecord::ConnectionAdapters::MysqlAdapter的重复

更新:正如@127所指出的那样,日志中存在此消息并不意味着您的查询速度很慢,但是您的适配器不支持这种用于告诉您何时查询速度慢的机制.我应该说“你不想只关闭这个功能,你可能想要使用mysql2 gem,这样你就可以看到一个慢速查询出现的时候”

(编辑:李大同)

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

    推荐文章
      热点阅读