{"action":"created","issue":{"url":"https://api.github.com/repos/edx/edx-platform/issues/19070","repository_url":"https://api.github.com/repos/edx/edx-platform","labels_url":"https://api.github.com/repos/edx/edx-platform/issues/19070/labels{/name}","comments_url":"https://api.github.com/repos/edx/edx-platform/issues/19070/comments","events_url":"https://api.github.com/repos/edx/edx-platform/issues/19070/events","html_url":"https://github.com/edx/edx-platform/pull/19070","id":367273442,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIwNzUwNTE2","number":19070,"title":"Bundle a SQL query for performance","user":{"login":"mikix","id":1196901,"node_id":"MDQ6VXNlcjExOTY5MDE=","avatar_url":"https://avatars2.githubusercontent.com/u/1196901?v=4","gravatar_id":"","url":"https://api.github.com/users/mikix","html_url":"https://github.com/mikix","followers_url":"https://api.github.com/users/mikix/followers","following_url":"https://api.github.com/users/mikix/following{/other_user}","gists_url":"https://api.github.com/users/mikix/gists{/gist_id}","starred_url":"https://api.github.com/users/mikix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikix/subscriptions","organizations_url":"https://api.github.com/users/mikix/orgs","repos_url":"https://api.github.com/users/mikix/repos","events_url":"https://api.github.com/users/mikix/events{/privacy}","received_events_url":"https://api.github.com/users/mikix/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-10-05T16:01:18Z","updated_at":"2018-10-09T15:01:12Z","closed_at":"2018-10-05T16:43:48Z","author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/19070","html_url":"https://github.com/edx/edx-platform/pull/19070","diff_url":"https://github.com/edx/edx-platform/pull/19070.diff","patch_url":"https://github.com/edx/edx-platform/pull/19070.patch"},"body":"We were doing many individual SQL queries for certificates when awarding program certs. It's possible this was contributing to high SQL load. Instead, let's bundle those queries up into a larger one.\r\n\r\nNow, I'm sorta guessing at the root problem (too many quick queries still incurs enough overhead to be a problem) and that the solution will fix it (not sure how to realistically test that this will incur less load on prod?). But it seems like a reasonable change, eh?\r\n\r\nThis new query will technically pick up more than it needs (all certs for the user, vs only certs for the user that are in a program). But it seemed like more work than would be worth it to first gather a set of course_ids and then do a giant course_id__in= call (and possibly slower to have the db check it?). Plus, the old way would have asked about the same course multiple times if it were in multiple programs... I dunno. This way _feels_ better, so I wanna try it and see.\r\n\r\nhttps://openedx.atlassian.net/browse/LEARNER-6490"},"comment":{"url":"https://api.github.com/repos/edx/edx-platform/issues/comments/428227519","html_url":"https://github.com/edx/edx-platform/pull/19070#issuecomment-428227519","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/19070","id":428227519,"node_id":"MDEyOklzc3VlQ29tbWVudDQyODIyNzUxOQ==","user":{"login":"edx-pipeline-bot","id":24274798,"node_id":"MDQ6VXNlcjI0Mjc0Nzk4","avatar_url":"https://avatars0.githubusercontent.com/u/24274798?v=4","gravatar_id":"","url":"https://api.github.com/users/edx-pipeline-bot","html_url":"https://github.com/edx-pipeline-bot","followers_url":"https://api.github.com/users/edx-pipeline-bot/followers","following_url":"https://api.github.com/users/edx-pipeline-bot/following{/other_user}","gists_url":"https://api.github.com/users/edx-pipeline-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/edx-pipeline-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx-pipeline-bot/subscriptions","organizations_url":"https://api.github.com/users/edx-pipeline-bot/orgs","repos_url":"https://api.github.com/users/edx-pipeline-bot/repos","events_url":"https://api.github.com/users/edx-pipeline-bot/events{/privacy}","received_events_url":"https://api.github.com/users/edx-pipeline-bot/received_events","type":"User","site_admin":false},"created_at":"2018-10-09T15:01:12Z","updated_at":"2018-10-09T15:01:12Z","author_association":"CONTRIBUTOR","body":"**EdX Release Notice**:  This PR has been deployed to the production environment. "}}
{"actor":{"display_login":"edx-pipeline-bot"}}