PennyDreadfulMTG / perf-reports

2 stars 2 forks source link

Exceeded slow_query limit (0.7 > 0.5) in mysql: ``` #61151

Open vorpal-buildbot opened 1 year ago

vorpal-buildbot commented 1 year ago
    SELECT
        p.id,
        LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS name,
        p.mtgo_username,
        p.tappedout_username,
        p.mtggoldfish_username,
        p.discord_id,
        p.elo,
        p.locale,
        p.banned,
        SUM(1) AS num_decks,
        SUM(dc.wins) AS wins,
        SUM(dc.losses) AS losses,
        SUM(dc.draws) AS draws,
        SUM(dc.wins - dc.losses) AS record,
        SUM(CASE WHEN dc.wins >= 5 AND dc.losses = 0 AND d.source_id IN (SELECT id FROM source WHERE name = 'League') THEN 1 ELSE 0 END) AS perfect_runs,
        SUM(CASE WHEN d.finish = 1 THEN 1 ELSE 0 END) AS tournament_wins,
        SUM(CASE WHEN d.finish <= 8 THEN 1 ELSE 0 END) AS tournament_top8s,
        IFNULL(ROUND((SUM(dc.wins) / NULLIF(SUM(dc.wins + dc.losses), 0)) * 100, 1), '') AS win_percent,
        SUM(DISTINCT CASE WHEN d.competition_id IS NOT NULL THEN 1 ELSE 0 END) AS num_competitions
    FROM
        person AS p
    LEFT JOIN
        deck AS d ON d.person_id = p.id
    LEFT JOIN
        deck_cache AS dc ON d.id = dc.deck_id

    WHERE
        (TRUE) AND (TRUE)
    GROUP BY
        p.id
    ORDER BY
        num_decks DESC, num_decks DESC, record, name
    LIMIT 0, 20
```

[] (slow_query, 0.7, mysql)

Reported on decksite by mysql-perf

Location Hash: e9f64b3bcb566ad5cecc53e07c76bf47b7122bf1

Request Data ``` Request Method: GET Path: /api/people/?deckType=all&page=0&pageSize=20&q=&seasonId=0 Cookies: ImmutableMultiDict([('hide_intro', 'True'), ('page_size', '20'), ('session', '.eJx1UVFvgjAY_C99ZoYiVPHNmeh0RjMdzmxZSIUPqEBL2uLmjP99hUVdluyt991d7-v1hMIKZEk5cI0GWtZgIRqXjF9ADCUrRXyFTEVCxiEzE4R9j7iuj3t2H7uu7RAP3RSFiGgBRgX8Llgb4n8L42Fas-Ia8suKGpSmEDdrKsHbYOx2LVTqVIS1Aslp2Wh3NAepfd84BK115oRKU90wy6dsOx0eJrN5vl8Eo9Uwg49sVKvdJmV6ftNrkZvAwQnRKAKlLhhNvxI7yqTzGsjAe3E263Fve8gevAInc_ls_PBZMQkqpKZCTHo-8buEOB1sTg6-0U2pxHb7tm0hCYkZZdcMm1SRG894PJG5GO9klWESL_ePKztYrI4mw5Ramce8obYp1fZp_owlDfkz6-yFiXi3UHtpqI-NAd0DlSDR2UJ_G9RUpmBW5nVRnL8Bj0-oYA.ZF2VkQ.PVNyIpxDj5xaHb0c2oZ_Xh2EmGA'), ('session', '.eJx1UVFvgjAY_C99ZoYiVPHNmeh0RjMdzmxZSIUPqEBL2uLmjP99hUVdluyt991d7-v1hMIKZEk5cI0GWtZgIRqXjF9ADCUrRXyFTEVCxiEzE4R9j7iuj3t2H7uu7RAP3RSFiGgBRgX8Llgb4n8L42Fas-Ia8suKGpSmEDdrKsHbYOx2LVTqVIS1Aslp2Wh3NAepfd84BK115oRKU90wy6dsOx0eJrN5vl8Eo9Uwg49sVKvdJmV6ftNrkZvAwQnRKAKlLhhNvxI7yqTzGsjAe3E263Fve8gevAInc_ls_PBZMQkqpKZCTHo-8buEOB1sTg6-0U2pxHb7tm0hCYkZZdcMm1SRG894PJG5GO9klWESL_ePKztYrI4mw5Ramce8obYp1fZp_owlDfkz6-yFiXi3UHtpqI-NAd0DlSDR2UJ_G9RUpmBW5nVRnL8Bj0-oYA.ZGMjrA.F0quHQFvHmzTasIWIY2hC_iCZ9U'), ('deck_id', '216038'), ('views', '10155')]) Endpoint: people_api View Args: {} Person: 195644917081440265 Referrer: https://pennydreadfulmagic.com/seasons/all/people/ Request Data: {} Host: pennydreadfulmagic.com Connection: Keep-Alive Accept-Encoding: gzip X-Forwarded-For: 136.25.106.188 Cf-Ray: 7c819696e88f6456-SJC X-Forwarded-Proto: https Cf-Visitor: {"scheme":"https"} Sec-Ch-Ua: "Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24" Accept: application/json, text/plain, */* Sec-Ch-Ua-Mobile: ?0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Sec-Ch-Ua-Platform: "macOS" Sec-Fetch-Site: same-origin Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Referer: https://pennydreadfulmagic.com/seasons/all/people/ Accept-Language: en-US,en;q=0.9,es;q=0.8 Cookie: hide_intro=True; page_size=20; session=.eJx1UVFvgjAY_C99ZoYiVPHNmeh0RjMdzmxZSIUPqEBL2uLmjP99hUVdluyt991d7-v1hMIKZEk5cI0GWtZgIRqXjF9ADCUrRXyFTEVCxiEzE4R9j7iuj3t2H7uu7RAP3RSFiGgBRgX8Llgb4n8L42Fas-Ia8suKGpSmEDdrKsHbYOx2LVTqVIS1Aslp2Wh3NAepfd84BK115oRKU90wy6dsOx0eJrN5vl8Eo9Uwg49sVKvdJmV6ftNrkZvAwQnRKAKlLhhNvxI7yqTzGsjAe3E263Fve8gevAInc_ls_PBZMQkqpKZCTHo-8buEOB1sTg6-0U2pxHb7tm0hCYkZZdcMm1SRG894PJG5GO9klWESL_ePKztYrI4mw5Ramce8obYp1fZp_owlDfkz6-yFiXi3UHtpqI-NAd0DlSDR2UJ_G9RUpmBW5nVRnL8Bj0-oYA.ZF2VkQ.PVNyIpxDj5xaHb0c2oZ_Xh2EmGA; deck_id=216038; session=.eJx1UVFvgjAY_C99ZoYiVPHNmeh0RjMdzmxZSIUPqEBL2uLmjP99hUVdluyt991d7-v1hMIKZEk5cI0GWtZgIRqXjF9ADCUrRXyFTEVCxiEzE4R9j7iuj3t2H7uu7RAP3RSFiGgBRgX8Llgb4n8L42Fas-Ia8suKGpSmEDdrKsHbYOx2LVTqVIS1Aslp2Wh3NAepfd84BK115oRKU90wy6dsOx0eJrN5vl8Eo9Uwg49sVKvdJmV6ftNrkZvAwQnRKAKlLhhNvxI7yqTzGsjAe3E263Fve8gevAInc_ls_PBZMQkqpKZCTHo-8buEOB1sTg6-0U2pxHb7tm0hCYkZZdcMm1SRG894PJG5GO9klWESL_ePKztYrI4mw5Ramce8obYp1fZp_owlDfkz6-yFiXi3UHtpqI-NAd0DlSDR2UJ_G9RUpmBW5nVRnL8Bj0-oYA.ZGMjrA.F0quHQFvHmzTasIWIY2hC_iCZ9U; views=10155 Priority: u=1, i Cf-Connecting-Ip: 136.25.106.188 Cf-Ipcountry: US Cdn-Loop: cloudflare ```
vorpal-buildbot commented 1 year ago

Exceeded slow_query limit (0.7 > 0.5) in mysql: ```

    SELECT
        p.id,
        LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS name,
        p.mtgo_username,
        p.tappedout_username,
        p.mtggoldfish_username,
        p.discord_id,
        p.elo,
        p.locale,
        p.banned,
        SUM(1) AS num_decks,
        SUM(dc.wins) AS wins,
        SUM(dc.losses) AS losses,
        SUM(dc.draws) AS draws,
        SUM(dc.wins - dc.losses) AS record,
        SUM(CASE WHEN dc.wins >= 5 AND dc.losses = 0 AND d.source_id IN (SELECT id FROM source WHERE name = 'League') THEN 1 ELSE 0 END) AS perfect_runs,
        SUM(CASE WHEN d.finish = 1 THEN 1 ELSE 0 END) AS tournament_wins,
        SUM(CASE WHEN d.finish <= 8 THEN 1 ELSE 0 END) AS tournament_top8s,
        IFNULL(ROUND((SUM(dc.wins) / NULLIF(SUM(dc.wins + dc.losses), 0)) * 100, 1), '') AS win_percent,
        SUM(DISTINCT CASE WHEN d.competition_id IS NOT NULL THEN 1 ELSE 0 END) AS num_competitions
    FROM
        person AS p
    LEFT JOIN
        deck AS d ON d.person_id = p.id
    LEFT JOIN
        deck_cache AS dc ON d.id = dc.deck_id

    WHERE
        (TRUE) AND (TRUE)
    GROUP BY
        p.id
    ORDER BY
        num_decks DESC, num_decks DESC, record, name
    LIMIT 0, 20
```

[] (slow_query, 0.7, mysql)

Reported on decksite by mysql-perf

Location Hash: e9f64b3bcb566ad5cecc53e07c76bf47b7122bf1

