Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fork adds rescue blocks to allow useful output even with some errors.
Ruby
branch: master

This branch is 6 commits behind eladmeidar:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
tasks
test
MIT-LICENSE
README.textile
Rakefile

README.textile

Rails Indexes

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 may be more fields depending on your application design and custom queries.

Installation

as a rails plugin:

script/plugin install git://github.com/eladmeidar/rails_indexes.git

Usage

Display a migration for adding/removing all necessary indexes based on associations:

rake db:index_migration

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):

rake db:find_query_indexes

Note that it would probably make more sense running those tasks on production, where you actually need those indexes to be added.

Tests

Requires SQLite3 installed, then just:

rake

to run the tests

Author:

Elad Meidar – http://blog.eizesus.com

Thanks:
Eric Davis – http://littlestreamsoftware.com

Released under the same license as Ruby. No Support. No Warranty, no Pain.

Something went wrong with that request. Please try again.