Fix issue where completed items would redundantly show context on a context page and project on a project page.

Eliminated some N+1 query generation issues on context and project detail pages related to looking up tags.
Added rake task to turn on and off the mysql query_analyzer plugin, which I'm using to help in my optimization process.



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@662 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
lukemelia 2007-11-27 05:51:38 +00:00
parent 1516d7ae14
commit 0f823a8a2e
9 changed files with 55 additions and 16 deletions

View file

@ -21,4 +21,30 @@ namespace :query_trace do
FileUtils.rm_rf("#{RAILS_ROOT}/vendor/plugins/query_trace")
puts "QueryTrace plugin disabled. Must restart server to take effect."
end
end
end
namespace :query_analyzer do
desc "Enables the query_analyzer plugin. Must restart server to take effect."
task :on => :environment do
unless File.exist?("#{RAILS_ROOT}/vendor/query_analyzer.tar.gz")
Dir.chdir("#{RAILS_ROOT}/vendor") do
url = "http://svn.nfectio.us/plugins/query_analyzer"
puts "Loading query_analyzer from #{url}..."
system "svn co #{url} query_analyzer"
system "tar zcf query_analyzer.tar.gz --exclude=.svn query_analyzer"
FileUtils.rm_rf("query_analyzer")
end
end
Dir.chdir("#{RAILS_ROOT}/vendor/plugins") do
system "tar zxf ../query_analyzer.tar.gz query_analyzer"
end
puts "QueryAnalyzer plugin enabled. Must restart server to take effect."
end
desc "Disables the query_analyzer plugin. Must restart server to take effect."
task :off => :environment do
FileUtils.rm_rf("#{RAILS_ROOT}/vendor/plugins/query_analyzer")
puts "QueryAnalyzer plugin disabled. Must restart server to take effect."
end
end