{"action":"opened","issue":{"url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/40718","repository_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports","labels_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/40718/labels{/name}","comments_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/40718/comments","events_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/40718/events","html_url":"https://github.com/PennyDreadfulMTG/perf-reports/issues/40718","id":370865881,"node_id":"MDU6SXNzdWUzNzA4NjU4ODE=","number":40718,"title":"Exceeded slow_query limit (12.1 > 10.0) in mysql: ```","user":{"login":"vorpal-buildbot","id":23072004,"node_id":"MDQ6VXNlcjIzMDcyMDA0","avatar_url":"https://avatars2.githubusercontent.com/u/23072004?v=4","gravatar_id":"","url":"https://api.github.com/users/vorpal-buildbot","html_url":"https://github.com/vorpal-buildbot","followers_url":"https://api.github.com/users/vorpal-buildbot/followers","following_url":"https://api.github.com/users/vorpal-buildbot/following{/other_user}","gists_url":"https://api.github.com/users/vorpal-buildbot/gists{/gist_id}","starred_url":"https://api.github.com/users/vorpal-buildbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vorpal-buildbot/subscriptions","organizations_url":"https://api.github.com/users/vorpal-buildbot/orgs","repos_url":"https://api.github.com/users/vorpal-buildbot/repos","events_url":"https://api.github.com/users/vorpal-buildbot/events{/privacy}","received_events_url":"https://api.github.com/users/vorpal-buildbot/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-17T01:53:33Z","updated_at":"2018-10-17T01:53:33Z","closed_at":null,"author_association":"NONE","body":"        SELECT\n            p.id,\n            LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS name,\n            p.mtgo_username,\n            p.tappedout_username,\n            p.mtggoldfish_username,\n            p.discord_id,\n            p.elo,\n            num_decks,\n            wins,\n            losses,\n            draws,\n            perfect_runs,\n            tournament_wins,\n            tournament_top8s,\n            win_percent,\n            num_competitions\n        FROM\n            person AS p\n        LEFT JOIN\n            (\n                SELECT\n                    d.person_id,\n                    COUNT(d.id) AS num_decks,\n                    SUM(wins) AS wins,\n                    SUM(losses) AS losses,\n                    SUM(draws) AS draws,\n                    SUM(CASE WHEN wins >= 5 AND losses = 0 AND d.source_id IN (SELECT id FROM source WHERE name = 'League') THEN 1 ELSE 0 END) AS perfect_runs,\n                    SUM(CASE WHEN d.finish = 1 THEN 1 ELSE 0 END) AS tournament_wins,\n                    SUM(CASE WHEN d.finish <= 8 THEN 1 ELSE 0 END) AS tournament_top8s,\n                    IFNULL(ROUND((SUM(wins) / NULLIF(SUM(wins + losses), 0)) * 100, 1), '') AS win_percent,\n                    SUM(DISTINCT CASE WHEN d.competition_id IS NOT NULL THEN 1 ELSE 0 END) AS num_competitions\n                FROM\n                    deck AS d\n                LEFT JOIN\n                    deck_cache AS dc ON d.id = dc.deck_id\n                \n        LEFT JOIN\n            (\n                SELECT\n                    `start`.id,\n                    `start`.code,\n                    `start`.start_date AS start_date,\n                    `end`.start_date AS end_date\n                FROM\n                    season AS `start`\n                LEFT JOIN\n                    season AS `end` ON `end`.id = `start`.id + 1\n            ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)\n    \n                WHERE\n                    TRUE\n                GROUP BY\n                    d.person_id\n            ) AS stats ON p.id = stats.person_id\n        WHERE\n            p.discord_id = 169862783763087360\n        GROUP BY\n            p.id\n        ORDER BY\n            `num_decks` DESC, name\n    ```\n\n```[]``` (slow_query, 12.1, mysql)\n\nReported on decksite by mysql-perf```\n            --------------------------------------------------------------------------------\n            Request Method: GET\n            Path: /decks/26690/?\n            Cookies: {'__cfduid': 'd89960b084fa4d3f606db589890b504771538625737', 'deck_id': '26750', 'session': '.eJx9UV1rgzAU_S_3WYaaqbFv_abdYFDch44RUo0xTBNJ4tZS-t8XC10fBns85557zs3JCUjPdEclkxYmVg_MA1p1QsKkpq1xqGKd6FR1w8KUSldEOAqCOMVxmGCUxMjHCYp98OCfiSR8EG11TWpVSVvm1EzCiDhn1XiPUfLiHyZJ5EFnuSKDYVrSbhSbxvloSvZUEtMot6noYJuQGEvtKPgyHNcs24hdtnuO57viJd0-LPgUva6mJr_prfp0wZMT0LJkxlwxLLf8O18vspq_VY9Pog_TPNse1bTkdh31bp8deqGZIdR1FkQojXCaovAuTII0SW7jscXYv8e-74FmtaOa34zoEKE8QLgoXvOVWG5sN99nyCrTznAxcxmu5d495t3V6f5G1EfHXcoz8OHBxYbY4yiBGaOaaTh78Kc7SzVn7ko5tO35B22_nns.DqgnZg.fPEDwI25HUq3DMwTERRNgFF1T-o'}\n            Endpoint: deck\n            View Args: {'deck_id': '26690'}\n            Person: 169862783763087360\n            Referrer: https://pennydreadfulmagic.com/competitions/703/\n            Request Data: {}\nHost: pennydreadfulmagic.com\nAccept-Encoding: gzip\nCf-Ipcountry: AR\nX-Forwarded-For: 190.55.44.129, 198.41.226.138\nCf-Ray: 46af21895c577d69-LIM\nX-Forwarded-Proto: https\nCf-Visitor: {\"scheme\":\"https\"}\nUpgrade-Insecure-Requests: 1\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\nReferer: https://pennydreadfulmagic.com/competitions/703/\nAccept-Language: en-US,en;q=0.9,ja;q=0.8,es;q=0.7\nCookie: __cfduid=d89960b084fa4d3f606db589890b504771538625737; deck_id=26750; session=.eJx9UV1rgzAU_S_3WYaaqbFv_abdYFDch44RUo0xTBNJ4tZS-t8XC10fBns85557zs3JCUjPdEclkxYmVg_MA1p1QsKkpq1xqGKd6FR1w8KUSldEOAqCOMVxmGCUxMjHCYp98OCfiSR8EG11TWpVSVvm1EzCiDhn1XiPUfLiHyZJ5EFnuSKDYVrSbhSbxvloSvZUEtMot6noYJuQGEvtKPgyHNcs24hdtnuO57viJd0-LPgUva6mJr_prfp0wZMT0LJkxlwxLLf8O18vspq_VY9Pog_TPNse1bTkdh31bp8deqGZIdR1FkQojXCaovAuTII0SW7jscXYv8e-74FmtaOa34zoEKE8QLgoXvOVWG5sN99nyCrTznAxcxmu5d495t3V6f5G1EfHXcoz8OHBxYbY4yiBGaOaaTh78Kc7SzVn7ko5tO35B22_nns.DqgnZg.fPEDwI25HUq3DMwTERRNgFF1T-o\nCf-Connecting-Ip: 190.55.44.129\nX-Forwarded-Host: pennydreadfulmagic.com\nX-Forwarded-Server: pennydreadfulmagic.com\nConnection: Keep-Alive\n```\n"}}
{"actor":{"display_login":"vorpal-buildbot"}}