If you are looking to improve your database performance, you might want to index your database, esspecially if it is large. Here are some rake tasks that will look at your code and active record and automatically add indexes to your devel db.
These two tasks are fairly rough drafts. I am open to any input that would expand on what I have here.
lib/tasks/db_indexing.rake (then run rake db_indexing:index_fks_in_model and rake db_indexing:index_sql_calls_in_app )