GitHub PullRequestEvent at 2014-03-05 13:27:35
Repository: freesound
Actor: alastair
Payload: {"action":"opened","number":577,"pull_request":{"url":"https://api.github.com/repos/MTG/freesound/pulls/577","id":13210160,"html_url":"https://github.com/MTG/freesound/pull/577","diff_url":"https://github.com/MTG/freesound/pull/577.diff","patch_url":"https://github.com/MTG/freesound/pull/577.patch","issue_url":"https://api.github.com/repos/MTG/freesound/issues/577","number":577,"state":"open","title":"Provide explicit list lengths for pagination","user":{"login":"alastair","id":19217,"avatar_url":"https://gravatar.com/avatar/0609e0c61e2eabfeabe00b9481b4b00a?d=https%3A%2F%2Fidenticons.github.com%2F842af58fcd81687f10b5c099e49ec699.png&r=x","gravatar_id":"0609e0c61e2eabfeabe00b9481b4b00a","url":"https://api.github.com/users/alastair","html_url":"https://github.com/alastair","followers_url":"https://api.github.com/users/alastair/followers","following_url":"https://api.github.com/users/alastair/following{/other_user}","gists_url":"https://api.github.com/users/alastair/gists{/gist_id}","starred_url":"https://api.github.com/users/alastair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alastair/subscriptions","organizations_url":"https://api.github.com/users/alastair/orgs","repos_url":"https://api.github.com/users/alastair/repos","events_url":"https://api.github.com/users/alastair/events{/privacy}","received_events_url":"https://api.github.com/users/alastair/received_events","type":"User","site_admin":false},"body":"This patch creates a new paginator that knows about the length of the list that it's paginating. I'm currently using it for lists of people who downloaded sounds and packs.\r\nThe result of the patch is that we no longer perform a query such as `select count(*) from sounds_download where sound_id = x`. This speeds up the page display a lot because we don't have to count the table each time we show the page.\r\nThere may be some small deviation between the actual number of rows in the table and the counts in the sound/pack objects. We need to coordinate with #560 to ensure that it's always correct.\r\n\r\nIt's more difficult to use this for \"sounds that this person downloaded\", since we don't have a field `Profile.num_sounds_downloaded`. We should keep an eye on the statistics for these `count(*)` queries to see if it makes sense to add this field. As `sounds_download` keeps on increasing, it may be a good idea to do so.","created_at":"2014-03-05T13:27:34Z","updated_at":"2014-03-05T13:27:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/MTG/freesound/pulls/577/commits","review_comments_url":"https://api.github.com/repos/MTG/freesound/pulls/577/comments","review_comment_url":"https://api.github.com/repos/MTG/freesound/pulls/comments/{number}","comments_url":"https://api.github.com/repos/MTG/freesound/issues/577/comments","statuses_url":"https://api.github.com/repos/MTG/freesound/statuses/3459adaf4d0a9aaa07f36a7ffda77e4bd864efe2","head":{"label":"MTG:pagination","ref":"pagination","sha":"3459adaf4d0a9aaa07f36a7ffda77e4bd864efe2","user":{"login":"MTG","id":2728938,"avatar_url":"https://gravatar.com/avatar/6bf6b5695c71d184b248d63200ef6701?d=https%3A%2F%2Fidenticons.github.com%2F0e7f55b28749ce467a1635f7806be5ac.png&r=x","gravatar_id":"6bf6b5695c71d184b248d63200ef6701","url":"https://api.github.com/users/MTG","html_url":"https://github.com/MTG","followers_url":"https://api.github.com/users/MTG/followers","following_url":"https://api.github.com/users/MTG/following{/other_user}","gists_url":"https://api.github.com/users/MTG/gists{/gist_id}","starred_url":"https://api.github.com/users/MTG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MTG/subscriptions","organizations_url":"https://api.github.com/users/MTG/orgs","repos_url":"https://api.github.com/users/MTG/repos","events_url":"https://api.github.com/users/MTG/events{/privacy}","received_events_url":"https://api.github.com/users/MTG/received_events","type":"Organization","site_admin":false},"repo":{"id":6583992,"name":"freesound","full_name":"MTG/freesound","owner":{"login":"MTG","id":2728938,"avatar_url":"https://gravatar.com/avatar/6bf6b5695c71d184b248d63200ef6701?d=https%3A%2F%2Fidenticons.github.com%2F0e7f55b28749ce467a1635f7806be5ac.png&r=x","gravatar_id":"6bf6b5695c71d184b248d63200ef6701","url":"https://api.github.com/users/MTG","html_url":"https://github.com/MTG","followers_url":"https://api.github.com/users/MTG/followers","following_url":"https://api.github.com/users/MTG/following{/other_user}","gists_url":"https://api.github.com/users/MTG/gists{/gist_id}","starred_url":"https://api.github.com/users/MTG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MTG/subscriptions","organizations_url":"https://api.github.com/users/MTG/orgs","repos_url":"https://api.github.com/users/MTG/repos","events_url":"https://api.github.com/users/MTG/events{/privacy}","received_events_url":"https://api.github.com/users/MTG/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MTG/freesound","description":"The freesound.org website","fork":false,"url":"https://api.github.com/repos/MTG/freesound","forks_url":"https://api.github.com/repos/MTG/freesound/forks","keys_url":"https://api.github.com/repos/MTG/freesound/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MTG/freesound/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MTG/freesound/teams","hooks_url":"https://api.github.com/repos/MTG/freesound/hooks","issue_events_url":"https://api.github.com/repos/MTG/freesound/issues/events{/number}","events_url":"https://api.github.com/repos/MTG/freesound/events","assignees_url":"https://api.github.com/repos/MTG/freesound/assignees{/user}","branches_url":"https://api.github.com/repos/MTG/freesound/branches{/branch}","tags_url":"https://api.github.com/repos/MTG/freesound/tags","blobs_url":"https://api.github.com/repos/MTG/freesound/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MTG/freesound/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MTG/freesound/git/refs{/sha}","trees_url":"https://api.github.com/repos/MTG/freesound/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MTG/freesound/statuses/{sha}","languages_url":"https://api.github.com/repos/MTG/freesound/languages","stargazers_url":"https://api.github.com/repos/MTG/freesound/stargazers","contributors_url":"https://api.github.com/repos/MTG/freesound/contributors","subscribers_url":"https://api.github.com/repos/MTG/freesound/subscribers","subscription_url":"https://api.github.com/repos/MTG/freesound/subscription","commits_url":"https://api.github.com/repos/MTG/freesound/commits{/sha}","git_commits_url":"https://api.github.com/repos/MTG/freesound/git/commits{/sha}","comments_url":"https://api.github.com/repos/MTG/freesound/comments{/number}","issue_comment_url":"https://api.github.com/repos/MTG/freesound/issues/comments/{number}","contents_url":"https://api.github.com/repos/MTG/freesound/contents/{+path}","compare_url":"https://api.github.com/repos/MTG/freesound/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MTG/freesound/merges","archive_url":"https://api.github.com/repos/MTG/freesound/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MTG/freesound/downloads","issues_url":"https://api.github.com/repos/MTG/freesound/issues{/number}","pulls_url":"https://api.github.com/repos/MTG/freesound/pulls{/number}","milestones_url":"https://api.github.com/repos/MTG/freesound/milestones{/number}","notifications_url":"https://api.github.com/repos/MTG/freesound/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MTG/freesound/labels{/name}","releases_url":"https://api.github.com/repos/MTG/freesound/releases{/id}","created_at":"2012-11-07T18:25:03Z","updated_at":"2014-03-05T13:27:34Z","pushed_at":"2014-03-05T13:26:49Z","git_url":"git://github.com/MTG/freesound.git","ssh_url":"git@github.com:MTG/freesound.git","clone_url":"https://github.com/MTG/freesound.git","svn_url":"https://github.com/MTG/freesound","homepage":"http://freesound.org","size":40485,"stargazers_count":51,"watchers_count":51,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":10,"mirror_url":null,"open_issues_count":39,"forks":10,"open_issues":39,"watchers":51,"default_branch":"master","master_branch":"master"}},"base":{"label":"MTG:master","ref":"master","sha":"749582534971a3b8a0216dc1795ac4e460473cea","user":{"login":"MTG","id":2728938,"avatar_url":"https://gravatar.com/avatar/6bf6b5695c71d184b248d63200ef6701?d=https%3A%2F%2Fidenticons.github.com%2F0e7f55b28749ce467a1635f7806be5ac.png&r=x","gravatar_id":"6bf6b5695c71d184b248d63200ef6701","url":"https://api.github.com/users/MTG","html_url":"https://github.com/MTG","followers_url":"https://api.github.com/users/MTG/followers","following_url":"https://api.github.com/users/MTG/following{/other_user}","gists_url":"https://api.github.com/users/MTG/gists{/gist_id}","starred_url":"https://api.github.com/users/MTG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MTG/subscriptions","organizations_url":"https://api.github.com/users/MTG/orgs","repos_url":"https://api.github.com/users/MTG/repos","events_url":"https://api.github.com/users/MTG/events{/privacy}","received_events_url":"https://api.github.com/users/MTG/received_events","type":"Organization","site_admin":false},"repo":{"id":6583992,"name":"freesound","full_name":"MTG/freesound","owner":{"login":"MTG","id":2728938,"avatar_url":"https://gravatar.com/avatar/6bf6b5695c71d184b248d63200ef6701?d=https%3A%2F%2Fidenticons.github.com%2F0e7f55b28749ce467a1635f7806be5ac.png&r=x","gravatar_id":"6bf6b5695c71d184b248d63200ef6701","url":"https://api.github.com/users/MTG","html_url":"https://github.com/MTG","followers_url":"https://api.github.com/users/MTG/followers","following_url":"https://api.github.com/users/MTG/following{/other_user}","gists_url":"https://api.github.com/users/MTG/gists{/gist_id}","starred_url":"https://api.github.com/users/MTG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MTG/subscriptions","organizations_url":"https://api.github.com/users/MTG/orgs","repos_url":"https://api.github.com/users/MTG/repos","events_url":"https://api.github.com/users/MTG/events{/privacy}","received_events_url":"https://api.github.com/users/MTG/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MTG/freesound","description":"The freesound.org website","fork":false,"url":"https://api.github.com/repos/MTG/freesound","forks_url":"https://api.github.com/repos/MTG/freesound/forks","keys_url":"https://api.github.com/repos/MTG/freesound/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MTG/freesound/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MTG/freesound/teams","hooks_url":"https://api.github.com/repos/MTG/freesound/hooks","issue_events_url":"https://api.github.com/repos/MTG/freesound/issues/events{/number}","events_url":"https://api.github.com/repos/MTG/freesound/events","assignees_url":"https://api.github.com/repos/MTG/freesound/assignees{/user}","branches_url":"https://api.github.com/repos/MTG/freesound/branches{/branch}","tags_url":"https://api.github.com/repos/MTG/freesound/tags","blobs_url":"https://api.github.com/repos/MTG/freesound/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MTG/freesound/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MTG/freesound/git/refs{/sha}","trees_url":"https://api.github.com/repos/MTG/freesound/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MTG/freesound/statuses/{sha}","languages_url":"https://api.github.com/repos/MTG/freesound/languages","stargazers_url":"https://api.github.com/repos/MTG/freesound/stargazers","contributors_url":"https://api.github.com/repos/MTG/freesound/contributors","subscribers_url":"https://api.github.com/repos/MTG/freesound/subscribers","subscription_url":"https://api.github.com/repos/MTG/freesound/subscription","commits_url":"https://api.github.com/repos/MTG/freesound/commits{/sha}","git_commits_url":"https://api.github.com/repos/MTG/freesound/git/commits{/sha}","comments_url":"https://api.github.com/repos/MTG/freesound/comments{/number}","issue_comment_url":"https://api.github.com/repos/MTG/freesound/issues/comments/{number}","contents_url":"https://api.github.com/repos/MTG/freesound/contents/{+path}","compare_url":"https://api.github.com/repos/MTG/freesound/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MTG/freesound/merges","archive_url":"https://api.github.com/repos/MTG/freesound/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MTG/freesound/downloads","issues_url":"https://api.github.com/repos/MTG/freesound/issues{/number}","pulls_url":"https://api.github.com/repos/MTG/freesound/pulls{/number}","milestones_url":"https://api.github.com/repos/MTG/freesound/milestones{/number}","notifications_url":"https://api.github.com/repos/MTG/freesound/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MTG/freesound/labels{/name}","releases_url":"https://api.github.com/repos/MTG/freesound/releases{/id}","created_at":"2012-11-07T18:25:03Z","updated_at":"2014-03-05T13:27:34Z","pushed_at":"2014-03-05T13:26:49Z","git_url":"git://github.com/MTG/freesound.git","ssh_url":"git@github.com:MTG/freesound.git","clone_url":"https://github.com/MTG/freesound.git","svn_url":"https://github.com/MTG/freesound","homepage":"http://freesound.org","size":40485,"stargazers_count":51,"watchers_count":51,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":10,"mirror_url":null,"open_issues_count":39,"forks":10,"open_issues":39,"watchers":51,"default_branch":"master","master_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MTG/freesound/pulls/577"},"html":{"href":"https://github.com/MTG/freesound/pull/577"},"issue":{"href":"https://api.github.com/repos/MTG/freesound/issues/577"},"comments":{"href":"https://api.github.com/repos/MTG/freesound/issues/577/comments"},"review_comments":{"href":"https://api.github.com/repos/MTG/freesound/pulls/577/comments"},"review_comment":{"href":"https://api.github.com/repos/MTG/freesound/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/MTG/freesound/pulls/577/commits"},"statuses":{"href":"https://api.github.com/repos/MTG/freesound/statuses/3459adaf4d0a9aaa07f36a7ffda77e4bd864efe2"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":14,"deletions":4,"changed_files":2}}