{"action":"created","comment":{"url":"https://api.github.com/repos/hummingbird-me/hummingbird/pulls/comments/34756672","id":34756672,"diff_hunk":"@@ -0,0 +1,15 @@\n+class IndexCleanup < ActiveRecord::Migration\n+  def change\n+    # Extremely common operations\n+    add_index :reviews, :user_id\n+    add_index :reviews, :anime_id\n+    add_index :recommendations, :user_id\n+\n+    # WTF?\n+    remove_index :users, :waifu_or_husbando","path":"db/migrate/20150712193314_index_cleanup.rb","position":9,"original_position":9,"commit_id":"d3a91175072a2c99b13457142a321f96b1ce4897","original_commit_id":"d3a91175072a2c99b13457142a321f96b1ce4897","user":{"login":"DNA","id":20308,"avatar_url":"https://avatars.githubusercontent.com/u/20308?v=3","gravatar_id":"","url":"https://api.github.com/users/DNA","html_url":"https://github.com/DNA","followers_url":"https://api.github.com/users/DNA/followers","following_url":"https://api.github.com/users/DNA/following{/other_user}","gists_url":"https://api.github.com/users/DNA/gists{/gist_id}","starred_url":"https://api.github.com/users/DNA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DNA/subscriptions","organizations_url":"https://api.github.com/users/DNA/orgs","repos_url":"https://api.github.com/users/DNA/repos","events_url":"https://api.github.com/users/DNA/events{/privacy}","received_events_url":"https://api.github.com/users/DNA/received_events","type":"User","site_admin":false},"body":"Since there's a work on waifu/husbando on #375 (it's still active?) I think it's okay to remove this without the *wtf?* comment… :P ","created_at":"2015-07-16T05:26:16Z","updated_at":"2015-07-16T05:26:16Z","html_url":"https://github.com/hummingbird-me/hummingbird/pull/597#discussion_r34756672","pull_request_url":"https://api.github.com/repos/hummingbird-me/hummingbird/pulls/597","_links":{"self":{"href":"https://api.github.com/repos/hummingbird-me/hummingbird/pulls/comments/34756672"},"html":{"href":"https://github.com/hummingbird-me/hummingbird/pull/597#discussion_r34756672"},"pull_request":{"href":"https://api.github.com/repos/hummingbird-me/hummingbird/pulls/597"}}},"pull_request":{"url":"https://api.github.com/repos/hummingbird-me/hummingbird/pulls/597","id":39767646,"html_url":"https://github.com/hummingbird-me/hummingbird/pull/597","diff_url":"https://github.com/hummingbird-me/hummingbird/pull/597.diff","patch_url":"https://github.com/hummingbird-me/hummingbird/pull/597.patch","issue_url":"https://api.github.com/repos/hummingbird-me/hummingbird/issues/597","number":597,"state":"open","locked":false,"title":"Cleanup indices","user":{"login":"NuckChorris","id":430411,"avatar_url":"https://avatars.githubusercontent.com/u/430411?v=3","gravatar_id":"","url":"https://api.github.com/users/NuckChorris","html_url":"https://github.com/NuckChorris","followers_url":"https://api.github.com/users/NuckChorris/followers","following_url":"https://api.github.com/users/NuckChorris/following{/other_user}","gists_url":"https://api.github.com/users/NuckChorris/gists{/gist_id}","starred_url":"https://api.github.com/users/NuckChorris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NuckChorris/subscriptions","organizations_url":"https://api.github.com/users/NuckChorris/orgs","repos_url":"https://api.github.com/users/NuckChorris/repos","events_url":"https://api.github.com/users/NuckChorris/events{/privacy}","received_events_url":"https://api.github.com/users/NuckChorris/received_events","type":"User","site_admin":false},"body":"Tweaks to our indexing situation discovered via pghero and mini-profiler in production.\r\n\r\nFor the most part, these added indices shouldn't make a noticeable difference in load times.  `recommendations` may benefit, but `reviews` is such a small table that the current seq scan doesn't add more than about 15ms to the anime endpoint.\r\n\r\nThe `created_at` on `substories` should reduce the kotodama load time quite a bit (hoping to shave off about 5 seconds there)\r\n\r\nThere were also two completely nonsensical and pointless indices on the `users` table for `waifu_slug` and `waifu_or_husbando`.  We've never had any queries based on those, and I can't imagine ever needing them, so I removed them.","created_at":"2015-07-12T19:59:31Z","updated_at":"2015-07-16T05:26:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1f1cd18589db3100b95f77337585d9781cdd63ea","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hummingbird-me/hummingbird/pulls/597/commits","review_comments_url":"https://api.github.com/repos/hummingbird-me/hummingbird/pulls/597/comments","review_comment_url":"https://api.github.com/repos/hummingbird-me/hummingbird/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hummingbird-me/hummingbird/issues/597/comments","statuses_url":"https://api.github.com/repos/hummingbird-me/hummingbird/statuses/d3a91175072a2c99b13457142a321f96b1ce4897","head":{"label":"hummingbird-me:index-cleanup","ref":"index-cleanup","sha":"d3a91175072a2c99b13457142a321f96b1ce4897","user":{"login":"hummingbird-me","id":7648832,"avatar_url":"https://avatars.githubusercontent.com/u/7648832?v=3","gravatar_id":"","url":"https://api.github.com/users/hummingbird-me","html_url":"https://github.com/hummingbird-me","followers_url":"https://api.github.com/users/hummingbird-me/followers","following_url":"https://api.github.com/users/hummingbird-me/following{/other_user}","gists_url":"https://api.github.com/users/hummingbird-me/gists{/gist_id}","starred_url":"https://api.github.com/users/hummingbird-me/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hummingbird-me/subscriptions","organizations_url":"https://api.github.com/users/hummingbird-me/orgs","repos_url":"https://api.github.com/users/hummingbird-me/repos","events_url":"https://api.github.com/users/hummingbird-me/events{/privacy}","received_events_url":"https://api.github.com/users/hummingbird-me/received_events","type":"Organization","site_admin":false},"repo":{"id":20206508,"name":"hummingbird","full_name":"hummingbird-me/hummingbird","owner":{"login":"hummingbird-me","id":7648832,"avatar_url":"https://avatars.githubusercontent.com/u/7648832?v=3","gravatar_id":"","url":"https://api.github.com/users/hummingbird-me","html_url":"https://github.com/hummingbird-me","followers_url":"https://api.github.com/users/hummingbird-me/followers","following_url":"https://api.github.com/users/hummingbird-me/following{/other_user}","gists_url":"https://api.github.com/users/hummingbird-me/gists{/gist_id}","starred_url":"https://api.github.com/users/hummingbird-me/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hummingbird-me/subscriptions","organizations_url":"https://api.github.com/users/hummingbird-me/orgs","repos_url":"https://api.github.com/users/hummingbird-me/repos","events_url":"https://api.github.com/users/hummingbird-me/events{/privacy}","received_events_url":"https://api.github.com/users/hummingbird-me/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hummingbird-me/hummingbird","description":"Probably the coolest anime discovery platform around.","fork":false,"url":"https://api.github.com/repos/hummingbird-me/hummingbird","forks_url":"https://api.github.com/repos/hummingbird-me/hummingbird/forks","keys_url":"https://api.github.com/repos/hummingbird-me/hummingbird/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hummingbird-me/hummingbird/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hummingbird-me/hummingbird/teams","hooks_url":"https://api.github.com/repos/hummingbird-me/hummingbird/hooks","issue_events_url":"https://api.github.com/repos/hummingbird-me/hummingbird/issues/events{/number}","events_url":"https://api.github.com/repos/hummingbird-me/hummingbird/events","assignees_url":"https://api.github.com/repos/hummingbird-me/hummingbird/assignees{/user}","branches_url":"https://api.github.com/repos/hummingbird-me/hummingbird/branches{/branch}","tags_url":"https://api.github.com/repos/hummingbird-me/hummingbird/tags","blobs_url":"https://api.github.com/repos/hummingbird-me/hummingbird/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hummingbird-me/hummingbird/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hummingbird-me/hummingbird/git/refs{/sha}","trees_url":"https://api.github.com/repos/hummingbird-me/hummingbird/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hummingbird-me/hummingbird/statuses/{sha}","languages_url":"https://api.github.com/repos/hummingbird-me/hummingbird/languages","stargazers_url":"https://api.github.com/repos/hummingbird-me/hummingbird/stargazers","contributors_url":"https://api.github.com/repos/hummingbird-me/hummingbird/contributors","subscribers_url":"https://api.github.com/repos/hummingbird-me/hummingbird/subscribers","subscription_url":"https://api.github.com/repos/hummingbird-me/hummingbird/subscription","commits_url":"https://api.github.com/repos/hummingbird-me/hummingbird/commits{/sha}","git_commits_url":"https://api.github.com/repos/hummingbird-me/hummingbird/git/commits{/sha}","comments_url":"https://api.github.com/repos/hummingbird-me/hummingbird/comments{/number}","issue_comment_url":"https://api.github.com/repos/hummingbird-me/hummingbird/issues/comments{/number}","contents_url":"https://api.github.com/repos/hummingbird-me/hummingbird/contents/{+path}","compare_url":"https://api.github.com/repos/hummingbird-me/hummingbird/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hummingbird-me/hummingbird/merges","archive_url":"https://api.github.com/repos/hummingbird-me/hummingbird/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hummingbird-me/hummingbird/downloads","issues_url":"https://api.github.com/repos/hummingbird-me/hummingbird/issues{/number}","pulls_url":"https://api.github.com/repos/hummingbird-me/hummingbird/pulls{/number}","milestones_url":"https://api.github.com/repos/hummingbird-me/hummingbird/milestones{/number}","notifications_url":"https://api.github.com/repos/hummingbird-me/hummingbird/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hummingbird-me/hummingbird/labels{/name}","releases_url":"https://api.github.com/repos/hummingbird-me/hummingbird/releases{/id}","created_at":"2014-05-27T04:05:08Z","updated_at":"2015-07-15T20:59:17Z","pushed_at":"2015-07-16T04:36:49Z","git_url":"git://github.com/hummingbird-me/hummingbird.git","ssh_url":"git@github.com:hummingbird-me/hummingbird.git","clone_url":"https://github.com/hummingbird-me/hummingbird.git","svn_url":"https://github.com/hummingbird-me/hummingbird","homepage":"http://hummingbird.me/","size":103354,"stargazers_count":1376,"watchers_count":1376,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":162,"mirror_url":null,"open_issues_count":54,"forks":162,"open_issues":54,"watchers":1376,"default_branch":"master"}},"base":{"label":"hummingbird-me:master","ref":"master","sha":"1715ea549b05f1ca517767eca188bef60ceef9e2","user":{"login":"hummingbird-me","id":7648832,"avatar_url":"https://avatars.githubusercontent.com/u/7648832?v=3","gravatar_id":"","url":"https://api.github.com/users/hummingbird-me","html_url":"https://github.com/hummingbird-me","followers_url":"https://api.github.com/users/hummingbird-me/followers","following_url":"https://api.github.com/users/hummingbird-me/following{/other_user}","gists_url":"https://api.github.com/users/hummingbird-me/gists{/gist_id}","starred_url":"https://api.github.com/users/hummingbird-me/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hummingbird-me/subscriptions","organizations_url":"https://api.github.com/users/hummingbird-me/orgs","repos_url":"https://api.github.com/users/hummingbird-me/repos","events_url":"https://api.github.com/users/hummingbird-me/events{/privacy}","received_events_url":"https://api.github.com/users/hummingbird-me/received_events","type":"Organization","site_admin":false},"repo":{"id":20206508,"name":"hummingbird","full_name":"hummingbird-me/hummingbird","owner":{"login":"hummingbird-me","id":7648832,"avatar_url":"https://avatars.githubusercontent.com/u/7648832?v=3","gravatar_id":"","url":"https://api.github.com/users/hummingbird-me","html_url":"https://github.com/hummingbird-me","followers_url":"https://api.github.com/users/hummingbird-me/followers","following_url":"https://api.github.com/users/hummingbird-me/following{/other_user}","gists_url":"https://api.github.com/users/hummingbird-me/gists{/gist_id}","starred_url":"https://api.github.com/users/hummingbird-me/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hummingbird-me/subscriptions","organizations_url":"https://api.github.com/users/hummingbird-me/orgs","repos_url":"https://api.github.com/users/hummingbird-me/repos","events_url":"https://api.github.com/users/hummingbird-me/events{/privacy}","received_events_url":"https://api.github.com/users/hummingbird-me/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hummingbird-me/hummingbird","description":"Probably the coolest anime discovery platform around.","fork":false,"url":"https://api.github.com/repos/hummingbird-me/hummingbird","forks_url":"https://api.github.com/repos/hummingbird-me/hummingbird/forks","keys_url":"https://api.github.com/repos/hummingbird-me/hummingbird/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hummingbird-me/hummingbird/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hummingbird-me/hummingbird/teams","hooks_url":"https://api.github.com/repos/hummingbird-me/hummingbird/hooks","issue_events_url":"https://api.github.com/repos/hummingbird-me/hummingbird/issues/events{/number}","events_url":"https://api.github.com/repos/hummingbird-me/hummingbird/events","assignees_url":"https://api.github.com/repos/hummingbird-me/hummingbird/assignees{/user}","branches_url":"https://api.github.com/repos/hummingbird-me/hummingbird/branches{/branch}","tags_url":"https://api.github.com/repos/hummingbird-me/hummingbird/tags","blobs_url":"https://api.github.com/repos/hummingbird-me/hummingbird/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hummingbird-me/hummingbird/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hummingbird-me/hummingbird/git/refs{/sha}","trees_url":"https://api.github.com/repos/hummingbird-me/hummingbird/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hummingbird-me/hummingbird/statuses/{sha}","languages_url":"https://api.github.com/repos/hummingbird-me/hummingbird/languages","stargazers_url":"https://api.github.com/repos/hummingbird-me/hummingbird/stargazers","contributors_url":"https://api.github.com/repos/hummingbird-me/hummingbird/contributors","subscribers_url":"https://api.github.com/repos/hummingbird-me/hummingbird/subscribers","subscription_url":"https://api.github.com/repos/hummingbird-me/hummingbird/subscription","commits_url":"https://api.github.com/repos/hummingbird-me/hummingbird/commits{/sha}","git_commits_url":"https://api.github.com/repos/hummingbird-me/hummingbird/git/commits{/sha}","comments_url":"https://api.github.com/repos/hummingbird-me/hummingbird/comments{/number}","issue_comment_url":"https://api.github.com/repos/hummingbird-me/hummingbird/issues/comments{/number}","contents_url":"https://api.github.com/repos/hummingbird-me/hummingbird/contents/{+path}","compare_url":"https://api.github.com/repos/hummingbird-me/hummingbird/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hummingbird-me/hummingbird/merges","archive_url":"https://api.github.com/repos/hummingbird-me/hummingbird/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hummingbird-me/hummingbird/downloads","issues_url":"https://api.github.com/repos/hummingbird-me/hummingbird/issues{/number}","pulls_url":"https://api.github.com/repos/hummingbird-me/hummingbird/pulls{/number}","milestones_url":"https://api.github.com/repos/hummingbird-me/hummingbird/milestones{/number}","notifications_url":"https://api.github.com/repos/hummingbird-me/hummingbird/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hummingbird-me/hummingbird/labels{/name}","releases_url":"https://api.github.com/repos/hummingbird-me/hummingbird/releases{/id}","created_at":"2014-05-27T04:05:08Z","updated_at":"2015-07-15T20:59:17Z","pushed_at":"2015-07-16T04:36:49Z","git_url":"git://github.com/hummingbird-me/hummingbird.git","ssh_url":"git@github.com:hummingbird-me/hummingbird.git","clone_url":"https://github.com/hummingbird-me/hummingbird.git","svn_url":"https://github.com/hummingbird-me/hummingbird","homepage":"http://hummingbird.me/","size":103354,"stargazers_count":1376,"watchers_count":1376,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":162,"mirror_url":null,"open_issues_count":54,"forks":162,"open_issues":54,"watchers":1376,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hummingbird-me/hummingbird/pulls/597"},"html":{"href":"https://github.com/hummingbird-me/hummingbird/pull/597"},"issue":{"href":"https://api.github.com/repos/hummingbird-me/hummingbird/issues/597"},"comments":{"href":"https://api.github.com/repos/hummingbird-me/hummingbird/issues/597/comments"},"review_comments":{"href":"https://api.github.com/repos/hummingbird-me/hummingbird/pulls/597/comments"},"review_comment":{"href":"https://api.github.com/repos/hummingbird-me/hummingbird/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hummingbird-me/hummingbird/pulls/597/commits"},"statuses":{"href":"https://api.github.com/repos/hummingbird-me/hummingbird/statuses/d3a91175072a2c99b13457142a321f96b1ce4897"}}}}