Request Data ``` Request Method: GET Path: /api/people/?deckType=all&page=0&pageSize=20&q=&seasonId=0 Cookies: ImmutableMultiDict([('hide_intro', 'True'), ('hide_intro', 'True'), ('session', '.eJx1kdtOwzAMht8l12VK2_W0OxjbQBpMaIJxEKqy1u2ypklJUsZAe3fcodELxF3s3_5tf_kiaQO6ZhKkJSOrW3AIy2suyahgwmCUQ81rlfcxN5nSecoxRaKIRkHs0SBxk2Ho-nFI-gqhMiYAq0Ce3S9R-L-Fy7RsuchPKwhVlpB3qxklj6PiKA4dUttSpa0BLVndOdsN7JjNNjsmc9BopFhrN15qLLOd_knXvt1mYfCxHL5f2mJxvXDnyXQlaj6v1n29VRXgyV-EZRkYc4pJs-Luu_QszCCY0NKb7Lzbp0Kp8ey5eJhiP3w0XINJGdJzwyhyaUj9ZOB7AY2SXu54hnQYU-oQDQWmNr8zqnHYTN6qi5vn2-jtTov9chFfVdn82pxL-ogzkGaDx7yQIyIz2Cq062jin_Fij88fgbw65Gia2n3XQC6AaaRycMgfkJbpEnBn2Qpx-AYhLqe9.ZF68DA.erVB9hvTG0xHzq7Ka8gnHCmHQAs'), ('session', '.eJx1kdtOwzAMht8l12VK2_W0OxjbQBpMaIJxEKqy1u2ypklJUsZAe3fcodELxF3s3_5tf_kiaQO6ZhKkJSOrW3AIy2suyahgwmCUQ81rlfcxN5nSecoxRaKIRkHs0SBxk2Ho-nFI-gqhMiYAq0Ce3S9R-L-Fy7RsuchPKwhVlpB3qxklj6PiKA4dUttSpa0BLVndOdsN7JjNNjsmc9BopFhrN15qLLOd_knXvt1mYfCxHL5f2mJxvXDnyXQlaj6v1n29VRXgyV-EZRkYc4pJs-Luu_QszCCY0NKb7Lzbp0Kp8ey5eJhiP3w0XINJGdJzwyhyaUj9ZOB7AY2SXu54hnQYU-oQDQWmNr8zqnHYTN6qi5vn2-jtTov9chFfVdn82pxL-ogzkGaDx7yQIyIz2Cq062jin_Fij88fgbw65Gia2n3XQC6AaaRycMgfkJbpEnBn2Qpx-AYhLqe9.ZGjrDg.pMNZGTfAbSKHVdf2EBQoqAYpfeE'), ('page_size', '20'), ('views', '51')]) Endpoint: people_api View Args: {} Person: 770758205919461386 Referrer: https://pennydreadfulmagic.com/seasons/all/people/ Request Data: {} Host: pennydreadfulmagic.com Connection: Keep-Alive Accept-Encoding: gzip X-Forwarded-For: 47.26.243.253 Cf-Ray: 7ca5b4bc3a3d8cb1-EWR X-Forwarded-Proto: https Cf-Visitor: {"scheme":"https"} Sec-Ch-Ua: "Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24" Accept: application/json, text/plain, */* Dnt: 1 Sec-Ch-Ua-Mobile: ?0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Sec-Ch-Ua-Platform: "Windows" Sec-Fetch-Site: same-origin Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Referer: https://pennydreadfulmagic.com/seasons/all/people/ Accept-Language: en-US,en;q=0.9 Cookie: hide_intro=True; hide_intro=True; session=.eJx1kdtOwzAMht8l12VK2_W0OxjbQBpMaIJxEKqy1u2ypklJUsZAe3fcodELxF3s3_5tf_kiaQO6ZhKkJSOrW3AIy2suyahgwmCUQ81rlfcxN5nSecoxRaKIRkHs0SBxk2Ho-nFI-gqhMiYAq0Ce3S9R-L-Fy7RsuchPKwhVlpB3qxklj6PiKA4dUttSpa0BLVndOdsN7JjNNjsmc9BopFhrN15qLLOd_knXvt1mYfCxHL5f2mJxvXDnyXQlaj6v1n29VRXgyV-EZRkYc4pJs-Luu_QszCCY0NKb7Lzbp0Kp8ey5eJhiP3w0XINJGdJzwyhyaUj9ZOB7AY2SXu54hnQYU-oQDQWmNr8zqnHYTN6qi5vn2-jtTov9chFfVdn82pxL-ogzkGaDx7yQIyIz2Cq062jin_Fij88fgbw65Gia2n3XQC6AaaRycMgfkJbpEnBn2Qpx-AYhLqe9.ZF68DA.erVB9hvTG0xHzq7Ka8gnHCmHQAs; page_size=20; session=.eJx1kdtOwzAMht8l12VK2_W0OxjbQBpMaIJxEKqy1u2ypklJUsZAe3fcodELxF3s3_5tf_kiaQO6ZhKkJSOrW3AIy2suyahgwmCUQ81rlfcxN5nSecoxRaKIRkHs0SBxk2Ho-nFI-gqhMiYAq0Ce3S9R-L-Fy7RsuchPKwhVlpB3qxklj6PiKA4dUttSpa0BLVndOdsN7JjNNjsmc9BopFhrN15qLLOd_knXvt1mYfCxHL5f2mJxvXDnyXQlaj6v1n29VRXgyV-EZRkYc4pJs-Luu_QszCCY0NKb7Lzbp0Kp8ey5eJhiP3w0XINJGdJzwyhyaUj9ZOB7AY2SXu54hnQYU-oQDQWmNr8zqnHYTN6qi5vn2-jtTov9chFfVdn82pxL-ogzkGaDx7yQIyIz2Cq062jin_Fij88fgbw65Gia2n3XQC6AaaRycMgfkJbpEnBn2Qpx-AYhLqe9.ZGjrDg.pMNZGTfAbSKHVdf2EBQoqAYpfeE; views=51 Priority: u=1, i Cf-Connecting-Ip: 47.26.243.253 Cf-Ipcountry: US Cdn-Loop: cloudflare ```

Labels: decksite

vorpal-buildbot commented 1 year ago

Exceeded slow_query limit (0.7 > 0.5) in mysql: ```

    SELECT
        p.id,
        LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS name,
        p.mtgo_username,
        p.tappedout_username,
        p.mtggoldfish_username,
        p.discord_id,
        p.elo,
        p.locale,
        p.banned,
        SUM(1) AS num_decks,
        SUM(dc.wins) AS wins,
        SUM(dc.losses) AS losses,
        SUM(dc.draws) AS draws,
        SUM(dc.wins - dc.losses) AS record,
        SUM(CASE WHEN dc.wins >= 5 AND dc.losses = 0 AND d.source_id IN (SELECT id FROM source WHERE name = 'League') THEN 1 ELSE 0 END) AS perfect_runs,
        SUM(CASE WHEN d.finish = 1 THEN 1 ELSE 0 END) AS tournament_wins,
        SUM(CASE WHEN d.finish <= 8 THEN 1 ELSE 0 END) AS tournament_top8s,
        IFNULL(ROUND((SUM(dc.wins) / NULLIF(SUM(dc.wins + dc.losses), 0)) * 100, 1), '') AS win_percent,
        SUM(DISTINCT CASE WHEN d.competition_id IS NOT NULL THEN 1 ELSE 0 END) AS num_competitions
    FROM
        person AS p
    LEFT JOIN
        deck AS d ON d.person_id = p.id
    LEFT JOIN
        deck_cache AS dc ON d.id = dc.deck_id

    WHERE
        (TRUE) AND (TRUE)
    GROUP BY
        p.id
    ORDER BY
        num_decks DESC, num_decks DESC, record, name
    LIMIT 0, 20
```

[] (slow_query, 0.7, mysql)

Reported on decksite by mysql-perf

Location Hash: e9f64b3bcb566ad5cecc53e07c76bf47b7122bf1

Request Data ``` Request Method: GET Path: /api/people/?deckType=all&page=0&pageSize=20&q=&seasonId=0 Cookies: ImmutableMultiDict([('hide_intro', 'True'), ('hide_intro', 'True'), ('session', '.eJx1kdtOwzAMht8l12VK2_W0OxjbQBpMaIJxEKqy1u2ypklJUsZAe3fcodELxF3s3_5tf_kiaQO6ZhKkJSOrW3AIy2suyahgwmCUQ81rlfcxN5nSecoxRaKIRkHs0SBxk2Ho-nFI-gqhMiYAq0Ce3S9R-L-Fy7RsuchPKwhVlpB3qxklj6PiKA4dUttSpa0BLVndOdsN7JjNNjsmc9BopFhrN15qLLOd_knXvt1mYfCxHL5f2mJxvXDnyXQlaj6v1n29VRXgyV-EZRkYc4pJs-Luu_QszCCY0NKb7Lzbp0Kp8ey5eJhiP3w0XINJGdJzwyhyaUj9ZOB7AY2SXu54hnQYU-oQDQWmNr8zqnHYTN6qi5vn2-jtTov9chFfVdn82pxL-ogzkGaDx7yQIyIz2Cq062jin_Fij88fgbw65Gia2n3XQC6AaaRycMgfkJbpEnBn2Qpx-AYhLqe9.ZF68DA.erVB9hvTG0xHzq7Ka8gnHCmHQAs'), ('session', '.eJx1kdtOwzAMht8l12VK2_W0OxjbQBpMaIJxEKqy1u2ypklJUsZAe3fcodELxF3s3_5tf_kiaQO6ZhKkJSOrW3AIy2suyahgwmCUQ81rlfcxN5nSecoxRaKIRkHs0SBxk2Ho-nFI-gqhMiYAq0Ce3S9R-L-Fy7RsuchPKwhVlpB3qxklj6PiKA4dUttSpa0BLVndOdsN7JjNNjsmc9BopFhrN15qLLOd_knXvt1mYfCxHL5f2mJxvXDnyXQlaj6v1n29VRXgyV-EZRkYc4pJs-Luu_QszCCY0NKb7Lzbp0Kp8ey5eJhiP3w0XINJGdJzwyhyaUj9ZOB7AY2SXu54hnQYU-oQDQWmNr8zqnHYTN6qi5vn2-jtTov9chFfVdn82pxL-ogzkGaDx7yQIyIz2Cq062jin_Fij88fgbw65Gia2n3XQC6AaaRycMgfkJbpEnBn2Qpx-AYhLqe9.ZGqQJw.Q5sJcECdKolTnLO4fwrFJUI7jIo'), ('page_size', '20'), ('views', '190')]) Endpoint: people_api View Args: {} Person: 770758205919461386 Referrer: https://pennydreadfulmagic.com/seasons/all/people/ Request Data: {} Host: pennydreadfulmagic.com Connection: Keep-Alive Accept-Encoding: gzip X-Forwarded-For: 47.26.243.253 Cf-Ray: 7caffc945bc761bc-ORD X-Forwarded-Proto: https Cf-Visitor: {"scheme":"https"} Sec-Ch-Ua: "Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24" Accept: application/json, text/plain, */* Dnt: 1 Sec-Ch-Ua-Mobile: ?0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Sec-Ch-Ua-Platform: "Windows" Sec-Fetch-Site: same-origin Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Referer: https://pennydreadfulmagic.com/seasons/all/people/ Accept-Language: en-US,en;q=0.9 Cookie: hide_intro=True; hide_intro=True; session=.eJx1kdtOwzAMht8l12VK2_W0OxjbQBpMaIJxEKqy1u2ypklJUsZAe3fcodELxF3s3_5tf_kiaQO6ZhKkJSOrW3AIy2suyahgwmCUQ81rlfcxN5nSecoxRaKIRkHs0SBxk2Ho-nFI-gqhMiYAq0Ce3S9R-L-Fy7RsuchPKwhVlpB3qxklj6PiKA4dUttSpa0BLVndOdsN7JjNNjsmc9BopFhrN15qLLOd_knXvt1mYfCxHL5f2mJxvXDnyXQlaj6v1n29VRXgyV-EZRkYc4pJs-Luu_QszCCY0NKb7Lzbp0Kp8ey5eJhiP3w0XINJGdJzwyhyaUj9ZOB7AY2SXu54hnQYU-oQDQWmNr8zqnHYTN6qi5vn2-jtTov9chFfVdn82pxL-ogzkGaDx7yQIyIz2Cq062jin_Fij88fgbw65Gia2n3XQC6AaaRycMgfkJbpEnBn2Qpx-AYhLqe9.ZF68DA.erVB9hvTG0xHzq7Ka8gnHCmHQAs; page_size=20; views=190; session=.eJx1kdtOwzAMht8l12VK2_W0OxjbQBpMaIJxEKqy1u2ypklJUsZAe3fcodELxF3s3_5tf_kiaQO6ZhKkJSOrW3AIy2suyahgwmCUQ81rlfcxN5nSecoxRaKIRkHs0SBxk2Ho-nFI-gqhMiYAq0Ce3S9R-L-Fy7RsuchPKwhVlpB3qxklj6PiKA4dUttSpa0BLVndOdsN7JjNNjsmc9BopFhrN15qLLOd_knXvt1mYfCxHL5f2mJxvXDnyXQlaj6v1n29VRXgyV-EZRkYc4pJs-Luu_QszCCY0NKb7Lzbp0Kp8ey5eJhiP3w0XINJGdJzwyhyaUj9ZOB7AY2SXu54hnQYU-oQDQWmNr8zqnHYTN6qi5vn2-jtTov9chFfVdn82pxL-ogzkGaDx7yQIyIz2Cq062jin_Fij88fgbw65Gia2n3XQC6AaaRycMgfkJbpEnBn2Qpx-AYhLqe9.ZGqQJw.Q5sJcECdKolTnLO4fwrFJUI7jIo Priority: u=1, i Cf-Connecting-Ip: 47.26.243.253 Cf-Ipcountry: US Cdn-Loop: cloudflare ```

Labels: decksite

vorpal-buildbot commented 1 year ago

Exceeded slow_query limit (0.7 > 0.5) in mysql: ```

    SELECT
        p.id,
        LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS name,
        p.mtgo_username,
        p.tappedout_username,
        p.mtggoldfish_username,
        p.discord_id,
        p.elo,
        p.locale,
        p.banned,
        SUM(1) AS num_decks,
        SUM(dc.wins) AS wins,
        SUM(dc.losses) AS losses,
        SUM(dc.draws) AS draws,
        SUM(dc.wins - dc.losses) AS record,
        SUM(CASE WHEN dc.wins >= 5 AND dc.losses = 0 AND d.source_id IN (SELECT id FROM source WHERE name = 'League') THEN 1 ELSE 0 END) AS perfect_runs,
        SUM(CASE WHEN d.finish = 1 THEN 1 ELSE 0 END) AS tournament_wins,
        SUM(CASE WHEN d.finish <= 8 THEN 1 ELSE 0 END) AS tournament_top8s,
        IFNULL(ROUND((SUM(dc.wins) / NULLIF(SUM(dc.wins + dc.losses), 0)) * 100, 1), '') AS win_percent,
        SUM(DISTINCT CASE WHEN d.competition_id IS NOT NULL THEN 1 ELSE 0 END) AS num_competitions
    FROM
        person AS p
    LEFT JOIN
        deck AS d ON d.person_id = p.id
    LEFT JOIN
        deck_cache AS dc ON d.id = dc.deck_id

    WHERE
        (TRUE) AND (TRUE)
    GROUP BY
        p.id
    ORDER BY
        num_decks DESC, num_decks DESC, record, name
    LIMIT 0, 20
```

