{"action":"opened","issue":{"url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/30963","repository_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports","labels_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/30963/labels{/name}","comments_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/30963/comments","events_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/30963/events","html_url":"https://github.com/PennyDreadfulMTG/perf-reports/issues/30963","id":344231761,"node_id":"MDU6SXNzdWUzNDQyMzE3NjE=","number":30963,"title":"Exceeded slow_query limit (13.3 > 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-07-24T22:52:58Z","updated_at":"2018-07-24T22:52:58Z","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.3, mysql)\n\nReported on decksite by mysql-perf```\n            --------------------------------------------------------------------------------\n            Request Method: GET\n            Path: /decks/18927/?\n            Cookies: {'__cfduid': 'd3f0965ce54775ab5a9e992d14d27fe7a1528390746', '_ga': 'GA1.2.585258135.1528390749', '_gid': 'GA1.2.833769965.1530231429', 'deck_id': '19503', '_gat_gtag_UA_109131120_1': '1', 'session': '.eJx1UMtOwzAQ_BefI-QmxEl6o_QFLVFVUQRCKHLjjesmsVPbQTRV_x2nEvSAOO7O7MzOnFDWgK6pBGnR0OoWPMSEyZVmmWBoiAJMSIRDEgY4iKIk8GPkof-RSuW0AoeCvEycA-sdjJIXPR-TgYdqy1XWGtCS1j25FJKzloE7UbS1Oz8zltoemcMDWWNxWJRrweNk3VnWQLedKpDpfnPlW1U6x-EJ0TwHY35mtFCzZUtxHBXxzJhVfaCTTs3Ho_F03y2Iu4evRmgwGXXxB6Gf-GEUReFNQEgSDYIrLpwawbcxxh7SULjV7tekeknvn5-qdJNPulWRPr5tj7xMl3eva1vST2fi-mxcmndXnOtZFEe3462omEEfHrrIZPbYU9AIqAaNzh7605qlmoN7U7ZVdf4GVz-New.Djk_KA.-a2pvjVAQ6Z0BxTjbH105Rzwofo'}\n            Endpoint: deck\n            View Args: {'deck_id': '18927'}\n            Person: 306670565303779328\n            Referrer: https://pennydreadfulmagic.com/cards/Vizier%20of%20Remedies/\n            Request Data: {}\nHost: pennydreadfulmagic.com\nAccept-Encoding: gzip\nCf-Ipcountry: US\nX-Forwarded-For: 70.173.164.149, 162.158.246.48\nCf-Ray: 43f9f5441e3c5f87-LAS\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/67.0.3396.99 Safari/537.36\nDnt: 1\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\nReferer: https://pennydreadfulmagic.com/cards/Vizier%20of%20Remedies/\nAccept-Language: en-US,en;q=0.9\nCookie: __cfduid=d3f0965ce54775ab5a9e992d14d27fe7a1528390746; _ga=GA1.2.585258135.1528390749; _gid=GA1.2.833769965.1530231429; deck_id=19503; _gat_gtag_UA_109131120_1=1; session=.eJx1UMtOwzAQ_BefI-QmxEl6o_QFLVFVUQRCKHLjjesmsVPbQTRV_x2nEvSAOO7O7MzOnFDWgK6pBGnR0OoWPMSEyZVmmWBoiAJMSIRDEgY4iKIk8GPkof-RSuW0AoeCvEycA-sdjJIXPR-TgYdqy1XWGtCS1j25FJKzloE7UbS1Oz8zltoemcMDWWNxWJRrweNk3VnWQLedKpDpfnPlW1U6x-EJ0TwHY35mtFCzZUtxHBXxzJhVfaCTTs3Ho_F03y2Iu4evRmgwGXXxB6Gf-GEUReFNQEgSDYIrLpwawbcxxh7SULjV7tekeknvn5-qdJNPulWRPr5tj7xMl3eva1vST2fi-mxcmndXnOtZFEe3462omEEfHrrIZPbYU9AIqAaNzh7605qlmoN7U7ZVdf4GVz-New.Djk_KA.-a2pvjVAQ6Z0BxTjbH105Rzwofo\nCf-Connecting-Ip: 70.173.164.149\nX-Forwarded-Host: pennydreadfulmagic.com\nX-Forwarded-Server: pennydreadfulmagic.com\nConnection: Keep-Alive\n```\n"}}
{"actor":{"display_login":"vorpal-buildbot"}}