{"action":"opened","issue":{"url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/42007","repository_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports","labels_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/42007/labels{/name}","comments_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/42007/comments","events_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/42007/events","html_url":"https://github.com/PennyDreadfulMTG/perf-reports/issues/42007","id":377118648,"node_id":"MDU6SXNzdWUzNzcxMTg2NDg=","number":42007,"title":"Exceeded slow_query limit (7.1 > 5.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-11-04T04:00:29Z","updated_at":"2018-11-04T04:00:29Z","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                    season.id = 7\n                GROUP BY\n                    d.person_id\n            ) AS stats ON p.id = stats.person_id\n        WHERE\n            p.id = 1702\n        GROUP BY\n            p.id\n        ORDER BY\n            `num_decks` DESC, name\n    ```\n\n```[]``` (slow_query, 7.1, mysql)\n\nReported on decksite by mysql-perf```\n            --------------------------------------------------------------------------------\n            Request Method: GET\n            Path: /seasons/7/people/1702/?locale=fr\n            Cookies: {}\n            Endpoint: seasons.person\n            View Args: {'person_id': '1702'}\n            Person: logged_out\n            Referrer: None\n            Request Data: {}\nHost: pennydreadfulmagic.com\nAccept-Encoding: gzip\nCf-Ipcountry: US\nX-Forwarded-For: 207.46.13.15, 108.162.246.157\nCf-Ray: 47442c5a8a61bb30-SEA\nX-Forwarded-Proto: https\nCf-Visitor: {\"scheme\":\"https\"}\nCache-Control: no-cache\nPragma: no-cache\nAccept: */*\nFrom: bingbot(at)microsoft.com\nUser-Agent: Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)\nCf-Connecting-Ip: 207.46.13.15\nX-Forwarded-Host: pennydreadfulmagic.com\nX-Forwarded-Server: pennydreadfulmagic.com\nConnection: Keep-Alive\n```\n"}}
{"actor":{"display_login":"vorpal-buildbot"}}