[] (slow_query, 0.7, mysql)

Reported on decksite by mysql-perf

Location Hash: e9f64b3bcb566ad5cecc53e07c76bf47b7122bf1

Request Data ``` Request Method: GET Path: /api/people/?deckType=all&page=0&pageSize=20&q=&seasonId=0 Cookies: ImmutableMultiDict([('hide_intro', 'True'), ('page_size', '20'), ('views', '288')]) Endpoint: people_api View Args: {} Person: logged_out Referrer: https://pennydreadfulmagic.com/seasons/all/people/ Request Data: {} Host: pennydreadfulmagic.com Connection: Keep-Alive Accept-Encoding: gzip X-Forwarded-For: 174.80.138.139 Cf-Ray: 7cb052f61f8eb082-ATL X-Forwarded-Proto: https Cf-Visitor: {"scheme":"https"} Sec-Ch-Ua: "Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24" Accept: application/json, text/plain, */* Sec-Ch-Ua-Mobile: ?0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Sec-Ch-Ua-Platform: "Windows" Sec-Fetch-Site: same-origin Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Referer: https://pennydreadfulmagic.com/seasons/all/people/ Accept-Language: en-US,en;q=0.9 Cookie: hide_intro=True; page_size=20; views=288 Priority: u=1, i Cf-Connecting-Ip: 174.80.138.139 Cf-Ipcountry: US Cdn-Loop: cloudflare ```

Labels: decksite

vorpal-buildbot commented 1 year ago

Exceeded slow_query limit (0.7 > 0.5) in mysql: ```

    SELECT
        p.id,
        LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS name,
        p.mtgo_username,
        p.tappedout_username,
        p.mtggoldfish_username,
        p.discord_id,
        p.elo,
        p.locale,
        p.banned,
        SUM(1) AS num_decks,
        SUM(dc.wins) AS wins,
        SUM(dc.losses) AS losses,
        SUM(dc.draws) AS draws,
        SUM(dc.wins - dc.losses) AS record,
        SUM(CASE WHEN dc.wins >= 5 AND dc.losses = 0 AND d.source_id IN (SELECT id FROM source WHERE name = 'League') THEN 1 ELSE 0 END) AS perfect_runs,
        SUM(CASE WHEN d.finish = 1 THEN 1 ELSE 0 END) AS tournament_wins,
        SUM(CASE WHEN d.finish <= 8 THEN 1 ELSE 0 END) AS tournament_top8s,
        IFNULL(ROUND((SUM(dc.wins) / NULLIF(SUM(dc.wins + dc.losses), 0)) * 100, 1), '') AS win_percent,
        SUM(DISTINCT CASE WHEN d.competition_id IS NOT NULL THEN 1 ELSE 0 END) AS num_competitions
    FROM
        person AS p
    LEFT JOIN
        deck AS d ON d.person_id = p.id
    LEFT JOIN
        deck_cache AS dc ON d.id = dc.deck_id

    WHERE
        (TRUE) AND (TRUE)
    GROUP BY
        p.id
    ORDER BY
        num_decks DESC, num_decks DESC, record, name
    LIMIT 0, 20
```

[] (slow_query, 0.7, mysql)

Reported on decksite by mysql-perf

Location Hash: e9f64b3bcb566ad5cecc53e07c76bf47b7122bf1

Request Data ``` Request Method: GET Path: /api/people/?deckType=all&page=0&pageSize=20&q=&seasonId=0 Cookies: ImmutableMultiDict([('hide_intro', 'True'), ('page_size', '20'), ('views', '56'), ('session', '.eJx1kdtuwjAMht8l1x3qIaQdl4itYyBgHDakaaqyNm0DbVKSVIUh3n1uJeBi2l3s3_ZvfzmjqGKqpIIJgwZG1cxCNCm5QIOUFhqihJW8lMlVTLiOpUoiDhnk-kFgE9slLsG-7xInQPeKQsa0YFDFxMNmBcL_LVxEWc2Lm0khs4wl7WZais4K9z3PQqXJZFRrpgQtu8lUGdheO64HUyStTe5G2lDTihKPtfM42e2f9MvPbLY8TuRTsV3Wi8asQ3GvN3LP4NwzonHMtL7GaJ0fYiPx-n1eTRtnLp-rw3KTj6earV75CfrZseKK6YgCOYdg2_f6LsY9jLFDguCutzCJjQPbtpBiKaTymwle7aejtyYMDsNwXJ3Kb-5uR_ttU4eL9IOACbCs4JpPoAdfxNPWuGOlb4_eToLFl4W6oZE5tQ1oCHCYQhcL_cFoqMoYLC3qorj8Ai1zpxI.ZG1CQw.j11i3u6SaRZz1qv3IO0OeXHK7m8')]) Endpoint: people_api View Args: {} Person: 278806026264772618 Referrer: https://pennydreadfulmagic.com/seasons/all/people/ Request Data: {} Host: pennydreadfulmagic.com Connection: Keep-Alive Accept-Encoding: gzip X-Forwarded-For: 2601:646:c600:b:41df:8108:bead:d3df Cf-Ray: 7cc0d5c4ea78173a-SJC X-Forwarded-Proto: https Cf-Visitor: {"scheme":"https"} Sec-Ch-Ua: "Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24" Accept: application/json, text/plain, */* Sec-Ch-Ua-Mobile: ?0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Sec-Ch-Ua-Platform: "Windows" Sec-Fetch-Site: same-origin Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Referer: https://pennydreadfulmagic.com/seasons/all/people/ Accept-Language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7 Cookie: hide_intro=True; page_size=20; views=56; session=.eJx1kdtuwjAMht8l1x3qIaQdl4itYyBgHDakaaqyNm0DbVKSVIUh3n1uJeBi2l3s3_ZvfzmjqGKqpIIJgwZG1cxCNCm5QIOUFhqihJW8lMlVTLiOpUoiDhnk-kFgE9slLsG-7xInQPeKQsa0YFDFxMNmBcL_LVxEWc2Lm0khs4wl7WZais4K9z3PQqXJZFRrpgQtu8lUGdheO64HUyStTe5G2lDTihKPtfM42e2f9MvPbLY8TuRTsV3Wi8asQ3GvN3LP4NwzonHMtL7GaJ0fYiPx-n1eTRtnLp-rw3KTj6earV75CfrZseKK6YgCOYdg2_f6LsY9jLFDguCutzCJjQPbtpBiKaTymwle7aejtyYMDsNwXJ3Kb-5uR_ttU4eL9IOACbCs4JpPoAdfxNPWuGOlb4_eToLFl4W6oZE5tQ1oCHCYQhcL_cFoqMoYLC3qorj8Ai1zpxI.ZG1CQw.j11i3u6SaRZz1qv3IO0OeXHK7m8 Priority: u=1, i Cf-Connecting-Ip: 2601:646:c600:b:41df:8108:bead:d3df Cf-Ipcountry: US Cdn-Loop: cloudflare ```

Labels: decksite

vorpal-buildbot commented 1 year ago

Exceeded slow_query limit (0.7 > 0.5) in mysql: ```

    SELECT
        p.id,
        LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS name,
        p.mtgo_username,
        p.tappedout_username,
        p.mtggoldfish_username,
        p.discord_id,
        p.elo,
        p.locale,
        p.banned,
        SUM(1) AS num_decks,
        SUM(dc.wins) AS wins,
        SUM(dc.losses) AS losses,
        SUM(dc.draws) AS draws,
        SUM(dc.wins - dc.losses) AS record,
        SUM(CASE WHEN dc.wins >= 5 AND dc.losses = 0 AND d.source_id IN (SELECT id FROM source WHERE name = 'League') THEN 1 ELSE 0 END) AS perfect_runs,
        SUM(CASE WHEN d.finish = 1 THEN 1 ELSE 0 END) AS tournament_wins,
        SUM(CASE WHEN d.finish <= 8 THEN 1 ELSE 0 END) AS tournament_top8s,
        IFNULL(ROUND((SUM(dc.wins) / NULLIF(SUM(dc.wins + dc.losses), 0)) * 100, 1), '') AS win_percent,
        SUM(DISTINCT CASE WHEN d.competition_id IS NOT NULL THEN 1 ELSE 0 END) AS num_competitions
    FROM
        person AS p
    LEFT JOIN
        deck AS d ON d.person_id = p.id
    LEFT JOIN
        deck_cache AS dc ON d.id = dc.deck_id

    WHERE
        (TRUE) AND (TRUE)
    GROUP BY
        p.id
    ORDER BY
        num_decks DESC, num_decks DESC, record, name
    LIMIT 0, 20
```

[] (slow_query, 0.7, mysql)

Reported on decksite by mysql-perf

Location Hash: e9f64b3bcb566ad5cecc53e07c76bf47b7122bf1

Request Data ``` Request Method: GET Path: /api/people/?deckType=all&page=0&pageSize=20&q=&seasonId=0 Cookies: ImmutableMultiDict([('hide_intro', 'True'), ('session', '.eJx1UV1rgzAU_S95dkVN60ff7MY2RmVdnTg6hgS9avyKJJFVS__7YqF2DPaWc-45OTcnJxR3wBvSQivRWvIeNETShrZXkEJDG5bOkIqE8TSmikGm4doYrxwb6zo2XBMv0U1Rs4TUoFTQ3oWBGvxvoW2c97SeQ35Z0YTyHNJpTcHaS7ChWxpqZM7iXgBvSTNpy7iBiig9I70szFhIIieebk0zzLvAeSh3UAlPT4vAdIPmecxew8NNL1ml4tYnRJIEhLhi9PKxt3xaezaMm_vhAEH1vfd53R2jvuyelB-OHeUgYqIKNFaOha2l7VoL3cW2YeLbfOrU0peOrmuIQ6aoYg5J0zDCgzf2UeR7Ufa43W2g9AsPj28We1chqtNOveZTtah-imaD4i6difmwKJmK-NLQ5dJYDpMBbYBw4Oisob8FSsJzUDu3fV2ffwDrUKg6.ZE8QBQ.L9SV7vchBRFRIRTB5P9SwRZfjYE'), ('session', '.eJx1UV1rgzAU_S95dkVN60ff7MY2RmVdnTg6hgS9avyKJJFVS__7YqF2DPaWc-45OTcnJxR3wBvSQivRWvIeNETShrZXkEJDG5bOkIqE8TSmikGm4doYrxwb6zo2XBMv0U1Rs4TUoFTQ3oWBGvxvoW2c97SeQ35Z0YTyHNJpTcHaS7ChWxpqZM7iXgBvSTNpy7iBiig9I70szFhIIieebk0zzLvAeSh3UAlPT4vAdIPmecxew8NNL1ml4tYnRJIEhLhi9PKxt3xaezaMm_vhAEH1vfd53R2jvuyelB-OHeUgYqIKNFaOha2l7VoL3cW2YeLbfOrU0peOrmuIQ6aoYg5J0zDCgzf2UeR7Ufa43W2g9AsPj28We1chqtNOveZTtah-imaD4i6difmwKJmK-NLQ5dJYDpMBbYBw4Oisob8FSsJzUDu3fV2ffwDrUKg6.ZG-Ipw.R9OhDINRZ6d5k0FJRF7DzuN78zc'), ('page_size', '20'), ('views', '23')]) Endpoint: people_api View Args: {} Person: 219733587300319234 Referrer: https://pennydreadfulmagic.com/seasons/all/people/ Request Data: {} Host: pennydreadfulmagic.com Connection: Keep-Alive Accept-Encoding: gzip X-Forwarded-For: 97.103.253.204 Cf-Ray: 7ccf0db5e9ceb08d-ATL X-Forwarded-Proto: https Cf-Visitor: {"scheme":"https"} Sec-Ch-Ua: "Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24" Accept: application/json, text/plain, */* Sec-Ch-Ua-Mobile: ?0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Sec-Ch-Ua-Platform: "Windows" Sec-Fetch-Site: same-origin Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Referer: https://pennydreadfulmagic.com/seasons/all/people/ Accept-Language: en-US,en;q=0.9 Cookie: hide_intro=True; session=.eJx1UV1rgzAU_S95dkVN60ff7MY2RmVdnTg6hgS9avyKJJFVS__7YqF2DPaWc-45OTcnJxR3wBvSQivRWvIeNETShrZXkEJDG5bOkIqE8TSmikGm4doYrxwb6zo2XBMv0U1Rs4TUoFTQ3oWBGvxvoW2c97SeQ35Z0YTyHNJpTcHaS7ChWxpqZM7iXgBvSTNpy7iBiig9I70szFhIIieebk0zzLvAeSh3UAlPT4vAdIPmecxew8NNL1ml4tYnRJIEhLhi9PKxt3xaezaMm_vhAEH1vfd53R2jvuyelB-OHeUgYqIKNFaOha2l7VoL3cW2YeLbfOrU0peOrmuIQ6aoYg5J0zDCgzf2UeR7Ufa43W2g9AsPj28We1chqtNOveZTtah-imaD4i6difmwKJmK-NLQ5dJYDpMBbYBw4Oisob8FSsJzUDu3fV2ffwDrUKg6.ZE8QBQ.L9SV7vchBRFRIRTB5P9SwRZfjYE; page_size=20; session=.eJx1UV1rgzAU_S95dkVN60ff7MY2RmVdnTg6hgS9avyKJJFVS__7YqF2DPaWc-45OTcnJxR3wBvSQivRWvIeNETShrZXkEJDG5bOkIqE8TSmikGm4doYrxwb6zo2XBMv0U1Rs4TUoFTQ3oWBGvxvoW2c97SeQ35Z0YTyHNJpTcHaS7ChWxpqZM7iXgBvSTNpy7iBiig9I70szFhIIieebk0zzLvAeSh3UAlPT4vAdIPmecxew8NNL1ml4tYnRJIEhLhi9PKxt3xaezaMm_vhAEH1vfd53R2jvuyelB-OHeUgYqIKNFaOha2l7VoL3cW2YeLbfOrU0peOrmuIQ6aoYg5J0zDCgzf2UeR7Ufa43W2g9AsPj28We1chqtNOveZTtah-imaD4i6difmwKJmK-NLQ5dJYDpMBbYBw4Oisob8FSsJzUDu3fV2ffwDrUKg6.ZG-Ipw.R9OhDINRZ6d5k0FJRF7DzuN78zc; views=23 Priority: u=1, i Cf-Connecting-Ip: 97.103.253.204 Cf-Ipcountry: US Cdn-Loop: cloudflare ```

