{"action":"opened","issue":{"url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/33250","repository_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports","labels_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/33250/labels{/name}","comments_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/33250/comments","events_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/33250/events","html_url":"https://github.com/PennyDreadfulMTG/perf-reports/issues/33250","id":352556915,"node_id":"MDU6SXNzdWUzNTI1NTY5MTU=","number":33250,"title":"Exceeded slow_query limit (13.5 > 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-08-21T14:08:04Z","updated_at":"2018-08-21T14:08:04Z","closed_at":null,"author_association":"NONE","body":"        SELECT\n            a.id,\n            a.name,\n            aca.ancestor AS parent_id,\n            \n        SUM(CASE WHEN TRUE AND d.id IS NOT NULL THEN 1 ELSE 0 END) AS `all_num_decks`,\n        SUM(CASE WHEN TRUE THEN wins ELSE 0 END) AS `all_wins`,\n        SUM(CASE WHEN TRUE THEN losses ELSE 0 END) AS `all_losses`,\n        SUM(CASE WHEN TRUE THEN draws ELSE 0 END) AS `all_draws`,\n        SUM(CASE WHEN TRUE AND wins >= 5 AND losses = 0 AND d.source_id IN (SELECT id FROM source WHERE name = 'League') THEN 1 ELSE 0 END) AS all_perfect_runs,\n        SUM(CASE WHEN TRUE AND dsum.finish = 1 THEN 1 ELSE 0 END) AS `all_tournament_wins`,\n        SUM(CASE WHEN TRUE AND dsum.finish <= 8 THEN 1 ELSE 0 END) AS `all_tournament_top8s`,\n        IFNULL(ROUND((SUM(CASE WHEN TRUE THEN wins ELSE 0 END) / NULLIF(SUM(CASE WHEN TRUE THEN wins + losses ELSE 0 END), 0)) * 100, 1), '') AS `all_win_percent`\n    \n        FROM\n            archetype AS a\n        LEFT JOIN\n            archetype_closure AS aca ON a.id = aca.descendant AND aca.depth = 1\n        LEFT JOIN\n            archetype_closure AS acd ON a.id = acd.ancestor\n        LEFT JOIN\n            deck AS d ON acd.descendant = d.archetype_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        \n        LEFT JOIN\n            (\n                SELECT\n                    d.id,\n                    d.created_date,\n                    d.finish,\n                    SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, -- IFNULL so we still count byes as wins.\n                    SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses,\n                    SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws\n                FROM\n                    deck_match AS dm\n                INNER JOIN\n                    deck_match AS odm ON dm.match_id = odm.match_id AND dm.deck_id <> odm.deck_id\n                INNER JOIN\n                    deck AS d ON d.id = dm.deck_id\n                GROUP BY\n                    d.id\n            ) AS dsum ON d.id = dsum.id\n    \n        WHERE (1 = 1) AND (TRUE)\n        GROUP BY\n            a.id,\n            aca.ancestor -- aca.ancestor will be unique per a.id because of integrity constraints enforced elsewhere (each archetype has one ancestor) but we let the database know here.\n        ORDER BY\n            a.name\n    ```\n\n```[]``` (slow_query, 13.5, mysql)\n\nReported on decksite by mysql-perf```\n            --------------------------------------------------------------------------------\n            Request Method: GET\n            Path: /decks/14760/?\n            Cookies: {}\n            Endpoint: deck\n            View Args: {'deck_id': '14760'}\n            Person: logged_out\n            Referrer: None\n            Request Data: {}\nHost: pennydreadfulmagic.com\nAccept-Encoding: gzip\nCf-Ipcountry: RU\nX-Forwarded-For: 141.8.142.136, 162.158.238.78\nCf-Ray: 44ddaaee7a755b45-HEL\nX-Forwarded-Proto: https\nCf-Visitor: {\"scheme\":\"https\"}\nUser-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 8_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B411 Safari/600.1.4 (compatible; YandexMobileBot/3.0; +http://yandex.com/bots)\nFrom: support@search.yandex.ru\nAccept: */*\nAccept-Language: en, *;q=0.01\nCf-Connecting-Ip: 141.8.142.136\nX-Forwarded-Host: pennydreadfulmagic.com\nX-Forwarded-Server: pennydreadfulmagic.com\nConnection: Keep-Alive\n```\n"}}
{"actor":{"display_login":"vorpal-buildbot"}}