{"action":"opened","issue":{"url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/38027","repository_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports","labels_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/38027/labels{/name}","comments_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/38027/comments","events_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/38027/events","html_url":"https://github.com/PennyDreadfulMTG/perf-reports/issues/38027","id":361324755,"node_id":"MDU6SXNzdWUzNjEzMjQ3NTU=","number":38027,"title":"Exceeded slow_query limit (44.9 > 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-09-18T14:12:17Z","updated_at":"2018-09-18T14:12:17Z","closed_at":null,"author_association":"NONE","body":"        CREATE TABLE IF NOT EXISTS _new_card_person_stats (\n            name VARCHAR(190) NOT NULL,\n            `day` INT NOT NULL,\n            person_id INT NOT NULL,\n            wins INT NOT NULL,\n            losses INT NOT NULL,\n            draws INT NOT NULL,\n            perfect_runs INT NOT NULL,\n            tournament_wins INT NOT NULL,\n            tournament_top8s INT NOT NULL,\n            PRIMARY KEY (`day`, person_id, name)\n        ) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS\n        SELECT\n            card AS name,\n            UNIX_TIMESTAMP(DATE(FROM_UNIXTIME(d.created_date))) AS `day`,\n            d.person_id,\n            SUM(CASE WHEN d.id IS NOT NULL THEN 1 ELSE 0 END) AS num_decks,\n            IFNULL(SUM(wins), 0) AS wins,\n            IFNULL(SUM(losses), 0) AS losses,\n            IFNULL(SUM(draws), 0) 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 dsum.finish = 1 THEN 1 ELSE 0 END) AS tournament_wins,\n            SUM(CASE WHEN dsum.finish <= 8 THEN 1 ELSE 0 END) AS tournament_top8s\n        FROM\n            deck AS d\n        INNER JOIN\n            deck_card AS dc ON d.id = dc.deck_id\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        GROUP BY\n            card,\n            d.person_id,\n            `day`\n    ```\n\n```[]``` (slow_query, 44.9, mysql)\n\nReported on decksite by mysql-perf"}}
{"actor":{"display_login":"vorpal-buildbot"}}