Why is ActiveRecord destroy_all taking so long?
问题 I have a simple rails app with articles and comments running on MySQL 5.5, Ruby 1.9.3 and rails 3.2.12: class Article < ActiveRecord::Base attr_accessible :body, :title has_many :comments end class Comment < ActiveRecord::Base attr_accessible :content belongs_to :article end I have generated lots of comments for an article, and am now trying to delete them all in the rails console: $ rails c Loading development environment (Rails 3.2.12) [1] pry(main)> a = Article.find(1) (2.0ms) SET SQL_AUTO