Sha256: 21119adeec86674620778ffb03c6385159857c9e4d49a8818d2098bdc5b9c06e
Contents?: true
Size: 1.89 KB
Versions: 1
Compression:
Stored size: 1.89 KB
Contents
# Findex # Findex is a simple collection of Rake tasks that will help you locate missing database indexes in your Rails app. It can also generate migrations and run them, as well as filter by specific column types, names, and tables. **Please note** that Findex designed to find any potentially overlooked indexes. It is not a good practice to index every matching column it returns - that's way too many. ## Installation ## Install Findex as a gem: $ gem install findex --source=http://gems.github.com You may want to configure it as a gem in environment.rb instead, since you're going to need it in your Rakefile: config.gem 'findex', :source => 'http://gemcutter.org' ... then run: rake gems:install Now add an initializer hook. I typically use RAILS_ROOT/config/initializers/jsroutes.rb: ## Find Missing Indexes ## First, get some instructions: $ rake db:indexes:help rake db:indexes will generate a list of indexes your application's database may or may not need. To see a list of all indexes it thinks you need, just use rake db:indexes You can add migration=true to generate a migration file or perform=true to perform the indexing immediately: `rake db:indexes migration=true` You can also target specific column types, like so: `rake db:indexes:boolean` `rake db:indexes:datetime` `rake db:indexes:geo` `rake db:indexes:primary` `rake db:indexes:relationships` You can also filter by column names and types, or by whole tables: `rake db:indexes:names names=type,state` `rake db:indexes:types types=integer,decimal` `rake db:indexes tables=users,posts` Read the instructions above and start finding missing indexes! Thanks to Matt Janowski for the inspiration (http://robots.thoughtbot.com/post/163627511/a-grand-piano-for-your-violin) and Thoughtbot / Jon Yurek for the core of the indexes detection code! Copyright (c) 2009 Flip Sasser, released under the MIT license.
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
findex-0.1.0 | README.markdown |