gpt4 book ai didi

sql - 在 Rails 3.2 中禁用解释

转载 作者:行者123 更新时间:2023-12-03 21:10:38 30 4
gpt4 key购买 nike

是否可以通过配置全局禁用 Rails 3.2 中的新解释功能?我正在使用 activerecord-sqlserver-adapter 3.2.1,并且 gem 的解释(显示计划)部分似乎存在一些错误。

最佳答案

引用自 http://weblog.rubyonrails.org/2011/12/6/what-s-new-in-edge-rails-explain/

New applications get

config.active_record.auto_explain_threshold_in_seconds = 0.5

in config/environments/development.rb. Active Record monitors queries and if they take more than that threshold their query plan will be logged using warn.

[...]

By default the threshold is nil in the test and production environments, which means the feature is disabled.



所以只需设置
config.active_record.auto_explain_threshold_in_seconds = nil

关于sql - 在 Rails 3.2 中禁用解释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9777203/

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