diaspora/diaspora — pull request #4190 by Ruxton (2013-05-30 14:04:37+00:00)
Title: Add user_id index for contacts table

Done mainly because Profile.subscribers does a join across contacts
using where user_id clause. It gets slow when there's a lot of contacts.

An issue when dispatching a profile update to massive number of contacts https://github.com/diaspora/diaspora/blob/develop/lib/postzord/dispatcher.rb#L87
https://github.com/diaspora/diaspora/blob/develop/app/models/profile.rb#L54