Labels: decksite

vorpal-buildbot commented 1 year ago

Exceeded slow_query limit (0.7 > 0.5) in mysql: ```

    SELECT
        p.id,
        LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS name,
        p.mtgo_username,
        p.tappedout_username,
        p.mtggoldfish_username,
        p.discord_id,
        p.elo,
        p.locale,
        p.banned,
        SUM(1) AS num_decks,
        SUM(dc.wins) AS wins,
        SUM(dc.losses) AS losses,
        SUM(dc.draws) AS draws,
        SUM(dc.wins - dc.losses) AS record,
        SUM(CASE WHEN dc.wins >= 5 AND dc.losses = 0 AND d.source_id IN (SELECT id FROM source WHERE name = 'League') THEN 1 ELSE 0 END) AS perfect_runs,
        SUM(CASE WHEN d.finish = 1 THEN 1 ELSE 0 END) AS tournament_wins,
        SUM(CASE WHEN d.finish <= 8 THEN 1 ELSE 0 END) AS tournament_top8s,
        IFNULL(ROUND((SUM(dc.wins) / NULLIF(SUM(dc.wins + dc.losses), 0)) * 100, 1), '') AS win_percent,
        SUM(DISTINCT CASE WHEN d.competition_id IS NOT NULL THEN 1 ELSE 0 END) AS num_competitions
    FROM
        person AS p
    LEFT JOIN
        deck AS d ON d.person_id = p.id
    LEFT JOIN
        deck_cache AS dc ON d.id = dc.deck_id

    WHERE
        (TRUE) AND (TRUE)
    GROUP BY
        p.id
    ORDER BY
        num_decks DESC, num_decks DESC, record, name
    LIMIT 0, 20
```

[] (slow_query, 0.7, mysql)

Reported on decksite by mysql-perf

Location Hash: e9f64b3bcb566ad5cecc53e07c76bf47b7122bf1

Request Data ``` Request Method: GET Path: /api/people/?deckType=all&page=0&pageSize=20&q=&seasonId=0 Cookies: ImmutableMultiDict([('views', '11'), ('page_size', '20'), ('hide_intro', 'True')]) Endpoint: people_api View Args: {} Person: logged_out Referrer: https://pennydreadfulmagic.com/seasons/all/people/ Request Data: {} Host: pennydreadfulmagic.com Connection: Keep-Alive Accept-Encoding: gzip X-Forwarded-For: 174.80.138.139 Cf-Ray: 7cd364560b40ad6b-ATL X-Forwarded-Proto: https Cf-Visitor: {"scheme":"https"} Accept: application/json, text/plain, */* User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 15_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) EdgiOS/113.0.1774.42 Version/15.0 Mobile/15E148 Safari/604.1 Accept-Language: en-US,en;q=0.9 Referer: https://pennydreadfulmagic.com/seasons/all/people/ Cookie: views=11; page_size=20; hide_intro=True Cf-Connecting-Ip: 174.80.138.139 Cf-Ipcountry: US Cdn-Loop: cloudflare ```

Labels: decksite

vorpal-buildbot commented 1 year ago

Exceeded slow_query limit (0.7 > 0.5) in mysql: ```

    SELECT
        p.id,
        LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS name,
        p.mtgo_username,
        p.tappedout_username,
        p.mtggoldfish_username,
        p.discord_id,
        p.elo,
        p.locale,
        p.banned,
        SUM(1) AS num_decks,
        SUM(dc.wins) AS wins,
        SUM(dc.losses) AS losses,
        SUM(dc.draws) AS draws,
        SUM(dc.wins - dc.losses) AS record,
        SUM(CASE WHEN dc.wins >= 5 AND dc.losses = 0 AND d.source_id IN (SELECT id FROM source WHERE name = 'League') THEN 1 ELSE 0 END) AS perfect_runs,
        SUM(CASE WHEN d.finish = 1 THEN 1 ELSE 0 END) AS tournament_wins,
        SUM(CASE WHEN d.finish <= 8 THEN 1 ELSE 0 END) AS tournament_top8s,
        IFNULL(ROUND((SUM(dc.wins) / NULLIF(SUM(dc.wins + dc.losses), 0)) * 100, 1), '') AS win_percent,
        SUM(DISTINCT CASE WHEN d.competition_id IS NOT NULL THEN 1 ELSE 0 END) AS num_competitions
    FROM
        person AS p
    LEFT JOIN
        deck AS d ON d.person_id = p.id
    LEFT JOIN
        deck_cache AS dc ON d.id = dc.deck_id

    WHERE
        (TRUE) AND (TRUE)
    GROUP BY
        p.id
    ORDER BY
        num_decks DESC, num_decks DESC, record, name
    LIMIT 0, 20
```

[] (slow_query, 0.7, mysql)

Reported on decksite by mysql-perf

Location Hash: e9f64b3bcb566ad5cecc53e07c76bf47b7122bf1

Request Data ``` Request Method: GET Path: /api/people/?deckType=all&page=0&pageSize=20&q=&seasonId=0 Cookies: ImmutableMultiDict([('hide_intro', 'True'), ('page_size', '20'), ('deck_id', '217063'), ('session', '.eJx1UUFuwjAQ_Mueo8okwXG4AeVQ1AJqqxZaVZEhSzDETmo7goD4e51UwKHqzbM749mdPUFSopZcobLQs7pCD3gqhYLemufGoRSlkEV6w8KsCp0mwpWAEj-OSZdRFgU0DEiHwI2RFyueo2Ntuav-zxcqySqRpxf_qw4VNCjLMG2mNIVqXYMoYB5ImxVJZVArLhtyXVU-IR1GOj5zsoJXduMnxnLbdPOo7M_Hu1n69L5nb49xsFguH_rHSo3mezu98W2xc669E_DVCo25YKBDE2g9zLKyNvIwQm1Hs8VkG71MpP0eOD0eSqHRJNzF2KEsCKlP_OiOdbth3I1u_SZZSkJGiAca1660uZpkdODPzPF1sQ_3dRqXYkLlB453fPp8HzdLuVxLt80ntHmZu20hVButu55Y1-7524AvD9pPE1s3Ahgg16jh7MGfHC3XGbqhVZXn5x-Tkqmv.ZHSkXQ.SSQ1JV6UgppZvbaqq784PjOGqnI'), ('views', '118')]) Endpoint: people_api View Args: {} Person: 602990586873643010 Referrer: https://pennydreadfulmagic.com/seasons/all/people/ Request Data: {} Host: pennydreadfulmagic.com Connection: Keep-Alive Accept-Encoding: gzip X-Forwarded-For: 240f:30:1768:1:45e6:5994:18d7:1b5 Cf-Ray: 7ceefaeb3ac3f62d-NRT X-Forwarded-Proto: https Cf-Visitor: {"scheme":"https"} Sec-Ch-Ua: "Microsoft Edge";v="113", "Chromium";v="113", "Not-A.Brand";v="24" Accept: application/json, text/plain, */* Sec-Ch-Ua-Mobile: ?0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.57 Sec-Ch-Ua-Platform: "Windows" Sec-Fetch-Site: same-origin Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Referer: https://pennydreadfulmagic.com/seasons/all/people/ Accept-Language: ja,en;q=0.9,en-GB;q=0.8,en-US;q=0.7 Cookie: hide_intro=True; page_size=20; deck_id=217063; session=.eJx1UUFuwjAQ_Mueo8okwXG4AeVQ1AJqqxZaVZEhSzDETmo7goD4e51UwKHqzbM749mdPUFSopZcobLQs7pCD3gqhYLemufGoRSlkEV6w8KsCp0mwpWAEj-OSZdRFgU0DEiHwI2RFyueo2Ntuav-zxcqySqRpxf_qw4VNCjLMG2mNIVqXYMoYB5ImxVJZVArLhtyXVU-IR1GOj5zsoJXduMnxnLbdPOo7M_Hu1n69L5nb49xsFguH_rHSo3mezu98W2xc669E_DVCo25YKBDE2g9zLKyNvIwQm1Hs8VkG71MpP0eOD0eSqHRJNzF2KEsCKlP_OiOdbth3I1u_SZZSkJGiAca1660uZpkdODPzPF1sQ_3dRqXYkLlB453fPp8HzdLuVxLt80ntHmZu20hVButu55Y1-7524AvD9pPE1s3Ahgg16jh7MGfHC3XGbqhVZXn5x-Tkqmv.ZHSkXQ.SSQ1JV6UgppZvbaqq784PjOGqnI; views=118 Priority: u=1, i Cf-Connecting-Ip: 240f:30:1768:1:45e6:5994:18d7:1b5 Cf-Ipcountry: JP Cdn-Loop: cloudflare ```

Labels: decksite

vorpal-buildbot commented 1 year ago

Exceeded slow_query limit (0.7 > 0.5) in mysql: ```

    SELECT
        p.id,
        LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS name,
        p.mtgo_username,
        p.tappedout_username,
        p.mtggoldfish_username,
        p.discord_id,
        p.elo,
        p.locale,
        p.banned,
        SUM(1) AS num_decks,
        SUM(dc.wins) AS wins,
        SUM(dc.losses) AS losses,
        SUM(dc.draws) AS draws,
        SUM(dc.wins - dc.losses) AS record,
        SUM(CASE WHEN dc.wins >= 5 AND dc.losses = 0 AND d.source_id IN (SELECT id FROM source WHERE name = 'League') THEN 1 ELSE 0 END) AS perfect_runs,
        SUM(CASE WHEN d.finish = 1 THEN 1 ELSE 0 END) AS tournament_wins,
        SUM(CASE WHEN d.finish <= 8 THEN 1 ELSE 0 END) AS tournament_top8s,
        IFNULL(ROUND((SUM(dc.wins) / NULLIF(SUM(dc.wins + dc.losses), 0)) * 100, 1), '') AS win_percent,
        SUM(DISTINCT CASE WHEN d.competition_id IS NOT NULL THEN 1 ELSE 0 END) AS num_competitions
    FROM
        person AS p
    LEFT JOIN
        deck AS d ON d.person_id = p.id
    LEFT JOIN
        deck_cache AS dc ON d.id = dc.deck_id

    WHERE
        (TRUE) AND (TRUE)
    GROUP BY
        p.id
    ORDER BY
        num_decks DESC, num_decks DESC, record, name
    LIMIT 0, 20
```

[] (slow_query, 0.7, mysql)

Reported on decksite by mysql-perf

Location Hash: e9f64b3bcb566ad5cecc53e07c76bf47b7122bf1

