Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

disable explain in Rails 3.2

Is it possible to disable the new the explain functionality in Rails 3.2 globally via configuration? I'm using activerecord-sqlserver-adapter 3.2.1 and there appear to be some bugs with the explain (show plan) portion of the gem.

like image 729
Patrick Klingemann Avatar asked Mar 19 '12 20:03

Patrick Klingemann


2 Answers

To cite from 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.

so just set

config.active_record.auto_explain_threshold_in_seconds = nil
like image 199
Holger Just Avatar answered Sep 21 '22 16:09

Holger Just


You can disable auto-explain by setting config.active_record.auto_explain_threshold_in_seconds = nil in your config/environments/development.rb

like image 36
igreulich Avatar answered Sep 19 '22 16:09

igreulich