{"action":"opened","issue":{"url":"https://api.github.com/repos/eaud/BookItList/issues/77","repository_url":"https://api.github.com/repos/eaud/BookItList","labels_url":"https://api.github.com/repos/eaud/BookItList/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/eaud/BookItList/issues/77/comments","events_url":"https://api.github.com/repos/eaud/BookItList/issues/77/events","html_url":"https://github.com/eaud/BookItList/issues/77","id":135101736,"number":77,"title":"Add indices to any database column that you search on","user":{"login":"KurtRMueller","id":879734,"avatar_url":"https://avatars.githubusercontent.com/u/879734?v=3","gravatar_id":"","url":"https://api.github.com/users/KurtRMueller","html_url":"https://github.com/KurtRMueller","followers_url":"https://api.github.com/users/KurtRMueller/followers","following_url":"https://api.github.com/users/KurtRMueller/following{/other_user}","gists_url":"https://api.github.com/users/KurtRMueller/gists{/gist_id}","starred_url":"https://api.github.com/users/KurtRMueller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KurtRMueller/subscriptions","organizations_url":"https://api.github.com/users/KurtRMueller/orgs","repos_url":"https://api.github.com/users/KurtRMueller/repos","events_url":"https://api.github.com/users/KurtRMueller/events{/privacy}","received_events_url":"https://api.github.com/users/KurtRMueller/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-20T17:05:44Z","updated_at":"2016-02-20T17:05:44Z","closed_at":null,"body":"For example, https://github.com/eaud/BookItList/blob/master/app/models/user.rb#L44, you're iterating over `activities.aasm_state`. As records are added to this table, the searches for activities with a particular aasm will be come slower and slower. \r\n\r\nAdding indices to this this column will significantly reduce the time it takes to perform this search. "}}