Skip to content

Index your tables people.

July 15, 2008

A good read on table index.

http://www.railway.at/articles/2008/04/24/database-agnostic-database-ignorant

Sometimes, it is easy to forget when someone or something else handles it for you. For instance, ActiveRecords. Rails does not  create foreign keys for you. It only creates the primary key. It does not impose constraint on the database level. The association is handled on the application level. So always remember to create an index for your model associations. It could save your database server from working too hard.

Advertisements
No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: