PennyDreadfulMTG / perf-reports

2 stars 2 forks source link

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

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
        (p.mtgo_username IS NOT NULL) AND (TRUE)
    GROUP BY
        p.id
    ORDER BY
        num_decks DESC, p.name

```

[] (slow_query, 0.6, mysql)

Reported on decksite by mysql-perf

Location Hash: 01aae12dc8f38d75e57a442456edf11ee25dd36d

Request Data ``` Request Method: GET Path: /matchups/?season_id=&hero_archetype_id=&hero_person_id=10393&hero_card=Phyrexian+Dreadnought&enemy_archetype_id=&enemy_person_id=&enemy_card= Cookies: ImmutableMultiDict([('hide_intro', 'True'), ('session', '.eJx1UctqwzAQ_Jc9u0WWEz9yzIOSHkogr9JSjBKtHWFbCpLs1gn598qG1IXS4-zOaGZHV0jPqCsmUVqYWF2jB4xXQsIkY6VxiGMlKsUHLMxRaZ4KN4IkoIQGoR-QUez7YxoQGBilOrISHQvlw3btFv9LhEzzWpT8HuGXFDqU58i7oEbJ3tgnQRJ4UNlcpbVBLVnVsTPGleJO6IFitT3R1Fhmu83yED7Nop3ZhWuM943FUo0UuxT7yzh7fRn4VhXOcnIFdjyiMXcMtN5VWCQNrmS72eXN_M0vln68jBo0i6nT49dZaDQpczX6YUwIDck4eEwojaNwWHfFhu5yQjzQmLnR6ccjCVpzeF5ttlNGZ_NWkM_DIloteO1n69eD83C1nt0x79B3ZfpG3b-JrIUPD_pnUtt2FJgi06jh5sHf1izTObqYsi7L2zfNNqTC.ZEhclQ.9Gh1xZ8AfbA-w7p9ufr7sHcxgNY'), ('session', '.eJx1UctqwzAQ_Jc9u0WWEz9yzIOSHkogr9JSjBKtHWFbCpLs1gn598qG1IXS4-zOaGZHV0jPqCsmUVqYWF2jB4xXQsIkY6VxiGMlKsUHLMxRaZ4KN4IkoIQGoR-QUez7YxoQGBilOrISHQvlw3btFv9LhEzzWpT8HuGXFDqU58i7oEbJ3tgnQRJ4UNlcpbVBLVnVsTPGleJO6IFitT3R1Fhmu83yED7Nop3ZhWuM943FUo0UuxT7yzh7fRn4VhXOcnIFdjyiMXcMtN5VWCQNrmS72eXN_M0vln68jBo0i6nT49dZaDQpczX6YUwIDck4eEwojaNwWHfFhu5yQjzQmLnR6ccjCVpzeF5ttlNGZ_NWkM_DIloteO1n69eD83C1nt0x79B3ZfpG3b-JrIUPD_pnUtt2FJgi06jh5sHf1izTObqYsi7L2zfNNqTC.ZGhHdw.7d3gFG607KTQp_T-f68a47a7KWU'), ('deck_id', '216316'), ('page_size', '20'), ('views', '331')]) Endpoint: matchups View Args: {} Person: 932023613048115230 Referrer: https://pennydreadfulmagic.com/matchups/ Request Data: {} Host: pennydreadfulmagic.com Connection: Keep-Alive Accept-Encoding: gzip X-Forwarded-For: 2601:98a:c100:fb50:56b:4241:9f0f:86c1 Cf-Ray: 7ca1b789bd952d07-IAD X-Forwarded-Proto: https Cf-Visitor: {"scheme":"https"} Sec-Ch-Ua: "Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24" Sec-Ch-Ua-Mobile: ?0 Sec-Ch-Ua-Platform: "Windows" Upgrade-Insecure-Requests: 1 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 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 Sec-Fetch-Site: same-origin Sec-Fetch-Mode: navigate Sec-Fetch-User: ?1 Sec-Fetch-Dest: document Referer: https://pennydreadfulmagic.com/matchups/ Accept-Language: en-US,en;q=0.9 Cookie: hide_intro=True; session=.eJx1UctqwzAQ_Jc9u0WWEz9yzIOSHkogr9JSjBKtHWFbCpLs1gn598qG1IXS4-zOaGZHV0jPqCsmUVqYWF2jB4xXQsIkY6VxiGMlKsUHLMxRaZ4KN4IkoIQGoR-QUez7YxoQGBilOrISHQvlw3btFv9LhEzzWpT8HuGXFDqU58i7oEbJ3tgnQRJ4UNlcpbVBLVnVsTPGleJO6IFitT3R1Fhmu83yED7Nop3ZhWuM943FUo0UuxT7yzh7fRn4VhXOcnIFdjyiMXcMtN5VWCQNrmS72eXN_M0vln68jBo0i6nT49dZaDQpczX6YUwIDck4eEwojaNwWHfFhu5yQjzQmLnR6ccjCVpzeF5ttlNGZ_NWkM_DIloteO1n69eD83C1nt0x79B3ZfpG3b-JrIUPD_pnUtt2FJgi06jh5sHf1izTObqYsi7L2zfNNqTC.ZEhclQ.9Gh1xZ8AfbA-w7p9ufr7sHcxgNY; deck_id=216316; page_size=20; views=331; session=.eJx1UctqwzAQ_Jc9u0WWEz9yzIOSHkogr9JSjBKtHWFbCpLs1gn598qG1IXS4-zOaGZHV0jPqCsmUVqYWF2jB4xXQsIkY6VxiGMlKsUHLMxRaZ4KN4IkoIQGoR-QUez7YxoQGBilOrISHQvlw3btFv9LhEzzWpT8HuGXFDqU58i7oEbJ3tgnQRJ4UNlcpbVBLVnVsTPGleJO6IFitT3R1Fhmu83yED7Nop3ZhWuM943FUo0UuxT7yzh7fRn4VhXOcnIFdjyiMXcMtN5VWCQNrmS72eXN_M0vln68jBo0i6nT49dZaDQpczX6YUwIDck4eEwojaNwWHfFhu5yQjzQmLnR6ccjCVpzeF5ttlNGZ_NWkM_DIloteO1n69eD83C1nt0x79B3ZfpG3b-JrIUPD_pnUtt2FJgi06jh5sHf1izTObqYsi7L2zfNNqTC.ZGhHdw.7d3gFG607KTQp_T-f68a47a7KWU Priority: u=0, i Cf-Connecting-Ip: 2601:98a:c100:fb50:56b:4241:9f0f:86c1 Cf-Ipcountry: US Cdn-Loop: cloudflare ```
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
        (p.mtgo_username IS NOT NULL) AND (TRUE)
    GROUP BY
        p.id
    ORDER BY
        num_decks DESC, p.name