Request Data ``` Request Method: GET Path: /api/people/?deckType=all&page=0&pageSize=20&q=&seasonId=0 Cookies: ImmutableMultiDict([('hide_intro', 'True'), ('hide_intro', 'True'), ('session', '.eJx1kdtOwzAMht8l12VK2_W0OxjbQBpMaIJxEKqy1u2ypklJUsZAe3fcodELxF3s3_5tf_kiaQO6ZhKkJSOrW3AIy2suyahgwmCUQ81rlfcxN5nSecoxRaKIRkHs0SBxk2Ho-nFI-gqhMiYAq0Ce3S9R-L-Fy7RsuchPKwhVlpB3qxklj6PiKA4dUttSpa0BLVndOdsN7JjNNjsmc9BopFhrN15qLLOd_knXvt1mYfCxHL5f2mJxvXDnyXQlaj6v1n29VRXgyV-EZRkYc4pJs-Luu_QszCCY0NKb7Lzbp0Kp8ey5eJhiP3w0XINJGdJzwyhyaUj9ZOB7AY2SXu54hnQYU-oQDQWmNr8zqnHYTN6qi5vn2-jtTov9chFfVdn82pxL-ogzkGaDx7yQIyIz2Cq062jin_Fij88fgbw65Gia2n3XQC6AaaRycMgfkJbpEnBn2Qpx-AYhLqe9.ZF68DA.erVB9hvTG0xHzq7Ka8gnHCmHQAs'), ('session', '.eJx1kdtOwzAMht8l12VK2_W0OxjbQBpMaIJxEKqy1u2ypklJUsZAe3fcodELxF3s3_5tf_kiaQO6ZhKkJSOrW3AIy2suyahgwmCUQ81rlfcxN5nSecoxRaKIRkHs0SBxk2Ho-nFI-gqhMiYAq0Ce3S9R-L-Fy7RsuchPKwhVlpB3qxklj6PiKA4dUttSpa0BLVndOdsN7JjNNjsmc9BopFhrN15qLLOd_knXvt1mYfCxHL5f2mJxvXDnyXQlaj6v1n29VRXgyV-EZRkYc4pJs-Luu_QszCCY0NKb7Lzbp0Kp8ey5eJhiP3w0XINJGdJzwyhyaUj9ZOB7AY2SXu54hnQYU-oQDQWmNr8zqnHYTN6qi5vn2-jtTov9chFfVdn82pxL-ogzkGaDx7yQIyIz2Cq062jin_Fij88fgbw65Gia2n3XQC6AaaRycMgfkJbpEnBn2Qpx-AYhLqe9.ZHejnA.5rjxGfUFK2TkBHZNxZvvjHxLRzU'), ('page_size', '20'), ('views', '49')]) Endpoint: people_api View Args: {} Person: 770758205919461386 Referrer: https://pennydreadfulmagic.com/seasons/all/people/ Request Data: {} Host: pennydreadfulmagic.com Connection: Keep-Alive Accept-Encoding: gzip X-Forwarded-For: 47.26.243.253 Cf-Ray: 7d01b6339b42116b-ORD X-Forwarded-Proto: https Cf-Visitor: {"scheme":"https"} Sec-Ch-Ua: "Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24" Accept: application/json, text/plain, */* Dnt: 1 Sec-Ch-Ua-Mobile: ?0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Sec-Ch-Ua-Platform: "Windows" Sec-Fetch-Site: same-origin Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Referer: https://pennydreadfulmagic.com/seasons/all/people/ Accept-Language: en-US,en;q=0.9 Cookie: hide_intro=True; hide_intro=True; session=.eJx1kdtOwzAMht8l12VK2_W0OxjbQBpMaIJxEKqy1u2ypklJUsZAe3fcodELxF3s3_5tf_kiaQO6ZhKkJSOrW3AIy2suyahgwmCUQ81rlfcxN5nSecoxRaKIRkHs0SBxk2Ho-nFI-gqhMiYAq0Ce3S9R-L-Fy7RsuchPKwhVlpB3qxklj6PiKA4dUttSpa0BLVndOdsN7JjNNjsmc9BopFhrN15qLLOd_knXvt1mYfCxHL5f2mJxvXDnyXQlaj6v1n29VRXgyV-EZRkYc4pJs-Luu_QszCCY0NKb7Lzbp0Kp8ey5eJhiP3w0XINJGdJzwyhyaUj9ZOB7AY2SXu54hnQYU-oQDQWmNr8zqnHYTN6qi5vn2-jtTov9chFfVdn82pxL-ogzkGaDx7yQIyIz2Cq062jin_Fij88fgbw65Gia2n3XQC6AaaRycMgfkJbpEnBn2Qpx-AYhLqe9.ZF68DA.erVB9hvTG0xHzq7Ka8gnHCmHQAs; page_size=20; session=.eJx1kdtOwzAMht8l12VK2_W0OxjbQBpMaIJxEKqy1u2ypklJUsZAe3fcodELxF3s3_5tf_kiaQO6ZhKkJSOrW3AIy2suyahgwmCUQ81rlfcxN5nSecoxRaKIRkHs0SBxk2Ho-nFI-gqhMiYAq0Ce3S9R-L-Fy7RsuchPKwhVlpB3qxklj6PiKA4dUttSpa0BLVndOdsN7JjNNjsmc9BopFhrN15qLLOd_knXvt1mYfCxHL5f2mJxvXDnyXQlaj6v1n29VRXgyV-EZRkYc4pJs-Luu_QszCCY0NKb7Lzbp0Kp8ey5eJhiP3w0XINJGdJzwyhyaUj9ZOB7AY2SXu54hnQYU-oQDQWmNr8zqnHYTN6qi5vn2-jtTov9chFfVdn82pxL-ogzkGaDx7yQIyIz2Cq062jin_Fij88fgbw65Gia2n3XQC6AaaRycMgfkJbpEnBn2Qpx-AYhLqe9.ZHejnA.5rjxGfUFK2TkBHZNxZvvjHxLRzU; views=49 Priority: u=1, i Cf-Connecting-Ip: 47.26.243.253 Cf-Ipcountry: US Cdn-Loop: cloudflare ```

Labels: decksite

vorpal-buildbot commented 1 year ago

Exceeded slow_query limit (0.7 > 0.5) in mysql: ```

    SELECT
        p.id,
        LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS name,
        p.mtgo_username,
        p.tappedout_username,
        p.mtggoldfish_username,
        p.discord_id,
        p.elo,
        p.locale,
        p.banned,
        SUM(1) AS num_decks,
        SUM(dc.wins) AS wins,
        SUM(dc.losses) AS losses,
        SUM(dc.draws) AS draws,
        SUM(dc.wins - dc.losses) AS record,
        SUM(CASE WHEN dc.wins >= 5 AND dc.losses = 0 AND d.source_id IN (SELECT id FROM source WHERE name = 'League') THEN 1 ELSE 0 END) AS perfect_runs,
        SUM(CASE WHEN d.finish = 1 THEN 1 ELSE 0 END) AS tournament_wins,
        SUM(CASE WHEN d.finish <= 8 THEN 1 ELSE 0 END) AS tournament_top8s,
        IFNULL(ROUND((SUM(dc.wins) / NULLIF(SUM(dc.wins + dc.losses), 0)) * 100, 1), '') AS win_percent,
        SUM(DISTINCT CASE WHEN d.competition_id IS NOT NULL THEN 1 ELSE 0 END) AS num_competitions
    FROM
        person AS p
    LEFT JOIN
        deck AS d ON d.person_id = p.id
    LEFT JOIN
        deck_cache AS dc ON d.id = dc.deck_id

    WHERE
        (TRUE) AND (TRUE)
    GROUP BY
        p.id
    ORDER BY
        num_decks DESC, num_decks DESC, record, name
    LIMIT 0, 20
```

[] (slow_query, 0.7, mysql)

Reported on decksite by mysql-perf

Location Hash: e9f64b3bcb566ad5cecc53e07c76bf47b7122bf1

Request Data ``` Request Method: GET Path: /api/people/?deckType=all&page=0&pageSize=20&q=&seasonId=0 Cookies: ImmutableMultiDict([('views', '17'), ('page_size', '20')]) Endpoint: people_api View Args: {} Person: logged_out Referrer: https://pennydreadfulmagic.com/seasons/all/people/ Request Data: {} Host: pennydreadfulmagic.com Connection: Keep-Alive Accept-Encoding: gzip X-Forwarded-For: 2600:1010:b15e:c053:0:53:4c8:1e01 Cf-Ray: 7d05c58e4b5615ba-SJC X-Forwarded-Proto: https Cf-Visitor: {"scheme":"https"} User-Agent: Mozilla/5.0 (Android 13; Mobile; rv:109.0) Gecko/113.0 Firefox/113.0 Accept: application/json, text/plain, */* Accept-Language: en-US Dnt: 1 Referer: https://pennydreadfulmagic.com/seasons/all/people/ Sec-Fetch-Dest: empty Sec-Fetch-Mode: cors Sec-Fetch-Site: same-origin Cookie: views=17; page_size=20 Cf-Connecting-Ip: 2600:1010:b15e:c053:0:53:4c8:1e01 Cf-Ipcountry: US Cdn-Loop: cloudflare ```

Labels: decksite

vorpal-buildbot commented 1 year ago

Exceeded slow_query limit (0.6 > 0.5) in mysql: ```

    SELECT
        p.id,
        LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS name,
        p.mtgo_username,
        p.tappedout_username,
        p.mtggoldfish_username,
        p.discord_id,
        p.elo,
        p.locale,
        p.banned,
        SUM(1) AS num_decks,
        SUM(dc.wins) AS wins,
        SUM(dc.losses) AS losses,
        SUM(dc.draws) AS draws,
        SUM(dc.wins - dc.losses) AS record,
        SUM(CASE WHEN dc.wins >= 5 AND dc.losses = 0 AND d.source_id IN (SELECT id FROM source WHERE name = 'League') THEN 1 ELSE 0 END) AS perfect_runs,
        SUM(CASE WHEN d.finish = 1 THEN 1 ELSE 0 END) AS tournament_wins,
        SUM(CASE WHEN d.finish <= 8 THEN 1 ELSE 0 END) AS tournament_top8s,
        IFNULL(ROUND((SUM(dc.wins) / NULLIF(SUM(dc.wins + dc.losses), 0)) * 100, 1), '') AS win_percent,
        SUM(DISTINCT CASE WHEN d.competition_id IS NOT NULL THEN 1 ELSE 0 END) AS num_competitions
    FROM
        person AS p
    LEFT JOIN
        deck AS d ON d.person_id = p.id
    LEFT JOIN
        deck_cache AS dc ON d.id = dc.deck_id

    WHERE
        (TRUE) AND (TRUE)
    GROUP BY
        p.id
    ORDER BY
        num_decks DESC, num_decks DESC, record, name
    LIMIT 0, 20
```

[] (slow_query, 0.6, mysql)

Reported on decksite by mysql-perf

Location Hash: e9f64b3bcb566ad5cecc53e07c76bf47b7122bf1

Request Data ``` Request Method: GET Path: /api/people/?deckType=all&page=0&pageSize=20&q=&seasonId=0 Cookies: ImmutableMultiDict([('views', '19'), ('page_size', '20')]) Endpoint: people_api View Args: {} Person: logged_out Referrer: https://pennydreadfulmagic.com/seasons/all/people/ Request Data: {} Host: pennydreadfulmagic.com Connection: Keep-Alive Accept-Encoding: gzip X-Forwarded-For: 2600:1010:b15e:c053:0:53:4c8:1e01 Cf-Ray: 7d05c5c6ebdc15ba-SJC X-Forwarded-Proto: https Cf-Visitor: {"scheme":"https"} User-Agent: Mozilla/5.0 (Android 13; Mobile; rv:109.0) Gecko/113.0 Firefox/113.0 Accept: application/json, text/plain, */* Accept-Language: en-US Dnt: 1 Referer: https://pennydreadfulmagic.com/seasons/all/people/ Sec-Fetch-Dest: empty Sec-Fetch-Mode: cors Sec-Fetch-Site: same-origin Cookie: views=19; page_size=20 Cf-Connecting-Ip: 2600:1010:b15e:c053:0:53:4c8:1e01 Cf-Ipcountry: US Cdn-Loop: cloudflare ```

Labels: decksite

vorpal-buildbot commented 1 year ago

