Giter Site home page Giter Site logo

vyara / rails_indexes Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eladmeidar/rails_indexes

0.0 3.0 0.0 136 KB

A rake task to track down missing database indexes. does not assume that all foreign keys end with the convention of _id.

Home Page: http://blog.eizesus.com/2009/9/find-where-to-index-your-tables-on-a-rails-app/

License: MIT License

rails_indexes's Introduction

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.

rails_indexes's People

Contributors

edavis10 avatar andrew avatar ianheggie avatar kdonovan avatar

Watchers

James Cloos avatar Vyara Hristova avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.