```

[] (slow_query, 0.6, mysql)

Reported on decksite by mysql-perf

Location Hash: 01aae12dc8f38d75e57a442456edf11ee25dd36d

Request Data ``` Request Method: GET Path: /matchups/?season_id=&hero_archetype_id=&hero_person_id=10393&hero_card=Phyrexian+Dreadnought&enemy_archetype_id=&enemy_person_id=&enemy_card= Cookies: ImmutableMultiDict([('hide_intro', 'True'), ('session', '.eJx1UctqwzAQ_Jc9u0WWEz9yzIOSHkogr9JSjBKtHWFbCpLs1gn598qG1IXS4-zOaGZHV0jPqCsmUVqYWF2jB4xXQsIkY6VxiGMlKsUHLMxRaZ4KN4IkoIQGoR-QUez7YxoQGBilOrISHQvlw3btFv9LhEzzWpT8HuGXFDqU58i7oEbJ3tgnQRJ4UNlcpbVBLVnVsTPGleJO6IFitT3R1Fhmu83yED7Nop3ZhWuM943FUo0UuxT7yzh7fRn4VhXOcnIFdjyiMXcMtN5VWCQNrmS72eXN_M0vln68jBo0i6nT49dZaDQpczX6YUwIDck4eEwojaNwWHfFhu5yQjzQmLnR6ccjCVpzeF5ttlNGZ_NWkM_DIloteO1n69eD83C1nt0x79B3ZfpG3b-JrIUPD_pnUtt2FJgi06jh5sHf1izTObqYsi7L2zfNNqTC.ZEhclQ.9Gh1xZ8AfbA-w7p9ufr7sHcxgNY'), ('session', '.eJx1UctqwzAQ_Jc9u0WWEz9yzIOSHkogr9JSjBKtHWFbCpLs1gn598qG1IXS4-zOaGZHV0jPqCsmUVqYWF2jB4xXQsIkY6VxiGMlKsUHLMxRaZ4KN4IkoIQGoR-QUez7YxoQGBilOrISHQvlw3btFv9LhEzzWpT8HuGXFDqU58i7oEbJ3tgnQRJ4UNlcpbVBLVnVsTPGleJO6IFitT3R1Fhmu83yED7Nop3ZhWuM943FUo0UuxT7yzh7fRn4VhXOcnIFdjyiMXcMtN5VWCQNrmS72eXN_M0vln68jBo0i6nT49dZaDQpczX6YUwIDck4eEwojaNwWHfFhu5yQjzQmLnR6ccjCVpzeF5ttlNGZ_NWkM_DIloteO1n69eD83C1nt0x79B3ZfpG3b-JrIUPD_pnUtt2FJgi06jh5sHf1izTObqYsi7L2zfNNqTC.ZGhHsQ.Z1Lzfur2JD_50TglDctdp8lcCMw'), ('deck_id', '216316'), ('page_size', '20'), ('views', '335')]) Endpoint: matchups View Args: {} Person: 932023613048115230 Referrer: None Request Data: {} Host: pennydreadfulmagic.com Connection: Keep-Alive Accept-Encoding: gzip X-Forwarded-For: 2601:98a:c100:fb50:56b:4241:9f0f:86c1 Cf-Ray: 7ca1b7c71fc4394a-IAD X-Forwarded-Proto: https Cf-Visitor: {"scheme":"https"} 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 Accept: */* Sec-Fetch-Site: none Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Accept-Language: en-US,en;q=0.9 Cookie: hide_intro=True; session=.eJx1UctqwzAQ_Jc9u0WWEz9yzIOSHkogr9JSjBKtHWFbCpLs1gn598qG1IXS4-zOaGZHV0jPqCsmUVqYWF2jB4xXQsIkY6VxiGMlKsUHLMxRaZ4KN4IkoIQGoR-QUez7YxoQGBilOrISHQvlw3btFv9LhEzzWpT8HuGXFDqU58i7oEbJ3tgnQRJ4UNlcpbVBLVnVsTPGleJO6IFitT3R1Fhmu83yED7Nop3ZhWuM943FUo0UuxT7yzh7fRn4VhXOcnIFdjyiMXcMtN5VWCQNrmS72eXN_M0vln68jBo0i6nT49dZaDQpczX6YUwIDck4eEwojaNwWHfFhu5yQjzQmLnR6ccjCVpzeF5ttlNGZ_NWkM_DIloteO1n69eD83C1nt0x79B3ZfpG3b-JrIUPD_pnUtt2FJgi06jh5sHf1izTObqYsi7L2zfNNqTC.ZEhclQ.9Gh1xZ8AfbA-w7p9ufr7sHcxgNY; deck_id=216316; page_size=20; views=335; session=.eJx1UctqwzAQ_Jc9u0WWEz9yzIOSHkogr9JSjBKtHWFbCpLs1gn598qG1IXS4-zOaGZHV0jPqCsmUVqYWF2jB4xXQsIkY6VxiGMlKsUHLMxRaZ4KN4IkoIQGoR-QUez7YxoQGBilOrISHQvlw3btFv9LhEzzWpT8HuGXFDqU58i7oEbJ3tgnQRJ4UNlcpbVBLVnVsTPGleJO6IFitT3R1Fhmu83yED7Nop3ZhWuM943FUo0UuxT7yzh7fRn4VhXOcnIFdjyiMXcMtN5VWCQNrmS72eXN_M0vln68jBo0i6nT49dZaDQpczX6YUwIDck4eEwojaNwWHfFhu5yQjzQmLnR6ccjCVpzeF5ttlNGZ_NWkM_DIloteO1n69eD83C1nt0x79B3ZfpG3b-JrIUPD_pnUtt2FJgi06jh5sHf1izTObqYsi7L2zfNNqTC.ZGhHsQ.Z1Lzfur2JD_50TglDctdp8lcCMw Priority: u=1, i Cf-Connecting-Ip: 2601:98a:c100:fb50:56b:4241:9f0f:86c1 Cf-Ipcountry: US Cdn-Loop: cloudflare ```

Labels: decksite