Exceeded slow_query limit (0.7 > 0.5) in mysql: ```

    SELECT
        p.id,
        LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS name,
        p.mtgo_username,
        p.tappedout_username,
        p.mtggoldfish_username,
        p.discord_id,
        p.elo,
        p.locale,
        p.banned,
        SUM(1) AS num_decks,
        SUM(dc.wins) AS wins,
        SUM(dc.losses) AS losses,
        SUM(dc.draws) AS draws,
        SUM(dc.wins - dc.losses) AS record,
        SUM(CASE WHEN dc.wins >= 5 AND dc.losses = 0 AND d.source_id IN (SELECT id FROM source WHERE name = 'League') THEN 1 ELSE 0 END) AS perfect_runs,
        SUM(CASE WHEN d.finish = 1 THEN 1 ELSE 0 END) AS tournament_wins,
        SUM(CASE WHEN d.finish <= 8 THEN 1 ELSE 0 END) AS tournament_top8s,
        IFNULL(ROUND((SUM(dc.wins) / NULLIF(SUM(dc.wins + dc.losses), 0)) * 100, 1), '') AS win_percent,
        SUM(DISTINCT CASE WHEN d.competition_id IS NOT NULL THEN 1 ELSE 0 END) AS num_competitions
    FROM
        person AS p
    LEFT JOIN
        deck AS d ON d.person_id = p.id
    LEFT JOIN
        deck_cache AS dc ON d.id = dc.deck_id

    WHERE
        (TRUE) AND (TRUE)
    GROUP BY
        p.id
    ORDER BY
        num_decks DESC, num_decks DESC, record, name
    LIMIT 0, 20
```

[] (slow_query, 0.7, mysql)

Reported on decksite by mysql-perf

Location Hash: e9f64b3bcb566ad5cecc53e07c76bf47b7122bf1

Request Data ``` Request Method: GET Path: /api/people/?deckType=all&page=0&pageSize=20&q=&seasonId=0 Cookies: ImmutableMultiDict([('views', '20'), ('page_size', '20'), ('hide_intro', 'True')]) Endpoint: people_api View Args: {} Person: logged_out Referrer: https://pennydreadfulmagic.com/seasons/all/people/ Request Data: {} Host: pennydreadfulmagic.com Connection: Keep-Alive Accept-Encoding: gzip X-Forwarded-For: 2600:1010:b15e:c053:0:53:4c8:1e01 Cf-Ray: 7d05c5e40bcc15ba-SJC X-Forwarded-Proto: https Cf-Visitor: {"scheme":"https"} User-Agent: Mozilla/5.0 (Android 13; Mobile; rv:109.0) Gecko/113.0 Firefox/113.0 Accept: application/json, text/plain, */* Accept-Language: en-US Dnt: 1 Referer: https://pennydreadfulmagic.com/seasons/all/people/ Sec-Fetch-Dest: empty Sec-Fetch-Mode: cors Sec-Fetch-Site: same-origin Cookie: views=20; page_size=20; hide_intro=True Cf-Connecting-Ip: 2600:1010:b15e:c053:0:53:4c8:1e01 Cf-Ipcountry: US Cdn-Loop: cloudflare ```

Labels: decksite

vorpal-buildbot commented 1 year ago

Exceeded slow_query limit (0.6 > 0.5) in mysql: ```

    SELECT
        p.id,
        LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS name,
        p.mtgo_username,
        p.tappedout_username,
        p.mtggoldfish_username,
        p.discord_id,
        p.elo,
        p.locale,
        p.banned,
        SUM(1) AS num_decks,
        SUM(dc.wins) AS wins,
        SUM(dc.losses) AS losses,
        SUM(dc.draws) AS draws,
        SUM(dc.wins - dc.losses) AS record,
        SUM(CASE WHEN dc.wins >= 5 AND dc.losses = 0 AND d.source_id IN (SELECT id FROM source WHERE name = 'League') THEN 1 ELSE 0 END) AS perfect_runs,
        SUM(CASE WHEN d.finish = 1 THEN 1 ELSE 0 END) AS tournament_wins,
        SUM(CASE WHEN d.finish <= 8 THEN 1 ELSE 0 END) AS tournament_top8s,
        IFNULL(ROUND((SUM(dc.wins) / NULLIF(SUM(dc.wins + dc.losses), 0)) * 100, 1), '') AS win_percent,
        SUM(DISTINCT CASE WHEN d.competition_id IS NOT NULL THEN 1 ELSE 0 END) AS num_competitions
    FROM
        person AS p
    LEFT JOIN
        deck AS d ON d.person_id = p.id
    LEFT JOIN
        deck_cache AS dc ON d.id = dc.deck_id

    WHERE
        (TRUE) AND (TRUE)
    GROUP BY
        p.id
    ORDER BY
        num_decks DESC, num_decks DESC, record, name
    LIMIT 0, 20
```

[] (slow_query, 0.6, mysql)

Reported on decksite by mysql-perf

Location Hash: e9f64b3bcb566ad5cecc53e07c76bf47b7122bf1

Request Data ``` Request Method: GET Path: /api/people/?deckType=all&page=0&pageSize=20&q=&seasonId=0 Cookies: ImmutableMultiDict([('hide_intro', 'True'), ('page_size', '20'), ('session', '.eJx1UV1vgjAU_S99ZgYoIOxNhwkuLi7xI5vLQipcaxFa1pYNZvzvKy5qsmRvveeec8-9p0eU1iArwoFrdK9lAxYiecX4pcihYpXIryVTmZB5ygyCXCcaYuyHQ2zb2Ilc7KEboxQZKcGwgN-tFqbxv4TxlDasvJqUglLI-8WU4Gcrxw4sVGkq0kaB5KTqBxdpBQdi9II0eu-mShPd456IJZ3DSBW02STRy3b23SXx03oZxq-dvPG1OIC584hIloFSlxq56xZYHCYrv31eLhaPU1yLOOHbYOZ_jvpLoK2ZBJUSE5kT-N4wcqIoHPhRcOv1CQa2F9q2hSTsDLS_GkymwhXaK9pJ8LXRH3iDg28ynq7pIZw3D8bAJFibS97QORZlkN_HoBBmbh-l-S6269C7hc5DU931AjQGIkGik4X-hqeJpGD25U1Znn4A3taihw.ZHjqBQ.FuPIS2hjtltK1yas_H4YyQ2HwFg'), ('views', '90')]) Endpoint: people_api View Args: {} Person: 219733587300319234 Referrer: https://pennydreadfulmagic.com/seasons/all/people/ Request Data: {} Host: pennydreadfulmagic.com Connection: Keep-Alive Accept-Encoding: gzip X-Forwarded-For: 2600:1006:b064:b32b:6c98:88a7:e453:649e Cf-Ray: 7d09ae42fcef4587-ATL X-Forwarded-Proto: https Cf-Visitor: {"scheme":"https"} Sec-Ch-Ua: "Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24" Accept: application/json, text/plain, */* Sec-Ch-Ua-Mobile: ?1 User-Agent: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Mobile Safari/537.36 Sec-Ch-Ua-Platform: "Android" Sec-Fetch-Site: same-origin Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Referer: https://pennydreadfulmagic.com/seasons/all/people/ Accept-Language: en-US,en;q=0.9 Cookie: hide_intro=True; page_size=20; session=.eJx1UV1vgjAU_S99ZgYoIOxNhwkuLi7xI5vLQipcaxFa1pYNZvzvKy5qsmRvveeec8-9p0eU1iArwoFrdK9lAxYiecX4pcihYpXIryVTmZB5ygyCXCcaYuyHQ2zb2Ilc7KEboxQZKcGwgN-tFqbxv4TxlDasvJqUglLI-8WU4Gcrxw4sVGkq0kaB5KTqBxdpBQdi9II0eu-mShPd456IJZ3DSBW02STRy3b23SXx03oZxq-dvPG1OIC584hIloFSlxq56xZYHCYrv31eLhaPU1yLOOHbYOZ_jvpLoK2ZBJUSE5kT-N4wcqIoHPhRcOv1CQa2F9q2hSTsDLS_GkymwhXaK9pJ8LXRH3iDg28ynq7pIZw3D8bAJFibS97QORZlkN_HoBBmbh-l-S6269C7hc5DU931AjQGIkGik4X-hqeJpGD25U1Znn4A3taihw.ZHjqBQ.FuPIS2hjtltK1yas_H4YyQ2HwFg; views=90 Priority: u=1, i Cf-Connecting-Ip: 2600:1006:b064:b32b:6c98:88a7:e453:649e Cf-Ipcountry: US Cdn-Loop: cloudflare ```

Labels: decksite

vorpal-buildbot commented 1 year ago

Exceeded slow_query limit (0.6 > 0.5) in mysql: ```

    SELECT
        p.id,
        LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS name,
        p.mtgo_username,
        p.tappedout_username,
        p.mtggoldfish_username,
        p.discord_id,
        p.elo,
        p.locale,
        p.banned,
        SUM(1) AS num_decks,
        SUM(dc.wins) AS wins,
        SUM(dc.losses) AS losses,
        SUM(dc.draws) AS draws,
        SUM(dc.wins - dc.losses) AS record,
        SUM(CASE WHEN dc.wins >= 5 AND dc.losses = 0 AND d.source_id IN (SELECT id FROM source WHERE name = 'League') THEN 1 ELSE 0 END) AS perfect_runs,
        SUM(CASE WHEN d.finish = 1 THEN 1 ELSE 0 END) AS tournament_wins,
        SUM(CASE WHEN d.finish <= 8 THEN 1 ELSE 0 END) AS tournament_top8s,
        IFNULL(ROUND((SUM(dc.wins) / NULLIF(SUM(dc.wins + dc.losses), 0)) * 100, 1), '') AS win_percent,
        SUM(DISTINCT CASE WHEN d.competition_id IS NOT NULL THEN 1 ELSE 0 END) AS num_competitions
    FROM
        person AS p
    LEFT JOIN
        deck AS d ON d.person_id = p.id
    LEFT JOIN
        deck_cache AS dc ON d.id = dc.deck_id

    WHERE
        (TRUE) AND (TRUE)
    GROUP BY
        p.id
    ORDER BY
        num_decks DESC, num_decks DESC, record, name
    LIMIT 0, 20
```

[] (slow_query, 0.6, mysql)

Reported on decksite by mysql-perf

Location Hash: e9f64b3bcb566ad5cecc53e07c76bf47b7122bf1

Request Data ``` Request Method: GET Path: /api/people/?deckType=all&page=0&pageSize=20&q=&seasonId=0 Cookies: ImmutableMultiDict([('hide_intro', 'True'), ('page_size', '20'), ('views', '100'), ('session', '.eJx1UV1vgjAU_S99ZgYoIOxNhwkuLi7xI5vLQipcaxFa1pYNZvzvKy5qsmRvveeec8-9p0eU1iArwoFrdK9lAxYiecX4pcihYpXIryVTmZB5ygyCXCcaYuyHQ2zb2Ilc7KEboxQZKcGwgN-tFqbxv4TxlDasvJqUglLI-8WU4Gcrxw4sVGkq0kaB5KTqBxdpBQdi9II0eu-mShPd456IJZ3DSBW02STRy3b23SXx03oZxq-dvPG1OIC584hIloFSlxq56xZYHCYrv31eLhaPU1yLOOHbYOZ_jvpLoK2ZBJUSE5kT-N4wcqIoHPhRcOv1CQa2F9q2hSTsDLS_GkymwhXaK9pJ8LXRH3iDg28ynq7pIZw3D8bAJFibS97QORZlkN_HoBBmbh-l-S6269C7hc5DU931AjQGIkGik4X-hqeJpGD25U1Znn4A3taihw.ZHjqEw.8ZJfA25kL0dePWryyn6CNs98OLE')]) Endpoint: people_api View Args: {} Person: 219733587300319234 Referrer: https://pennydreadfulmagic.com/seasons/all/people/ Request Data: {} Host: pennydreadfulmagic.com Connection: Keep-Alive Accept-Encoding: gzip X-Forwarded-For: 2600:1006:b064:b32b:6c98:88a7:e453:649e Cf-Ray: 7d09af6a3aa2ad13-ATL X-Forwarded-Proto: https Cf-Visitor: {"scheme":"https"} Sec-Ch-Ua: "Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24" Accept: application/json, text/plain, */* Sec-Ch-Ua-Mobile: ?1 User-Agent: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Mobile Safari/537.36 Sec-Ch-Ua-Platform: "Android" Sec-Fetch-Site: same-origin Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Referer: https://pennydreadfulmagic.com/seasons/all/people/ Accept-Language: en-US,en;q=0.9 Cookie: hide_intro=True; page_size=20; views=100; session=.eJx1UV1vgjAU_S99ZgYoIOxNhwkuLi7xI5vLQipcaxFa1pYNZvzvKy5qsmRvveeec8-9p0eU1iArwoFrdK9lAxYiecX4pcihYpXIryVTmZB5ygyCXCcaYuyHQ2zb2Ilc7KEboxQZKcGwgN-tFqbxv4TxlDasvJqUglLI-8WU4Gcrxw4sVGkq0kaB5KTqBxdpBQdi9II0eu-mShPd456IJZ3DSBW02STRy3b23SXx03oZxq-dvPG1OIC584hIloFSlxq56xZYHCYrv31eLhaPU1yLOOHbYOZ_jvpLoK2ZBJUSE5kT-N4wcqIoHPhRcOv1CQa2F9q2hSTsDLS_GkymwhXaK9pJ8LXRH3iDg28ynq7pIZw3D8bAJFibS97QORZlkN_HoBBmbh-l-S6269C7hc5DU931AjQGIkGik4X-hqeJpGD25U1Znn4A3taihw.ZHjqEw.8ZJfA25kL0dePWryyn6CNs98OLE Cdn-Loop: cloudflare Cf-Connecting-Ip: 2600:1006:b064:b32b:6c98:88a7:e453:649e Cf-Ipcountry: US ```

