Rails indexes is a small package of 2 rake tasks that scan your application models and displays a list of columns that probably should be indexed.
note: there should be mode fields depending on your application design and custom queries.
as a rails plugin:
script/plugin install git://github.com/eladmeidar/rails_indexes.git
Display a migration for adding/removing all necessary indexes based on associations:
Display a migration for adding/removing all necessary indexes based on AR::Base#find calls (including: find, find_by, find_all_by, find_by_x_and_y, find_all_by_x_and_y):
Note that it would probably make more sense running those tasks on production, where you actually need those indexes to be added.
Requires SQLite3 installed, then just:
to run the tests
Elad Meidar – http://blog.eizesus.com
Eric Davis – http://littlestreamsoftware.com
Released under the same license as Ruby. No Support. No Warranty, no Pain.