on previous apps i hadn't really worried much about adding foreign key
indexes on my tables just because they've been fairly small and i
didn't really think i needed them.
well, i'm working on something now that has the potential to have a
lot more data, and a lot more foreign keys.
so i have 3 tables... users, projects, and tasks.. should i be using
add_index on every foreign key in all of the tables?
in my tasks table, i'm going to have a foreign key for the user and
the project. seems like i could add up to 3 indexes..
add_index :tasks, [:project_id]
add_index :tasks, [:user_id]
add_index :tasks, [:project_id, :user_id], :unique => true
i realize this might not be the group to be asking about when and
where to add indexes and keys to a database, but in the context of
ruby and rails i just thought i would see what other people do. would
adding too many keys slow the database down at all?