Labels: decksite

vorpal-buildbot commented 1 year ago

Exceeded slow_query limit (0.7 > 0.5) in mysql: ```

    SELECT
        p.id,
        LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS name,
        p.mtgo_username,
        p.tappedout_username,
        p.mtggoldfish_username,
        p.discord_id,
        p.elo,
        p.locale,
        p.banned,
        SUM(1) AS num_decks,
        SUM(dc.wins) AS wins,
        SUM(dc.losses) AS losses,
        SUM(dc.draws) AS draws,
        SUM(dc.wins - dc.losses) AS record,
        SUM(CASE WHEN dc.wins >= 5 AND dc.losses = 0 AND d.source_id IN (SELECT id FROM source WHERE name = 'League') THEN 1 ELSE 0 END) AS perfect_runs,
        SUM(CASE WHEN d.finish = 1 THEN 1 ELSE 0 END) AS tournament_wins,
        SUM(CASE WHEN d.finish <= 8 THEN 1 ELSE 0 END) AS tournament_top8s,
        IFNULL(ROUND((SUM(dc.wins) / NULLIF(SUM(dc.wins + dc.losses), 0)) * 100, 1), '') AS win_percent,
        SUM(DISTINCT CASE WHEN d.competition_id IS NOT NULL THEN 1 ELSE 0 END) AS num_competitions
    FROM
        person AS p
    LEFT JOIN
        deck AS d ON d.person_id = p.id
    LEFT JOIN
        deck_cache AS dc ON d.id = dc.deck_id

    WHERE
        (TRUE) AND (TRUE)
    GROUP BY
        p.id
    ORDER BY
        num_decks DESC, num_decks DESC, record, name
    LIMIT 0, 20
```

[] (slow_query, 0.7, mysql)

Reported on decksite by mysql-perf

Location Hash: e9f64b3bcb566ad5cecc53e07c76bf47b7122bf1

Request Data ``` Request Method: GET Path: /api/people/?deckType=all&page=0&pageSize=20&q=&seasonId=0 Cookies: ImmutableMultiDict([('page_size', '20'), ('views', '18')]) Endpoint: people_api View Args: {} Person: logged_out Referrer: https://pennydreadfulmagic.com/seasons/all/people/ Request Data: {} Host: pennydreadfulmagic.com Connection: Keep-Alive Accept-Encoding: gzip X-Forwarded-For: 70.124.163.242 Cf-Ray: 7d0ba8bf9da1e7c3-DFW X-Forwarded-Proto: https Cf-Visitor: {"scheme":"https"} Sec-Ch-Ua: "Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114" Accept: application/json, text/plain, */* Sec-Ch-Ua-Mobile: ?0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Sec-Ch-Ua-Platform: "Windows" Sec-Fetch-Site: same-origin Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Referer: https://pennydreadfulmagic.com/seasons/all/people/ Accept-Language: en-US,en;q=0.9,es;q=0.8 Cookie: page_size=20; views=18 Priority: u=1, i Cf-Connecting-Ip: 70.124.163.242 Cf-Ipcountry: US Cdn-Loop: cloudflare ```

Labels: decksite

vorpal-buildbot commented 1 year ago

Exceeded slow_query limit (0.6 > 0.5) in mysql: ```

    SELECT
        p.id,
        LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS name,
        p.mtgo_username,
        p.tappedout_username,
        p.mtggoldfish_username,
        p.discord_id,
        p.elo,
        p.locale,
        p.banned,
        SUM(1) AS num_decks,
        SUM(dc.wins) AS wins,
        SUM(dc.losses) AS losses,
        SUM(dc.draws) AS draws,
        SUM(dc.wins - dc.losses) AS record,
        SUM(CASE WHEN dc.wins >= 5 AND dc.losses = 0 AND d.source_id IN (SELECT id FROM source WHERE name = 'League') THEN 1 ELSE 0 END) AS perfect_runs,
        SUM(CASE WHEN d.finish = 1 THEN 1 ELSE 0 END) AS tournament_wins,
        SUM(CASE WHEN d.finish <= 8 THEN 1 ELSE 0 END) AS tournament_top8s,
        IFNULL(ROUND((SUM(dc.wins) / NULLIF(SUM(dc.wins + dc.losses), 0)) * 100, 1), '') AS win_percent,
        SUM(DISTINCT CASE WHEN d.competition_id IS NOT NULL THEN 1 ELSE 0 END) AS num_competitions
    FROM
        person AS p
    LEFT JOIN
        deck AS d ON d.person_id = p.id
    LEFT JOIN
        deck_cache AS dc ON d.id = dc.deck_id

    WHERE
        (TRUE) AND (TRUE)
    GROUP BY
        p.id
    ORDER BY
        num_decks DESC, num_decks DESC, record, name
    LIMIT 0, 20
```

[] (slow_query, 0.6, mysql)

Reported on decksite by mysql-perf

Location Hash: e9f64b3bcb566ad5cecc53e07c76bf47b7122bf1

Request Data ``` Request Method: GET Path: /api/people/?deckType=all&page=0&pageSize=20&q=&seasonId=0 Cookies: ImmutableMultiDict([('hide_intro', 'True'), ('hide_intro', 'True'), ('session', '.eJx1kdtOwzAMht8l12VK2_W0OxjbQBpMaIJxEKqy1u2ypklJUsZAe3fcodELxF3s3_5tf_kiaQO6ZhKkJSOrW3AIy2suyahgwmCUQ81rlfcxN5nSecoxRaKIRkHs0SBxk2Ho-nFI-gqhMiYAq0Ce3S9R-L-Fy7RsuchPKwhVlpB3qxklj6PiKA4dUttSpa0BLVndOdsN7JjNNjsmc9BopFhrN15qLLOd_knXvt1mYfCxHL5f2mJxvXDnyXQlaj6v1n29VRXgyV-EZRkYc4pJs-Luu_QszCCY0NKb7Lzbp0Kp8ey5eJhiP3w0XINJGdJzwyhyaUj9ZOB7AY2SXu54hnQYU-oQDQWmNr8zqnHYTN6qi5vn2-jtTov9chFfVdn82pxL-ogzkGaDx7yQIyIz2Cq062jin_Fij88fgbw65Gia2n3XQC6AaaRycMgfkJbpEnBn2Qpx-AYhLqe9.ZF68DA.erVB9hvTG0xHzq7Ka8gnHCmHQAs'), ('session', '.eJx1kdtOwzAMht8l12VK2_W0OxjbQBpMaIJxEKqy1u2ypklJUsZAe3fcodELxF3s3_5tf_kiaQO6ZhKkJSOrW3AIy2suyahgwmCUQ81rlfcxN5nSecoxRaKIRkHs0SBxk2Ho-nFI-gqhMiYAq0Ce3S9R-L-Fy7RsuchPKwhVlpB3qxklj6PiKA4dUttSpa0BLVndOdsN7JjNNjsmc9BopFhrN15qLLOd_knXvt1mYfCxHL5f2mJxvXDnyXQlaj6v1n29VRXgyV-EZRkYc4pJs-Luu_QszCCY0NKb7Lzbp0Kp8ey5eJhiP3w0XINJGdJzwyhyaUj9ZOB7AY2SXu54hnQYU-oQDQWmNr8zqnHYTN6qi5vn2-jtTov9chFfVdn82pxL-ogzkGaDx7yQIyIz2Cq062jin_Fij88fgbw65Gia2n3XQC6AaaRycMgfkJbpEnBn2Qpx-AYhLqe9.ZHpbPA.QfyqTVsJgXvsLRf3qLhuQ5J_i7I'), ('page_size', '20'), ('views', '270')]) Endpoint: people_api View Args: {} Person: 770758205919461386 Referrer: https://pennydreadfulmagic.com/seasons/all/people/ Request Data: {} Host: pennydreadfulmagic.com Connection: Keep-Alive Accept-Encoding: gzip X-Forwarded-For: 47.26.243.253 Cf-Ray: 7d12b1d9fcfa6356-ORD X-Forwarded-Proto: https Cf-Visitor: {"scheme":"https"} Sec-Ch-Ua: "Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114" Accept: application/json, text/plain, */* Dnt: 1 Sec-Ch-Ua-Mobile: ?0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Sec-Ch-Ua-Platform: "Windows" Sec-Fetch-Site: same-origin Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Referer: https://pennydreadfulmagic.com/seasons/all/people/ Accept-Language: en-US,en;q=0.9 Cookie: hide_intro=True; hide_intro=True; session=.eJx1kdtOwzAMht8l12VK2_W0OxjbQBpMaIJxEKqy1u2ypklJUsZAe3fcodELxF3s3_5tf_kiaQO6ZhKkJSOrW3AIy2suyahgwmCUQ81rlfcxN5nSecoxRaKIRkHs0SBxk2Ho-nFI-gqhMiYAq0Ce3S9R-L-Fy7RsuchPKwhVlpB3qxklj6PiKA4dUttSpa0BLVndOdsN7JjNNjsmc9BopFhrN15qLLOd_knXvt1mYfCxHL5f2mJxvXDnyXQlaj6v1n29VRXgyV-EZRkYc4pJs-Luu_QszCCY0NKb7Lzbp0Kp8ey5eJhiP3w0XINJGdJzwyhyaUj9ZOB7AY2SXu54hnQYU-oQDQWmNr8zqnHYTN6qi5vn2-jtTov9chFfVdn82pxL-ogzkGaDx7yQIyIz2Cq062jin_Fij88fgbw65Gia2n3XQC6AaaRycMgfkJbpEnBn2Qpx-AYhLqe9.ZF68DA.erVB9hvTG0xHzq7Ka8gnHCmHQAs; page_size=20; session=.eJx1kdtOwzAMht8l12VK2_W0OxjbQBpMaIJxEKqy1u2ypklJUsZAe3fcodELxF3s3_5tf_kiaQO6ZhKkJSOrW3AIy2suyahgwmCUQ81rlfcxN5nSecoxRaKIRkHs0SBxk2Ho-nFI-gqhMiYAq0Ce3S9R-L-Fy7RsuchPKwhVlpB3qxklj6PiKA4dUttSpa0BLVndOdsN7JjNNjsmc9BopFhrN15qLLOd_knXvt1mYfCxHL5f2mJxvXDnyXQlaj6v1n29VRXgyV-EZRkYc4pJs-Luu_QszCCY0NKb7Lzbp0Kp8ey5eJhiP3w0XINJGdJzwyhyaUj9ZOB7AY2SXu54hnQYU-oQDQWmNr8zqnHYTN6qi5vn2-jtTov9chFfVdn82pxL-ogzkGaDx7yQIyIz2Cq062jin_Fij88fgbw65Gia2n3XQC6AaaRycMgfkJbpEnBn2Qpx-AYhLqe9.ZHpbPA.QfyqTVsJgXvsLRf3qLhuQ5J_i7I; views=270 Priority: u=1, i Cdn-Loop: cloudflare Cf-Connecting-Ip: 47.26.243.253 Cf-Ipcountry: US ```

Labels: decksite

vorpal-buildbot commented 1 year ago

