BACKTRACE

(condense)

Back to Posts List

GET

Find where to index your tables on a Rails app

The are countless articles, tutorials and rants about the necessity of indexing your database tables but for some reason, some people still choose to forget about it until, well, they have too, and that’s about too late sometimes.

Most of us railers, use ActiveRecord, if not for all of our queries, than to the majority of them at least. I was talking to my buddy @mrkris today about the need to make it a little easier for people to create indexes on their application, or at least a better way to spot the need.

@mrkris offered a very nice, simple and clean solution for that problem and created a short script to solve it by trying to assume foreign key usage around the application. Works? yes. Always? dunno, just pointing out that if i used a custom foreign key name, one that does not end with a _id, this script won’t recognize it. TOO BAD MRKRIS. :)

Anyways, i wrote a rake task that tries to solve this issue as well as covering STI and polymorphic associations, get it from the Rails Indexes GitHub Repo.

POST

blog comments powered by Disqus

I Don't have cookies.

ELAD ENV

Variable Value
LINKEDIN
TWITTER
FACEBOOK
GITHUB
WWR
IRC
{ 'irc.freenode.net' => [ '#rubyonrails', '#railsbridge', '#ruby', '#mootools' ]}
SKYPE
eladmeidar

You're seeing this error because I think it is funny.