Exceeded slow_query limit (0.7 > 0.5) in mysql: ```

    SELECT
        p.id,
        LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS name,
        p.mtgo_username,
        p.tappedout_username,
        p.mtggoldfish_username,
        p.discord_id,
        p.elo,
        p.locale,
        p.banned,
        SUM(1) AS num_decks,
        SUM(dc.wins) AS wins,
        SUM(dc.losses) AS losses,
        SUM(dc.draws) AS draws,
        SUM(dc.wins - dc.losses) AS record,
        SUM(CASE WHEN dc.wins >= 5 AND dc.losses = 0 AND d.source_id IN (SELECT id FROM source WHERE name = 'League') THEN 1 ELSE 0 END) AS perfect_runs,
        SUM(CASE WHEN d.finish = 1 THEN 1 ELSE 0 END) AS tournament_wins,
        SUM(CASE WHEN d.finish <= 8 THEN 1 ELSE 0 END) AS tournament_top8s,
        IFNULL(ROUND((SUM(dc.wins) / NULLIF(SUM(dc.wins + dc.losses), 0)) * 100, 1), '') AS win_percent,
        SUM(DISTINCT CASE WHEN d.competition_id IS NOT NULL THEN 1 ELSE 0 END) AS num_competitions
    FROM
        person AS p
    LEFT JOIN
        deck AS d ON d.person_id = p.id
    LEFT JOIN
        deck_cache AS dc ON d.id = dc.deck_id

    WHERE
        (TRUE) AND (TRUE)
    GROUP BY
        p.id
    ORDER BY
        num_decks DESC, num_decks DESC, record, name
    LIMIT 0, 20
```

[] (slow_query, 0.7, mysql)

Reported on decksite by mysql-perf

Location Hash: e9f64b3bcb566ad5cecc53e07c76bf47b7122bf1

Request Data ``` Request Method: GET Path: /api/people/?deckType=all&page=0&pageSize=20&q=&seasonId=0 Cookies: ImmutableMultiDict([('views', '2818'), ('hide_intro', 'True'), ('page_size', '20'), ('session', '.eJx1UcluwjAU_BefU5TVSbhReuhCCgKVpVUVWYkTTByb2g4NIP69L0g0h6rHecvMvHlnlO6pqomgwqChUQ21EMlrJtCwIFwDymnNapn3mOlMqjxlUEKe49muH-IgjrBrx2Hson6Cy4xwClNU3L0toPH_ChNp2TCe3yxwWZY076xpKa5SkW37FqpNKdNGUyVI3TFrkilmpAIKSRqzdVNtiOk6PDuQiVluno_Gwatx9To7LtuqqLxi5D3O-3kjKwrHnhHJMqr1DaOt_d2eXtokCw_C7DbJqeHNtJrmajYl606PtnumqE4J5ObgyPeCENvhIHJiF2Pc97sose2DfwspWkBp-yuyWJukXD0tysPcqQITJGNRP3xNRhKHQf4OIhDkHq75gOjgQaw4Qu0alB7sJDDfEPq00JU0NcduAd1ToqhCFwv9ydAQVVIwLRrOLz_Id6cd.ZH0g9w.HBkVb3ISXCgyw7lpwepViKWo4_M'), ('deck_id', '215703')]) Endpoint: people_api View Args: {} Person: 313024765986209792 Referrer: https://pennydreadfulmagic.com/seasons/all/people/ Request Data: {} Host: pennydreadfulmagic.com Connection: Keep-Alive Accept-Encoding: gzip X-Forwarded-For: 45.85.144.217 Cf-Ray: 7d2405ae49606fd9-IAD X-Forwarded-Proto: https Cf-Visitor: {"scheme":"https"} User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0 Accept: application/json, text/plain, */* Accept-Language: en-US,en;q=0.5 Dnt: 1 Referer: https://pennydreadfulmagic.com/seasons/all/people/ Sec-Fetch-Dest: empty Sec-Fetch-Mode: cors Sec-Fetch-Site: same-origin Sec-Gpc: 1 Cookie: views=2818; hide_intro=True; page_size=20; session=.eJx1UcluwjAU_BefU5TVSbhReuhCCgKVpVUVWYkTTByb2g4NIP69L0g0h6rHecvMvHlnlO6pqomgwqChUQ21EMlrJtCwIFwDymnNapn3mOlMqjxlUEKe49muH-IgjrBrx2Hson6Cy4xwClNU3L0toPH_ChNp2TCe3yxwWZY076xpKa5SkW37FqpNKdNGUyVI3TFrkilmpAIKSRqzdVNtiOk6PDuQiVluno_Gwatx9To7LtuqqLxi5D3O-3kjKwrHnhHJMqr1DaOt_d2eXtokCw_C7DbJqeHNtJrmajYl606PtnumqE4J5ObgyPeCENvhIHJiF2Pc97sose2DfwspWkBp-yuyWJukXD0tysPcqQITJGNRP3xNRhKHQf4OIhDkHq75gOjgQaw4Qu0alB7sJDDfEPq00JU0NcduAd1ToqhCFwv9ydAQVVIwLRrOLz_Id6cd.ZH0g9w.HBkVb3ISXCgyw7lpwepViKWo4_M; deck_id=215703 Cdn-Loop: cloudflare Cf-Connecting-Ip: 45.85.144.217 Cf-Ipcountry: US ```

Labels: decksite

vorpal-buildbot commented 1 year ago

Exceeded slow_query limit (0.7 > 0.5) in mysql: ```

    SELECT
        p.id,
        LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS name,
        p.mtgo_username,
        p.tappedout_username,
        p.mtggoldfish_username,
        p.discord_id,
        p.elo,
        p.locale,
        p.banned,
        SUM(1) AS num_decks,
        SUM(dc.wins) AS wins,
        SUM(dc.losses) AS losses,
        SUM(dc.draws) AS draws,
        SUM(dc.wins - dc.losses) AS record,
        SUM(CASE WHEN dc.wins >= 5 AND dc.losses = 0 AND d.source_id IN (SELECT id FROM source WHERE name = 'League') THEN 1 ELSE 0 END) AS perfect_runs,
        SUM(CASE WHEN d.finish = 1 THEN 1 ELSE 0 END) AS tournament_wins,
        SUM(CASE WHEN d.finish <= 8 THEN 1 ELSE 0 END) AS tournament_top8s,
        IFNULL(ROUND((SUM(dc.wins) / NULLIF(SUM(dc.wins + dc.losses), 0)) * 100, 1), '') AS win_percent,
        SUM(DISTINCT CASE WHEN d.competition_id IS NOT NULL THEN 1 ELSE 0 END) AS num_competitions
    FROM
        person AS p
    LEFT JOIN
        deck AS d ON d.person_id = p.id
    LEFT JOIN
        deck_cache AS dc ON d.id = dc.deck_id

    WHERE
        (TRUE) AND (TRUE)
    GROUP BY
        p.id
    ORDER BY
        num_decks DESC, num_decks DESC, record, name
    LIMIT 0, 20
```

[] (slow_query, 0.7, mysql)

Reported on decksite by mysql-perf

Location Hash: e9f64b3bcb566ad5cecc53e07c76bf47b7122bf1

Request Data ``` Request Method: GET Path: /api/people/?deckType=all&page=0&pageSize=20&q=&seasonId=0 Cookies: ImmutableMultiDict([('hide_intro', 'True'), ('session', '.eJx1UV1PwkAQ_C_3jKSFlh68oaJgBEwJiBjTHO22nNwH3l1BQvjvbjHAg_Htdmd3ZnbuQJINGMkUKEc6zpRQIyyTXJFOzoTFKgPJpc7OYMZtqk2WcOyQIKStoNGOQhoFNAqb7ZBcJ4ROmQCcAnUznSDw_wpXSVFycRERuiggq5xZrU5StEG9GpGu0ElpwSgmK-aMOaOXXGnk0Kx0q0ZiHXMV1Jc5HQ7zeNmH3aoraPwmp6IsnvPH1wZPr_NOrwGPPRCWpmDtuSa6F_aD-0Xub4N4PpYDL57Ezcl8tHugdtHDffjecAM2YZib36J-5IV4WJ1G1Gv60RWvomx5AfXQv4EcW6uLSG_2pAajlf9yZ_bbvTefdXtjv98a-l9rX1MUwSQ3eM07OcVj658a6aok8bt4vsfnL0A-auREmrh9tUBugRkw5Fgjf0J0zBSAplUpxPEHBIiksQ.ZFlt6A.xWfjgoYM6iGsxcX-4foIYGpzMFY'), ('session', '.eJx1UV1PwkAQ_C_3jKSFlh68oaJgBEwJiBjTHO22nNwH3l1BQvjvbjHAg_Htdmd3ZnbuQJINGMkUKEc6zpRQIyyTXJFOzoTFKgPJpc7OYMZtqk2WcOyQIKStoNGOQhoFNAqb7ZBcJ4ROmQCcAnUznSDw_wpXSVFycRERuiggq5xZrU5StEG9GpGu0ElpwSgmK-aMOaOXXGnk0Kx0q0ZiHXMV1Jc5HQ7zeNmH3aoraPwmp6IsnvPH1wZPr_NOrwGPPRCWpmDtuSa6F_aD-0Xub4N4PpYDL57Ezcl8tHugdtHDffjecAM2YZib36J-5IV4WJ1G1Gv60RWvomx5AfXQv4EcW6uLSG_2pAajlf9yZ_bbvTefdXtjv98a-l9rX1MUwSQ3eM07OcVj658a6aok8bt4vsfnL0A-auREmrh9tUBugRkw5Fgjf0J0zBSAplUpxPEHBIiksQ.ZH7ldQ.-DCcWH2jMgQ8rTTW_W525FC8uLM'), ('page_size', '20'), ('deck_id', '217702'), ('views', '210')]) Endpoint: people_api View Args: {} Person: 458642975874875395 Referrer: https://pennydreadfulmagic.com/seasons/all/people/ Request Data: {} Host: pennydreadfulmagic.com Connection: Keep-Alive Accept-Encoding: gzip X-Forwarded-For: 2601:642:c000:42f0:f09d:5668:a6d2:867b Cf-Ray: 7d2f11bbe8db156a-SJC X-Forwarded-Proto: https Cf-Visitor: {"scheme":"https"} Sec-Ch-Ua: "Not.A/Brand";v="8", "Chromium";v="114", "Microsoft Edge";v="114" Accept: application/json, text/plain, */* Sec-Ch-Ua-Mobile: ?0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.37 Sec-Ch-Ua-Platform: "Windows" Sec-Fetch-Site: same-origin Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Referer: https://pennydreadfulmagic.com/seasons/all/people/ Accept-Language: en-US,en;q=0.9 Cookie: hide_intro=True; session=.eJx1UV1PwkAQ_C_3jKSFlh68oaJgBEwJiBjTHO22nNwH3l1BQvjvbjHAg_Htdmd3ZnbuQJINGMkUKEc6zpRQIyyTXJFOzoTFKgPJpc7OYMZtqk2WcOyQIKStoNGOQhoFNAqb7ZBcJ4ROmQCcAnUznSDw_wpXSVFycRERuiggq5xZrU5StEG9GpGu0ElpwSgmK-aMOaOXXGnk0Kx0q0ZiHXMV1Jc5HQ7zeNmH3aoraPwmp6IsnvPH1wZPr_NOrwGPPRCWpmDtuSa6F_aD-0Xub4N4PpYDL57Ezcl8tHugdtHDffjecAM2YZib36J-5IV4WJ1G1Gv60RWvomx5AfXQv4EcW6uLSG_2pAajlf9yZ_bbvTefdXtjv98a-l9rX1MUwSQ3eM07OcVj658a6aok8bt4vsfnL0A-auREmrh9tUBugRkw5Fgjf0J0zBSAplUpxPEHBIiksQ.ZFlt6A.xWfjgoYM6iGsxcX-4foIYGpzMFY; page_size=20; deck_id=217702; views=210; session=.eJx1UV1PwkAQ_C_3jKSFlh68oaJgBEwJiBjTHO22nNwH3l1BQvjvbjHAg_Htdmd3ZnbuQJINGMkUKEc6zpRQIyyTXJFOzoTFKgPJpc7OYMZtqk2WcOyQIKStoNGOQhoFNAqb7ZBcJ4ROmQCcAnUznSDw_wpXSVFycRERuiggq5xZrU5StEG9GpGu0ElpwSgmK-aMOaOXXGnk0Kx0q0ZiHXMV1Jc5HQ7zeNmH3aoraPwmp6IsnvPH1wZPr_NOrwGPPRCWpmDtuSa6F_aD-0Xub4N4PpYDL57Ezcl8tHugdtHDffjecAM2YZib36J-5IV4WJ1G1Gv60RWvomx5AfXQv4EcW6uLSG_2pAajlf9yZ_bbvTefdXtjv98a-l9rX1MUwSQ3eM07OcVj658a6aok8bt4vsfnL0A-auREmrh9tUBugRkw5Fgjf0J0zBSAplUpxPEHBIiksQ.ZH7ldQ.-DCcWH2jMgQ8rTTW_W525FC8uLM Priority: u=1, i Cdn-Loop: cloudflare Cf-Connecting-Ip: 2601:642:c000:42f0:f09d:5668:a6d2:867b Cf-Ipcountry: US ```

Labels: decksite