PennyDreadfulMTG / perf-reports

2 stars 7 forks source link

Exceeded slow_query limit (296.4 > 100.0) in mysql: ``` #50540

Closed vorpal-buildbot closed 4 years ago

vorpal-buildbot commented 5 years ago
    SELECT
        d.id,
        d.finish,
        d.decklist_hash,
        cache.active_date,
        cache.wins,
        cache.losses,
        cache.draws,
        ct.name AS competition_type_name
    FROM
        deck AS d

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (SELECT deck_id FROM deck_card WHERE card IN ('Vesperlark', 'Dig Through Time', 'Sylvan Advocate', 'Lone Rider', 'Elvish Visionary', 'Lumbering Falls', 'Genesis', 'Emmara, Soul of the Accord', 'Sejiri Refuge', 'Power Sink', 'Tradewind Rider', 'Keldon Megaliths', 'Firebrand Archer', 'Fortified Village', 'Blaze', 'Nostalgic Dreams', 'Sage''s Reverie', 'Crumbling Vestige', 'Oblivion Ring', 'Elvish Promenade', 'Vampire Nighthawk', 'Saddled Rimestag', 'Pyrite Spellbomb', 'Raise the Alarm', 'Overgrown Estate', 'Duskwatch Recruiter', 'Satyr Wayfinder', 'Planar Cleansing', 'Elixir of Immortality', 'Azorius Charm', 'Final Judgment', 'Gavony Township', 'Swift Silence', 'Gyre Sage', 'White Sun''s Zenith', 'Day of Judgment', 'Shimmer of Possibility', 'Bygone Bishop', 'Prophetic Bolt', 'Emeria Angel', 'Research // Development', 'Demonfire', 'Rakdos Cackler', 'Negate', 'Halimar Depths', 'Deep Analysis', 'Quest for Pure Flame', 'Depose // Deploy', 'Strangleroot Geist', 'Perplex', 'Hanweir Garrison', 'Druid of the Cowl', 'Dawn of Hope', 'Terramorphic Expanse', 'Martial Coup', 'Boartusk Liege', 'Deep Forest Hermit', 'Immaculate Magistrate', 'Frantic Search', 'Unbridled Growth', 'Coat of Arms', 'Sandsteppe Outcast', 'Brain Freeze', 'Evolutionary Leap', 'Nantuko Monastery', 'Children of Korlis', 'Meandering River', 'Fact or Fiction', 'Midnight Haunting', 'Glory', 'Mirari''s Wake', 'Saproling Migration', 'Spirit Mantle', 'Rigging Runner', 'Conclave Cavalier', 'Sunscorched Desert', 'Treva''s Ruins', 'Spore Frog', 'Stromkirk Noble', 'Leatherback Baloth', 'Gryff''s Boon', 'Dissolve', 'Glare of Subdual', 'Hordeling Outburst', 'Warleader''s Helix', 'Beck // Call', 'Mystic Monastery', 'Decree of Justice', 'Graypelt Refuge', 'Ash Zealot', 'Viridian Emissary', 'Aspect of Hydra', 'Kessig Prowler', 'Calciform Pools', 'Circular Logic', 'Elsewhere Flask', 'Blisterpod', 'Gruul Turf', 'Burst Lightning', 'Lava Dart', 'Prophet of Kruphix', 'Crush of Wurms', 'Glimmer of Genius', 'Electrolyze', 'Suture Priest', 'Scoured Barrens', 'Vizkopa Guildmage', 'Ethereal Armor', 'Bassara Tower Archer', 'Experiment One', 'Ajani''s Pridemate', 'Seal of Fire', 'Guild Globe', 'Survival Cache', 'Song of Freyalise', 'Unflinching Courage', 'Vivid Meadow', 'Rugged Highlands', 'Village Messenger', 'Gatherer of Graces', 'Chandra''s Spitfire', 'Izzet Charm', 'Sanguine Bond', 'Condemn', 'Wolfbitten Captive', 'Sylvan Ranger', 'Firedrinker Satyr', 'Avacyn''s Pilgrim', 'Armadillo Cloak', 'Think Twice', 'Needle Spires', 'Magus of the Scroll', 'Dwynen, Gilt-Leaf Daen', 'Supply // Demand', 'Shadowblood Egg', 'Swiftwater Cliffs', 'Elvish Guidance', 'Fiend Hunter', 'Sterling Grove', 'Verity Circle', 'Mana Leak', 'Vessel of Volatility', 'Arc Trail', 'Blossoming Sands', 'Forsake the Worldly', 'Hellrider', 'Archaeological Dig', 'Goblin Wardriver', 'Cryptolith Rite', 'Forbid', 'Urza''s Factory', 'Second Sunrise', 'Regrowth', 'Reverent Hunter', 'Gladecover Scout', 'Desolate Lighthouse', 'Encroaching Wastes', 'Wall of Blossoms', 'Marwyn, the Nurturer', 'Silhana Ledgewalker', 'Need for Speed', 'Skinshifter', 'Evolving Wilds', 'Goblin Fireslinger', 'Stormblood Berserker', 'Den Protector', 'Clan Defiance', 'Soul Warden', 'Tranquil Cove', 'Plunge into Darkness', 'Sylvan Messenger', 'Spider Umbra', 'Rogue Elephant', 'Vivid Grove', 'Urban Utopia', 'Future Sight'))) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

```

[] (slow_query, 296.4, mysql)

Reported on decksite by mysql-perf

Location Hash: 7b354949266b9e69344a3132845955552683b0e7

vorpal-buildbot commented 5 years ago

Exceeded slow_query limit (115.5 > 100.0) in mysql: ```

    SELECT
        d.id,
        d.finish,
        d.decklist_hash,
        cache.active_date,
        cache.wins,
        cache.losses,
        cache.draws,
        ct.name AS competition_type_name
    FROM
        deck AS d

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (SELECT deck_id FROM deck_card WHERE card IN ('Magister of Worth', 'Nephalia Drownyard', 'Vitu-Ghazi, the City-Tree', 'Riot Control', 'Bottled Cloister', 'Honored Hydra', 'Slagstorm', 'Bane of Bala Ged', 'Den Protector', 'Hand of Emrakul', 'Telling Time', 'Ivory Tower', 'Arc Trail', 'Fortified Village', 'Marwyn, the Nurturer', 'Coat of Arms', 'Searing Spear', 'Confirm Suspicions', 'Extinguish All Hope', 'Saproling Migration', 'Aspect of Hydra', 'Altar''s Reap', 'Strangleroot Geist', 'Incendiary Flow', 'Overgrown Estate', 'Akroma, Angel of Fury', 'Silkwrap', 'Chandra''s Spitfire', 'Ultimate Price', 'Lonely Sandbar', 'Talisman of Hierarchy', 'Noose Constrictor', 'Wolfbitten Captive', 'Lazotep Reaver', 'Fiery Temper', 'Pathrazer of Ulamog', 'Dissolve', 'Remove Soul', 'Izzet Charm', 'Strategic Planning', 'Sandsteppe Outcast', 'White Sun''s Zenith', 'Burglar Rat', 'Vivid Marsh', 'Blossoming Sands', 'Blisterpod', 'Gonti, Lord of Luxury', 'Dread Return', 'Lumbering Battlement', 'Yavimaya Elder', 'Shimmer of Possibility', 'Experiment One', 'Woodland Wanderer', 'Opulent Palace', 'Executioner''s Capsule', 'Day of Judgment', 'Holy Day', 'Elvish Guidance', 'Beck // Call', 'Plumeveil', 'Dead Weight', 'Mystifying Maze', 'Duskwatch Recruiter', 'Cryptolith Rite', 'Leyline Prowler', 'Sylvan Awakening', 'Oona''s Grace', 'Summary Dismissal', 'Tendrils of Agony', 'Dreadship Reef', 'Glimmer of Genius', 'Chandra, the Firebrand', 'Sprouting Vines', 'Fact or Fiction', 'Need for Speed', 'Ajani''s Pridemate', 'Foresee', 'Jungle Hollow', 'Satyr Wayfinder', 'Scoured Barrens', 'Burst Lightning', 'Rugged Highlands', 'World Shaper', 'Swiftwater Cliffs', 'Ahn-Crop Crasher', 'Urza''s Rage', 'Splendid Reclamation', 'Vizkopa Guildmage', 'Careful Consideration', 'Gaea''s Blessing', 'Crush of Wurms', 'Turnabout', 'Catacomb Sifter', 'Golgari Guildgate', 'Complicate', 'Spore Frog', 'Lava Dart', 'Conduit of Ruin', 'Lord of the Undead', 'Memorial to Genius', 'Man-o''-War', 'Forbidding Spirit', 'Sejiri Refuge', 'Nantuko Monastery', 'Sanguine Bond', 'Crumbling Vestige', 'Elsewhere Flask', 'High Alert', 'Svogthos, the Restless Tomb', 'Su-Chi', 'Vesperlark', 'Rakdos Cackler', 'Gelatinous Genesis', 'Submerged Boneyard', 'Wonder', 'Gruul Turf', 'Nature''s Lore', 'Forsake the Worldly', 'Final Judgment', 'Soulsworn Jury', 'Vessel of Volatility', 'Fleecemane Lion', 'Turn Aside', 'Warleader''s Helix', 'Kuldotha Forgemaster', 'Druid of the Cowl', 'Perimeter Captain', 'Elixir of Immortality', 'Evolutionary Leap', 'Hanweir Garrison', 'Brain Freeze', 'Moment of Silence', 'Bazaar Trademage', 'Tyrant''s Scorn', 'Caustic Tar', 'Dusk Legion Zealot', 'Gargoyle Castle', 'Dimir Guildgate', 'Encroaching Wastes', 'Glory', 'Kessig Prowler', 'Wharf Infiltrator', 'Emmara, Soul of the Accord', 'Think Twice', 'Zhalfirin Void', 'Deathspore Thallid', 'Wakestone Gargoyle', 'Vivid Creek', 'Howling Mine', 'Forgotten Cave', 'Dawn of Hope', 'Gatherer of Graces', 'Exclude', 'Archaeological Dig', 'Azorius Charm', 'Fiend Hunter', 'Precognitive Perception', 'Saddled Rimestag', 'Supply // Demand', 'Research // Development', 'Sphinx of the Final Word', 'Mirari''s Wake', 'Raise the Alarm', 'Artisan of Kozilek', 'Pyrite Spellbomb', 'Depose // Deploy', 'Unflinching Courage', 'Glare of Subdual', 'Comparative Analysis', 'Gryff''s Boon', 'Firedrinker Satyr', 'Early Harvest', 'Porcelain Legionnaire', 'Armadillo Cloak', 'Skinshifter', 'Wing Shards', 'Second Sunrise', 'Vivid Grove', 'Putrefy', 'Tranquil Cove', 'Quicksand', 'Demonfire', 'Calciform Pools', 'Mimic Vat', 'Urza''s Factory', 'Consume the Meek', 'Krosan Tusker', 'Blaze', 'Cathodion', 'Chandra Nalaar', 'Perplex', 'Nostalgic Dreams', 'Ugin''s Conjurant', 'Reckless Wurm', 'Gavony Township', 'Memory Lapse', 'Treva''s Ruins', 'Epochrasite', 'Elvish Promenade', 'Fairgrounds Warden', 'Leatherback Baloth', 'Thaumatic Compass', 'Mana Leak', 'Grim Backwoods', 'Thopter Spy Network', 'Firebrand Archer', 'Pirate''s Pillage', 'Boartusk Liege', 'Tomb of the Spirit Dragon', 'Regrowth', 'Stormblood Berserker', 'Journey to Eternity', 'Sylvan Ranger', 'Dryad Greenseeker', 'Ghitu Encampment', 'Ivory Mask', 'Song of Freyalise', 'Genesis', 'Graypelt Refuge', 'Yavimaya Hollow', 'Dissipate', 'Rigging Runner', 'Rampant Growth', 'Makeshift Mannequin', 'Carrion Feeder', 'Midnight Haunting', 'Spirit Mantle', 'Negate', 'Possessed Portal', 'Utter End', 'Plunge into Darkness', 'Crumbling Necropolis', 'Prophetic Bolt', 'Halimar Depths', 'Meandering River', 'Gladecover Scout', 'Nevermaker', 'Goblin Wardriver', 'Ludevic''s Test Subject', 'Stromkirk Noble', 'Sage''s Reverie', 'Psychotrope Thallid', 'Miren, the Moaning Well', 'Bygone Bishop', 'Hindering Light', 'Chemister''s Insight', 'Basking Rootwalla', 'Circular Logic', 'Urban Utopia', 'Reverent Hunter', 'Kasmina, Enigmatic Mentor', 'Pollen Lullaby', 'Soulherder', 'Vivid Meadow', 'Suture Priest', 'Village Messenger', 'Izoni, Thousand-Eyed', 'Electrolyze', 'Magma Spray', 'Quench', 'Needle Spires', 'Awakening Zone', 'Myr Incubator', 'Creeping Renaissance', 'Seal of Fire', 'Ravenous Chupacabra', 'Arboreal Grazer', 'Scour All Possibilities', 'Oblivion Ring', 'Ash Zealot', 'Dimir Signet', 'Oona, Queen of the Fae', 'Stalwart Shield-Bearers', 'Phyrexian Rager', 'Treasure Cruise', 'Elvish Visionary', 'Sultai Charm', 'Swift Silence', 'Undead Augur', 'Immaculate Magistrate', 'Eternal Taskmaster', 'Zombify', 'Loxodon Smiter', 'Foundry of the Consuls', 'Tradewind Rider', 'Frontier Bivouac', 'Ishkanah, Grafwidow', 'Varolz, the Scar-Striped', 'Verity Circle', 'Roast', 'Frantic Search', 'Duress', 'Deep Forest Hermit', 'Rune Snag', 'Magus of the Scroll', 'Chronomantic Escape', 'Soul Warden', 'Hero''s Downfall', 'Dwynen, Gilt-Leaf Daen', 'Oath of Jace', 'Changeling Outcast', 'Magus of the Bazaar', 'Spider Umbra', 'Sterling Grove', 'Brave the Sands', 'Vigor Mortis', 'Culling Dais', 'Wall of Denial', 'Condemn', 'Martial Coup', 'Abbot of Keral Keep', 'Rogue Refiner', 'Syncopate', 'Wretched Banquet', 'Doomfall', 'Sapling of Colfenor', 'Planar Cleansing', 'Clan Defiance', 'Deep Analysis', 'Nether Spirit', 'Quest for Pure Flame', 'Firebolt', 'Future Sight', 'Deathgorge Scavenger', 'Distended Mindbender', 'Emeria Angel', 'Gyre Sage', 'Bassara Tower Archer', 'Plaguecrafter', 'Dark Salvation', 'Huatli, the Sun''s Heart', 'Smothering Abomination', 'Unbridled Growth', 'Decree of Justice', 'Barren Moor', 'Lone Rider', 'Hellrider', 'Dread Statuary', 'Seasons Past', 'Arch of Orazca', 'Rogue Elephant', 'Cemetery Reaper', 'Sylvan Messenger', 'Peace Talks', 'Foundry Inspector', 'Elder Deep-Fiend', 'Ethereal Armor', 'Violent Eruption', 'Silhana Ledgewalker', 'Transgress the Mind', 'Avacyn''s Pilgrim', 'Bloodrage Brawler', 'Lake of the Dead', 'Cloudblazer', 'Plague Boiler', 'Talisman of Conviction', 'Grateful Apparition', 'Niveous Wisps', 'Forbidden Alchemy', 'Viridian Emissary', 'Prophet of Kruphix', 'Conclave Cavalier', 'Elvish Rejuvenator', 'Azorius Signet', 'Woodland Stream', 'Sunscorched Desert', 'Disdainful Stroke', 'Vessel of Nascency', 'Hopeful Eidolon', 'Familiar''s Ruse', 'Hordeling Outburst', 'Sea Gate Wreckage', 'Izzet Guildgate', 'Lumbering Falls', 'Dimir Charm', 'Goblin Fireslinger', 'Watcher for Tomorrow', 'Dig Through Time', 'Find // Finality', 'Vampire Nighthawk', 'Liliana''s Mastery', 'Teyo, the Shieldmage', 'Entomber Exarch', 'Cathedral Membrane', 'Ayula''s Influence', 'Diregraf Colossus', 'Blessed Alliance', 'Survival Cache', 'Sylvan Advocate', 'Guild Globe', 'Skyscribing', 'Diregraf Ghoul', 'Desolate Lighthouse', 'Scrabbling Claws', 'Mystic Monastery', 'Aven Riftwatcher', 'Forbid', 'Ephemerate', 'Harrow', 'Drogskol Captain', 'Keldon Megaliths', 'Pulse of the Fields', 'Shadowblood Egg', 'Shock', 'Terramorphic Expanse', 'Lodestone Golem', 'Power Sink', 'Wall of Blossoms', 'Fight with Fire', 'Arcane Sanctum', 'Flood Plain', 'Moorland Haunt', 'Golgari Findbroker', 'Children of Korlis', 'Evolving Wilds'))) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

```

[] (slow_query, 115.5, mysql)

Reported on decksite by mysql-perf

Location Hash: 7b354949266b9e69344a3132845955552683b0e7

Labels: decksite

vorpal-buildbot commented 5 years ago

Exceeded slow_query limit (233.1 > 100.0) in mysql: ```

    SELECT
        d.id,
        d.finish,
        d.decklist_hash,
        cache.active_date,
        cache.wins,
        cache.losses,
        cache.draws,
        ct.name AS competition_type_name
    FROM
        deck AS d

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (SELECT deck_id FROM deck_card WHERE card IN ('Lumbering Battlement', 'Krosan Tusker', 'Crypt of Agadeem', 'Artisan of Kozilek', 'Oblivion Ring', 'Transgress the Mind', 'Rune Snag', 'Familiar''s Ruse', 'Ultimate Price', 'Pulse of the Fields', 'Kazuul Warlord', 'Circular Logic', 'Drover of the Mighty', 'Future Sight', 'Genesis', 'Captain''s Claws', 'Mana Leak', 'Deathspore Thallid', 'Forsake the Worldly', 'Sprouting Vines', 'Tradewind Rider', 'Emmara, Soul of the Accord', 'Aspect of Hydra', 'Urza''s Factory', 'Gonti, Lord of Luxury', 'Overgrown Estate', 'Day of Judgment', 'Glimmer of Genius', 'Strategic Planning', 'Elsewhere Flask', 'Pirate''s Pillage', 'Howling Mine', 'Dryad Greenseeker', 'Needle Spires', 'Evolutionary Leap', 'Bottled Cloister', 'Druid of the Cowl', 'Cathedral Membrane', 'Comparative Analysis', 'Sultai Charm', 'Plunge into Darkness', 'Blisterpod', 'Coat of Arms', 'Grim Backwoods', 'Magus of the Scroll', 'Firebolt', 'Ludevic''s Test Subject', 'Akroma, Angel of Fury', 'Vivid Marsh', 'Vigor Mortis', 'Remove Soul', 'Kuldotha Forgemaster', 'Wonder', 'Rakdos Cackler', 'Tomb of the Spirit Dragon', 'Possessed Portal', 'Su-Chi', 'Village Messenger', 'Rampant Growth', 'Confirm Suspicions', 'Needletooth Raptor', 'Rogue Refiner', 'Forbid', 'Lord of the Undead', 'Pathrazer of Ulamog', 'Dusk Legion Zealot', 'Moment of Silence', 'Dig Through Time', 'Lantern Scout', 'Silhana Ledgewalker', 'Magus of the Bazaar', 'Sanguine Bond', 'Talisman of Conviction', 'Barren Moor', 'Kasmina, Enigmatic Mentor', 'Ishkanah, Grafwidow', 'Rugged Highlands', 'Oona''s Grace', 'Nantuko Monastery', 'Brain Freeze', 'World Shaper', 'Meandering River', 'Turn Aside', 'Savage Stomp', 'Magma Spray', 'Terramorphic Expanse', 'Mystic Monastery', 'Duskwatch Recruiter', 'Epochrasite', 'Ghitu Encampment', 'Dissolve', 'Conflagrate', 'Negate', 'Dawn of Hope', 'Woodland Stream', 'Quest for Pure Flame', 'Wolfbitten Captive', 'Forbidden Alchemy', 'Vizkopa Guildmage', 'Forgotten Cave', 'Graypelt Refuge', 'Second Sunrise', 'Teyo, the Shieldmage', 'Stromkirk Noble', 'Encroaching Wastes', 'Peace Talks', 'Miren, the Moaning Well', 'Forerunner of the Empire', 'Lodestone Golem', 'Bojuka Brigand', 'Chandra, the Firebrand', 'Complicate', 'Seasons Past', 'Strangleroot Geist', 'Urban Utopia', 'Depose // Deploy', 'Raise the Alarm', 'Soulsworn Jury', 'Azorius Charm', 'Submerged Boneyard', 'Frilled Deathspitter', 'Expedition Envoy', 'Desolate Lighthouse', 'Mirari''s Wake', 'Viridian Emissary', 'Chemister''s Insight', 'Burglar Rat', 'Goblin Fireslinger', 'Sandsteppe Outcast', 'Fiend Hunter', 'Scour All Possibilities', 'Vitu-Ghazi, the City-Tree', 'Scoured Barrens', 'Experiment One', 'Crumbling Vestige', 'Glory', 'Gatherer of Graces', 'Harrow', 'Utter End', 'Lazotep Reaver', 'Sylvan Advocate', 'Nomad Outpost', 'Saproling Migration', 'Knight of the Stampede', 'Vesperlark', 'Aven Riftwatcher', 'Prophet of Kruphix', 'Culling Dais', 'Izzet Guildgate', 'Keldon Megaliths', 'Gargoyle Castle', 'Ayula''s Influence', 'Syncopate', 'Cathodion', 'Final Judgment', 'Treva''s Ruins', 'Elvish Promenade', 'Radiant Flames', 'Satyr Wayfinder', 'Lumbering Falls', 'Wharf Infiltrator', 'Cruel Celebrant', 'Gyre Sage', 'Conduit of Ruin', 'Arch of Orazca', 'Noose Constrictor', 'Reckless Wurm', 'Fight with Fire', 'Counterflux', 'Elvish Visionary', 'Scrabbling Claws', 'Lake of the Dead', 'Children of Korlis', 'Gryff''s Boon', 'Slagstorm', 'Ajani''s Pridemate', 'Seal of Fire', 'Blaze', 'Niveous Wisps', 'Blessed Alliance', 'Marwyn, the Nurturer', 'Armadillo Cloak', 'Careful Consideration', 'Early Harvest', 'Midnight Haunting', 'Executioner''s Capsule', 'Jungle Hollow', 'Smothering Abomination', 'Gaea''s Blessing', 'Fact or Fiction', 'Rigging Runner', 'High Alert', 'Vivid Meadow', 'Azorius Signet', 'Phyrexian Rager', 'Vivid Grove', 'Consume the Meek', 'Mystifying Maze', 'Brave the Sands', 'Tranquil Cove', 'Ranging Raptors', 'Memory Lapse', 'Roast', 'Moorland Haunt', 'Putrefy', 'Altar''s Reap', 'Arboreal Grazer', 'Ephemerate', 'Talisman of Hierarchy', 'Emeria Angel', 'Immaculate Magistrate', 'Goblin Wardriver', 'Gruul Turf', 'Telling Time', 'Entomber Exarch', 'Hero''s Downfall', 'Need for Speed', 'Calciform Pools', 'Kor Bladewhirl', 'Glare of Subdual', 'Disdainful Stroke', 'Myr Incubator', 'Forbidding Spirit', 'Sylvan Ranger', 'Evolving Wilds', 'Martial Coup', 'Sea Gate Wreckage', 'Changeling Outcast', 'Dwynen, Gilt-Leaf Daen', 'Frontier Bivouac', 'Bazaar Trademage', 'Dark Salvation', 'Foundry of the Consuls', 'Izoni, Thousand-Eyed', 'Pyroclasm', 'Clan Defiance', 'Shadowblood Egg', 'Porcelain Legionnaire', 'Hordeling Outburst', 'Diregraf Ghoul', 'Nephalia Drownyard', 'Skyscanner', 'Dread Statuary', 'Saddled Rimestag', 'Duress', 'Bala Ged Thief', 'Skinshifter', 'Fleecemane Lion', 'Leyline Prowler', 'Svogthos, the Restless Tomb', 'Eternal Taskmaster', 'Tyrant''s Scorn', 'Gavony Township', 'Elvish Guidance', 'Justice Strike', 'Flood Plain', 'Psychotrope Thallid', 'Nevermaker', 'Heartless Summoning', 'Woodland Wanderer', 'Bloodrage Brawler', 'Sunscorched Desert', 'Drogskol Captain', 'Avacyn''s Pilgrim', 'Plague Boiler', 'Lone Rider', 'Gladecover Scout', 'Ethereal Armor', 'Sarcomancy', 'Elder Deep-Fiend', 'Journey to Eternity', 'Stalwart Shield-Bearers', 'Hindering Light', 'Electrolyze', 'Dissipate', 'Hanweir Garrison', 'Hellrider', 'Watcher for Tomorrow', 'Conclave Cavalier', 'Sage''s Reverie', 'Fairgrounds Warden', 'Planar Cleansing', 'Deep Forest Hermit', 'Oona, Queen of the Fae', 'Fiery Temper', 'Warleader''s Helix', 'Demonfire', 'Firemantle Mage', 'Crumbling Necropolis', 'Burst Lightning', 'Nether Spirit', 'Kessig Prowler', 'Dinosaur Stampede', 'Research // Development', 'Kalastria Healer', 'Izzet Charm', 'Precognitive Perception', 'Rogue Elephant', 'Deep Analysis', 'Ally Encampment', 'Soulherder', 'Sejiri Refuge', 'Izzet Boilerworks', 'Oath of Jace', 'Bassara Tower Archer', 'Plumeveil', 'Shock', 'Ivory Tower', 'Thopter Spy Network', 'Vessel of Volatility', 'Chronomantic Escape', 'Firebrand Archer', 'Dimir Guildgate', 'Ugin''s Conjurant', 'Guild Globe', 'Urza''s Rage', 'Lonely Sandbar', 'Yavimaya Hollow', 'Otepec Huntmaster', 'Sapling of Colfenor', 'Find // Finality', 'Condemn', 'Summary Dismissal', 'Spider Umbra', 'Pollen Lullaby', 'Ash Zealot', 'Turnabout', 'Kazandu Refuge', 'Dimir Signet', 'Sylvan Awakening', 'Stormblood Berserker', 'Elixir of Immortality', 'Elvish Rejuvenator', 'Decree of Justice', 'Carrion Feeder', 'Memorial to Genius', 'Bane of Bala Ged', 'Supply // Demand', 'Grim Haruspex', 'Frantic Search', 'Zhalfirin Void', 'Violent Eruption', 'Vessel of Nascency', 'Silkwrap', 'Regrowth', 'Talisman of Creativity', 'Unflinching Courage', 'Diregraf Colossus', 'Swans of Bryn Argoll', 'Vivid Creek', 'Hand of Emrakul', 'Doomfall', 'Firedrinker Satyr', 'Swiftwater Cliffs', 'Treasure Cruise', 'Pyrite Spellbomb', 'Wakestone Gargoyle', 'Lava Dart', 'Reverent Hunter', 'Hopeful Eidolon', 'Soul Warden', 'Nostalgic Dreams', 'Spore Frog', 'Perimeter Captain', 'Cloudblazer', 'Crush of Wurms', 'Skyscribing', 'Grateful Apparition', 'Survival Cache', 'Chain of Plasma', 'Yavimaya Elder', 'Ahn-Crop Crasher', 'Zombify', 'Dimir Charm', 'Power Sink', 'Song of Freyalise', 'Spirit Mantle', 'Think Twice', 'Verity Circle', 'Abbot of Keral Keep', 'Hagra Diabolist', 'Liliana''s Mastery', 'Magister of Worth', 'Ravenous Daggertooth', 'Sterling Grove', 'Catacomb Sifter', 'Honored Hydra', 'Plaguecrafter', 'Quench', 'Wall of Blossoms', 'Ivory Mask', 'Nature''s Lore', 'Munda, Ambush Leader', 'Den Protector', 'Exclude', 'Cemetery Reaper', 'Vivid Crag', 'Quiet Speculation', 'Shimmer of Possibility', 'Fortified Village', 'Gelatinous Genesis', 'Deathgorge Scavenger', 'Wretched Banquet', 'Cryptolith Rite', 'Basking Rootwalla', 'Perplex', 'Distended Mindbender', 'Prophetic Bolt', 'Chandra''s Spitfire', 'Loxodon Smiter', 'Wing Shards', 'Dreadship Reef', 'Boartusk Liege', 'Falkenrath Noble', 'Swift Silence', 'White Sun''s Zenith', 'Riot Control', 'Blossoming Sands', 'Extinguish All Hope', 'Splendid Reclamation', 'Dead Weight', 'Wall of Denial', 'Golgari Guildgate', 'Mimic Vat', 'Ravenous Chupacabra', 'Thaumatic Compass', 'Suture Priest', 'Creeping Renaissance', 'Opulent Palace', 'Arcane Sanctum', 'Sphinx of the Final Word', 'Undead Augur', 'Foresee', 'Quicksand', 'Bygone Bishop', 'Golgari Findbroker', 'Chandra Nalaar', 'Halimar Depths', 'Sylvan Messenger', 'Beck // Call', 'Leatherback Baloth', 'Searing Spear', 'Archaeological Dig', 'Raptor Hatchling', 'Varolz, the Scar-Striped', 'Caustic Tar', 'Hada Freeblade', 'Foundry Inspector', 'Dread Return', 'Makeshift Mannequin', 'Huatli, the Sun''s Heart', 'Vampire Nighthawk', 'Holy Day', 'Akoum Battlesinger', 'Commune with Dinosaurs', 'Arc Trail', 'Unbridled Growth', 'Tendrils of Agony', 'Awakening Zone', 'Incendiary Flow', 'Man-o''-War'))) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

```

[] (slow_query, 233.1, mysql)

Reported on decksite by mysql-perf

Location Hash: 7b354949266b9e69344a3132845955552683b0e7

Labels: decksite

vorpal-buildbot commented 5 years ago

Exceeded slow_query limit (358.2 > 100.0) in mysql: ```

    SELECT
        d.id,
        d.finish,
        d.decklist_hash,
        cache.active_date,
        cache.wins,
        cache.losses,
        cache.draws,
        ct.name AS competition_type_name
    FROM
        deck AS d

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (SELECT deck_id FROM deck_card WHERE card IN ('Howling Mine', 'Sultai Charm', 'Sylvan Messenger', 'Mimic Vat', 'Soulherder', 'Wakestone Gargoyle', 'Terramorphic Expanse', 'Prohibit', 'Gavony Township', 'Forbidding Spirit', 'Mutilate', 'Turn Aside', 'Strangleroot Geist', 'Keldon Megaliths', 'Bazaar Trademage', 'Ivory Mask', 'Satyr Wayfinder', 'Soul Summons', 'Circular Logic', 'Munda, Ambush Leader', 'Ranging Raptors', 'Sylvan Ranger', 'Sunscourge Champion', 'Hedron Alignment', 'Oath of Jace', 'Carrion Feeder', 'Talisman of Conviction', 'Huatli, the Sun''s Heart', 'Nevermaker', 'Savage Stomp', 'Vivid Crag', 'Knight of the Stampede', 'Tempting Wurm', 'Smothering Abomination', 'Artisan of Kozilek', 'Wing Shards', 'Ordeal of Heliod', 'Blaze', 'Shock', 'Experiment One', 'Rune Snag', 'Children of Korlis', 'Duskwatch Recruiter', 'Blossoming Sands', 'Lodestone Golem', 'Liliana''s Mastery', 'Altar''s Reap', 'Goblin Warchief', 'Foundry Inspector', 'Journey to Eternity', 'Miren, the Moaning Well', 'Obsessive Search', 'Conjurer''s Bauble', 'Oona''s Grace', 'Think Twice', 'Diregraf Colossus', 'Druid of the Cowl', 'Entomber Exarch', 'Sandsteppe Citadel', 'Curator of Mysteries', 'Gruul Turf', 'Quicksand', 'Suture Priest', 'Blight Mamba', 'Plumeveil', 'River Sneak', 'Sapling of Colfenor', 'Trigon of Infestation', 'Prophetic Bolt', 'Magus of the Scroll', 'Frilled Deathspitter', 'Curse of Misfortunes', 'Remove Soul', 'Sprouting Vines', 'Golgari Signet', 'Desolate Lighthouse', 'Linvala, the Preserver', 'Bassara Tower Archer', 'Tomb of the Spirit Dragon', 'Firemantle Mage', 'Zhalfirin Void', 'Deathsprout', 'Plunge into Darkness', 'Izoni, Thousand-Eyed', 'Scrabbling Claws', 'Drown in Sorrow', 'Vizkopa Guildmage', 'Culling Dais', 'Anticipate', 'Ivory Tower', 'Dissipate', 'Forgotten Cave', 'Creeping Renaissance', 'Expedition Envoy', 'Chronomantic Escape', 'Suspension Field', 'Jungle Hollow', 'Departed Deckhand', 'Sylvan Awakening', 'Garruk''s Companion', 'Possessed Portal', 'Fiery Temper', 'Splendid Reclamation', 'Fact or Fiction', 'Magmatic Sinkhole', 'Thopter Spy Network', 'Quiet Speculation', 'Opulent Palace', 'Goblin Dark-Dwellers', 'Grisly Salvage', 'Woodland Wanderer', 'Hada Freeblade', 'Falkenrath Noble', 'Magus of the Bazaar', 'Triton Shorestalker', 'Dimir Guildgate', 'Thaumatic Compass', 'Spider Umbra', 'Confirm Suspicions', 'Silhana Ledgewalker', 'Zurgo Bellstriker', 'Vivid Creek', 'Renegade Krasis', 'Survival Cache', 'Ugin''s Conjurant', 'Asha''s Favor', 'Mesmeric Fiend', 'Nephalia Drownyard', 'Krosan Cloudscraper', 'Temporal Fissure', 'Vesperlark', 'Wharf Infiltrator', 'Dragon Fodder', 'Boartusk Liege', 'Rugged Highlands', 'Satyr Enchanter', 'Flesh-Eater Imp', 'Ghitu Encampment', 'Clickslither', 'Warleader''s Helix', 'Leatherback Baloth', 'Viridian Emissary', 'Tattered Haunter', 'Clan Defiance', 'Eternal Taskmaster', 'Sage''s Reverie', 'Swans of Bryn Argoll', 'Yavimaya Elder', 'Nostalgic Dreams', 'Memory Lapse', 'Champion of Rhonas', 'Bedeck // Bedazzle', 'Martial Coup', 'Comparative Analysis', 'Wretched Banquet', 'Noose Constrictor', 'Swiftwater Cliffs', 'Doomfall', 'Exclude', 'Forsake the Worldly', 'Chemister''s Insight', 'Death Cloud', 'Grim Haruspex', 'Early Harvest', 'Expansion // Explosion', 'Vitu-Ghazi, the City-Tree', 'Ash Zealot', 'Su-Chi', 'Glyph Keeper', 'Kuldotha Forgemaster', 'Brave the Elements', 'Undead Augur', 'Ichor Rats', 'Izzet Guildgate', 'Duress', 'Lumbering Falls', 'Conflagrate', 'Invigorate', 'Encroaching Wastes', 'Otepec Huntmaster', 'Ethereal Armor', 'Ranger''s Guile', 'Hanweir Garrison', 'Ravenous Daggertooth', 'Flame Javelin', 'Prison Realm', 'Bygone Bishop', 'Frenzied Goblin', 'Lumbering Battlement', 'Rude Awakening', 'Silkwrap', 'Riftwing Cloudskate', 'Rampant Growth', 'Warbreak Trumpeter', 'High Alert', 'Spirit Mantle', 'Blessed Alliance', 'Ephemerate', 'Drover of the Mighty', 'Zombify', 'Yavimaya Hollow', 'Tin Street Dodger', 'Ib Halfheart, Goblin Tactician', 'Skyscribing', 'Dead Weight', 'Extinguish All Hope', 'Ludevic''s Test Subject', 'Glory', 'Brain Maggot', 'Frantic Search', 'Lonely Sandbar', 'Bane of Bala Ged', 'Vivid Grove', 'Evolution Sage', 'Bile Blight', 'Krosan Tusker', 'Armadillo Cloak', 'Elvish Guidance', 'Scour All Possibilities', 'Become Immense', 'Planar Cleansing', 'Aven Riftwatcher', 'Kazandu Refuge', 'Sea Gate Wreckage', 'Summary Dismissal', 'Village Messenger', 'Gargoyle Castle', 'Genesis', 'Precognitive Perception', 'Holy Day', 'Plague Stinger', 'Dimir Signet', 'Radiant Flames', 'Defiant Strike', 'Dissolve', 'Incinerate', 'Mist-Cloaked Herald', 'Brain Freeze', 'Honored Hydra', 'Sphinx of the Final Word', 'Arc Trail', 'Familiar''s Ruse', 'Healer''s Hawk', 'Hand of the Praetors', 'Mayael''s Aria', 'Deeproot Waters', 'Pore Over the Pages', 'Nomad Outpost', 'Hindering Light', 'Evolving Wilds', 'Coat of Arms', 'Midnight Guard', 'Stromkirk Noble', 'Cursed Scroll', 'Arcane Sanctum', 'Deep Analysis', 'Mystifying Maze', 'Teyo, the Shieldmage', 'Telling Time', 'Ayula''s Influence', 'Conclave Cavalier', 'Justice Strike', 'Abbot of Keral Keep', 'Rogue Refiner', 'Blisterpod', 'Dusk Legion Zealot', 'Gaea''s Blessing', 'Savage Swipe', 'Whispering Specter', 'Talisman of Hierarchy', 'Evolutionary Leap', 'Oona, Queen of the Fae', 'White Sun''s Zenith', 'Cruel Celebrant', 'Glimmer of Genius', 'Mizzium Mortars', 'Dreadship Reef', 'Brion Stoutarm', 'Reckless Waif', 'Firebolt', 'Bojuka Brigand', 'Kor Bladewhirl', 'Flood Plain', 'Temporal Isolation', 'Cathedral Membrane', 'Swarm of Rats', 'Changeling Outcast', 'Rattlechains', 'Elvish Visionary', 'Torment of Scarabs', 'Pathrazer of Ulamog', 'Honor of the Pure', 'Prismatic Lens', 'Akoum Battlesinger', 'Kalastria Healer', 'Ultimate Price', 'Vessel of Nascency', 'Pirate''s Pillage', 'Quench', 'Plaguecrafter', 'Scoured Barrens', 'Raptor Hatchling', 'Woodland Stream', 'Golem Foundry', 'Dawn of Hope', 'Electrolyze', 'Elvish Promenade', 'Nantuko Monastery', 'Marwyn, the Nurturer', 'Tranquil Cove', 'Violent Eruption', 'Heartless Summoning', 'Sejiri Refuge', 'Forbid', 'Burglar Rat', 'Quest for the Goblin Lord', 'Meandering River', 'Vizier of the Anointed', 'Pollen Lullaby', 'Ishkanah, Grafwidow', 'Mouth // Feed', 'Brave the Sands', 'Lazotep Reaver', 'Needletooth Raptor', 'Svogthos, the Restless Tomb', 'Lord of the Undead', 'Plague Boiler', 'Reckless Wurm', 'Quest for Pure Flame', 'Fiend Hunter', 'Grim Backwoods', 'Fortified Village', 'Giant Growth', 'Calciform Pools', 'Den Protector', 'Sixth Sense', 'Firebrand Archer', 'Goblin Wardriver', 'Find // Finality', 'Commune with Dinosaurs', 'Phalanx Leader', 'Fleecemane Lion', 'Grateful Apparition', 'Fight with Fire', 'Burst Lightning', 'Nether Spirit', 'Fairgrounds Warden', 'Graypelt Refuge', 'Hagra Diabolist', 'Dwynen, Gilt-Leaf Daen', 'Deep Forest Hermit', 'Skyscanner', 'Hand of Emrakul', 'Syncopate', 'Demonfire', 'Searing Spear', 'Wonder', 'Kalonian Tusker', 'Archery Training', 'Deftblade Elite', 'Larger Than Life', 'Gyre Sage', 'Ahn-Crop Crasher', 'Cutthroat Maneuver', 'Izzet Boilerworks', 'Golgari Findbroker', 'Curse of Thirst', 'Murderous Cut', 'Favored Hoplite', 'Cloudblazer', 'Avacyn''s Pilgrim', 'Arboreal Grazer', 'Pulse of the Fields', 'Grasslands', 'Blazing Shoal', 'Harrow', 'Merfolk Sovereign', 'Talisman of Creativity', 'Submerged Boneyard', 'Crumbling Necropolis', 'Awakening Zone', 'Future Sight', 'Basking Rootwalla', 'Myr Retriever', 'Undying Evil', 'Harbinger of the Tides', 'Forbidden Alchemy', 'Rakdos Cackler', 'Mana Leak', 'Rigging Runner', 'Bloodrage Brawler', 'Counterflux', 'Slagstorm', 'Putrefy', 'Coralhelm Commander', 'Wall of Blossoms', 'Niveous Wisps', 'Drogskol Captain', 'Lava Dart', 'Seal of Fire', 'Gryff''s Boon', 'Cruel Reality', 'Gods Willing', 'Scare Tactics', 'Dead // Gone', 'Ajani''s Pridemate', 'Ravenous Chupacabra', 'Barren Moor', 'Ajani Goldmane', 'Chandra''s Spitfire', 'Kessig Prowler', 'Adorned Pouncer', 'Boggart Shenanigans', 'Altar of the Brood', 'Crackling Drake', 'Dryad Greenseeker', 'Memorial to Genius', 'Golgari Guildgate', 'Secluded Steppe', 'Cathedral of War', 'Fertile Ground', 'Chandra, the Firebrand', 'Chain of Plasma', 'Dread Statuary', 'Aquastrand Spider', 'Elder Deep-Fiend', 'Jungle Shrine', 'Lone Rider', 'Hall of Triumph', 'Sanguine Bond', 'Eerie Interlude', 'Hellrider', 'Kazuul Warlord', 'Crown of Convergence', 'Perimeter Captain', 'Kasmina, Enigmatic Mentor', 'Careful Consideration', 'Arch of Orazca', 'Leyline Prowler', 'Diregraf Ghoul', 'Myr Incubator', 'Treasure Cruise', 'Godsire', 'Day of Judgment', 'Dimir Charm', 'Elixir of Immortality', 'Azorius Signet', 'Elemental Mastery', 'Regrowth', 'Catacomb Sifter', 'Incendiary Flow', 'Curse of Death''s Hold', 'Varolz, the Scar-Striped', 'Kjeldoran Outpost', 'Wily Goblin', 'Tendrils of Agony', 'Urza''s Factory', 'Turnabout', 'Final Judgment', 'Sunscorched Desert', 'Soul Warden', 'Silvergill Adept', 'Krenko''s Command', 'Akroma, Angel of Fury', 'Hero''s Downfall', 'Emeria Angel', 'Forerunner of the Empire', 'Makeshift Mannequin', 'Rat Colony', 'Decree of Justice', 'Oblivion Ring', 'Merrow Reejerey', 'Dread Return', 'Hordeling Outburst', 'Vampire Nighthawk', 'Stalwart Shield-Bearers', 'Gelatinous Genesis', 'Vivid Meadow', 'Deathgorge Scavenger', 'Sinuous Striker', 'Firedrinker Satyr', 'Dark Salvation', 'Pyroclasm', 'Consume the Meek', 'Hopeful Eidolon', 'Utter End', 'Bottled Cloister', 'Transgress the Mind', 'Needle Spires', 'Spirit Link', 'Sarcomancy', 'Deathspore Thallid', 'Crypt of Agadeem', 'Centaur Garden', 'Goblin Fireslinger', 'Spore Frog', 'Tranquil Thicket', 'Mystic Monastery', 'Mastery of the Unseen', 'Necropede', 'Psychotrope Thallid', 'Conduit of Ruin', 'Everdream', 'Magma Spray', 'Porcelain Legionnaire', 'Woolly Thoctar', 'Man-o''-War', 'Magister of Worth', 'Riot Control', 'Vivid Marsh', 'Sylvan Advocate', 'Foundry of the Consuls', 'Condemn', 'Bant Charm', 'Urza''s Rage', 'Gladecover Scout', 'Unflinching Courage', 'Watcher for Tomorrow', 'Sinister Sabotage', 'Moment of Silence', 'Power Sink', 'Seasons Past', 'Chandra Nalaar', 'Dinosaur Stampede', 'Benevolent Bodyguard', 'Negate', 'Soulsworn Jury', 'Frontier Bivouac', 'Impassioned Orator', 'Roast', 'Brago, King Eternal', 'Dig Through Time', 'Phyrexian Rager', 'Gatherer of Graces', 'Elvish Rejuvenator', 'Strategic Planning', 'Gonti, Lord of Luxury', 'Loxodon Smiter', 'Honored Hierarch', 'Dictate of Karametra', 'Pyrite Spellbomb', 'Moorland Haunt', 'Wall of Denial', 'Cathodion', 'Glaring Aegis', 'Peace Talks', 'Vigor Mortis', 'Distended Mindbender', 'World Shaper', 'Nocturnal Raid', 'Bala Ged Thief', 'Immaculate Magistrate', 'Hero of Iroas', 'Azorius Charm', 'Disdainful Stroke', 'Tyrant''s Scorn', 'Aspect of Hydra', 'Lantern Scout', 'Epochrasite', 'Captain''s Claws', 'Stormblood Berserker', 'Infiltration Lens', 'Foresee', 'Painful Truths', 'Cemetery Reaper', 'Sign in Blood', 'Ally Encampment', 'Elvish Piper', 'Face of Divinity', 'Izzet Charm', 'Lake of the Dead'))) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

```

[] (slow_query, 358.2, mysql)

Reported on decksite by mysql-perf

Location Hash: 7b354949266b9e69344a3132845955552683b0e7

Labels: decksite

vorpal-buildbot commented 5 years ago

Exceeded slow_query limit (183.7 > 100.0) in mysql: ```

    SELECT
        d.id,
        d.finish,
        d.decklist_hash,
        cache.active_date,
        cache.wins,
        cache.losses,
        cache.draws,
        ct.name AS competition_type_name
    FROM
        deck AS d

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (SELECT deck_id FROM deck_card WHERE card IN ('Unburden', 'Cruel Reality', 'Healer''s Hawk', 'Ravenous Chupacabra', 'Defiant Strike', 'Crumbling Necropolis', 'Crush of Tentacles', 'Dragon Fodder', 'Loxodon Smiter', 'Tormenting Voice', 'Arch of Orazca', 'Decree of Justice', 'Tranquil Thicket', 'Ranging Raptors', 'Blight Mamba', 'Dimir Charm', 'Elixir of Immortality', 'Liliana''s Mastery', 'Prison Realm', 'Glaring Aegis', 'Alesha, Who Smiles at Death', 'Hordeling Outburst', 'Conjurer''s Bauble', 'Forbidden Alchemy', 'Consume the Meek', 'Cathedral of War', 'Brago, King Eternal', 'Tendrils of Agony', 'Day of Judgment', 'Seasons Past', 'Flameshadow Conjuring', 'Syncopate', 'Wing Shards', 'Lumbering Falls', 'Altar of the Brood', 'Frontier Bivouac', 'Vivid Marsh', 'Azorius Charm', 'Think Twice', 'Dig Through Time', 'Conclave Cavalier', 'Lazotep Reaver', 'Bloodsoaked Champion', 'Kjeldoran Outpost', 'Swans of Bryn Argoll', 'Drogskol Captain', 'Sejiri Refuge', 'Extinguish All Hope', 'Carrion Feeder', 'Vivid Grove', 'Frantic Search', 'Genesis', 'Eternal Taskmaster', 'Glyph Keeper', 'Hero of Iroas', 'Centaur Garden', 'Krosan Cloudscraper', 'Read the Bones', 'Wild Nacatl', 'Jungle Shrine', 'Stupor', 'Aquastrand Spider', 'Torment of Scarabs', 'Nether Spirit', 'Rakdos Cackler', 'Terramorphic Expanse', 'Bazaar Trademage', 'Curse of Misfortunes', 'Mastery of the Unseen', 'Treasure Cruise', 'Angelic Overseer', 'Desolate Lighthouse', 'Village Messenger', 'Firebolt', 'Ash Zealot', 'Rampant Growth', 'Asha''s Favor', 'Izzet Boilerworks', 'Cruel Celebrant', 'Invigorate', 'Summary Dismissal', 'Spirit Mantle', 'Woodland Wanderer', 'Sphinx of the Final Word', 'Viridian Emissary', 'Rakdos''s Return', 'Glory', 'Dusk Legion Zealot', 'Wily Goblin', 'Trigon of Infestation', 'Pulse of the Fields', 'Brain Freeze', 'Commune with Dinosaurs', 'Brave the Elements', 'Frilled Deathspitter', 'Quiet Speculation', 'Forerunner of the Empire', 'Silhana Ledgewalker', 'Goblin Wardriver', 'Hero''s Downfall', 'Planar Cleansing', 'Skyscanner', 'Cutthroat Maneuver', 'Lord of the Undead', 'Plague Stinger', 'Deep Analysis', 'Savage Stomp', 'Riftwing Cloudskate', 'Benevolent Bodyguard', 'Oblivion Ring', 'Jungle Hollow', 'Meandering River', 'Talisman of Hierarchy', 'Dead // Gone', 'Rugged Highlands', 'Goblin Dark-Dwellers', 'Victim of Night', 'Vivid Meadow', 'Deathsprout', 'Ahn-Crop Crasher', 'Painful Truths', 'Memorial to Unity', 'Tin Street Dodger', 'Deftblade Elite', 'Kazandu Refuge', 'Nostalgic Dreams', 'Cloudblazer', 'Sultai Charm', 'Banisher Priest', 'Confirm Suspicions', 'Sinuous Striker', 'Blossoming Sands', 'Kalonian Tusker', 'Hamlet Captain', 'Everdream', 'Tempting Wurm', 'Blightning', 'Wall of Blossoms', 'Ephemerate', 'Nephalia Drownyard', 'Crown of Convergence', 'Radiant Flames', 'Soulherder', 'Brion Stoutarm', 'Vivid Creek', 'Scoured Barrens', 'Vicious Conquistador', 'Diregraf Ghoul', 'Sedraxis Specter', 'Satyr Wayfinder', 'Elvish Piper', 'Ichor Rats', 'Angelic Purge', 'Giant Growth', 'Mayor of Avabruck', 'Nantuko Monastery', 'Davriel, Rogue Shadowmage', 'Ethereal Armor', 'Pulse Tracker', 'Goblin Assault', 'Nylea''s Presence', 'Woolly Thoctar', 'Dimir Cutpurse', 'Mana Leak', 'Watcher for Tomorrow', 'Leechridden Swamp', 'Soul Summons', 'Sinister Sabotage', 'Fortified Village', 'Rattlechains', 'Swarm of Rats', 'Golem Foundry', 'Triskelion', 'Departed Deckhand', 'Gladecover Scout', 'Gavony Township', 'Chain of Plasma', 'Searing Spear', 'Yavimaya Hollow', 'Dawn of Hope', 'Deep Forest Hermit', 'Vitu-Ghazi, the City-Tree', 'Gyre Sage', 'Pore Over the Pages', 'Hedron Alignment', 'Grim Haruspex', 'Heartless Summoning', 'Fairgrounds Warden', 'Encroaching Wastes', 'Turnabout', 'Lake of the Dead', 'Anticipate', 'Crypt of Agadeem', 'Emeria Angel', 'Gods Willing', 'Doomfall', 'Myr Retriever', 'Bonesplitter', 'Graypelt Refuge', 'Otepec Huntmaster', 'Dissipate', 'Phalanx Leader', 'Rat Colony', 'Cemetery Reaper', 'Blisterpod', 'Chemister''s Insight', 'Frenzied Goblin', 'Gryff''s Boon', 'Dictate of Karametra', 'Linvala, the Preserver', 'Curse of Death''s Hold', 'Martial Coup', 'Undead Augur', 'Brain Maggot', 'Radiant Destiny', 'Larger Than Life', 'Forbid', 'Negate', 'Scare Tactics', 'Secluded Steppe', 'Suspension Field', 'Honored Hierarch', 'Urza''s Factory', 'Bygone Bishop', 'Hanweir Militia Captain', 'Quest for the Goblin Lord', 'Dimir Guildgate', 'Evolution Sage', 'Rune Snag', 'Prohibit', 'Crypt of the Eternals', 'Honor of the Pure', 'Behemoth Sledge', 'Lone Rider', 'Dissolve', 'Temporal Fissure', 'Glimmer of Genius', 'Utter End', 'Rogue Refiner', 'Sarcomancy', 'Arcane Sanctum', 'Evolutionary Leap', 'Conflagrate', 'Hall of Triumph', 'Moorland Haunt', 'Den Protector', 'Ranger''s Guile', 'Fertile Ground', 'Mizzium Mortars', 'Satyr Enchanter', 'Thornbow Archer', 'Delirium Skeins', 'Champion of Rhonas', 'Hypnotic Specter', 'White Sun''s Zenith', 'Drover of the Mighty', 'Ajani''s Pridemate', 'Sunscourge Champion', 'Face of Divinity', 'Aspect of Hydra', 'Prophetic Bolt', 'Mouth // Feed', 'Warbreak Trumpeter', 'Flood Plain', 'Ib Halfheart, Goblin Tactician', 'Assemble the Legion', 'Distress', 'Burst Lightning', 'Scythe Tiger', 'Loam Lion', 'Bloodfell Caves', 'Dead Weight', 'Warleader''s Helix', 'Evolving Wilds', 'Scrabbling Claws', 'Rogue Elephant', 'Sixth Sense', 'Smiting Helix', 'Boggart Shenanigans', 'Justice Strike', 'Duress', 'Leatherback Baloth', 'Memory Lapse', 'Calciform Pools', 'Putrefy', 'Mystic Monastery', 'Regrowth', 'Electrolyze', 'Heron''s Grace Champion', 'Krenko''s Command', 'Bant Charm', 'Vivid Crag', 'Curator of Mysteries', 'Strategic Planning', 'Soul Warden', 'Wild Beastmaster', 'Avacyn''s Pilgrim', 'Elvish Visionary', 'Power Sink', 'Phyrexian Rager', 'Raptor Hatchling', 'Duskwatch Recruiter', 'Rude Awakening', 'Tranquil Cove', 'Spirit Link', 'Shock', 'Favored Hoplite', 'Changeling Outcast', 'Fact or Fiction', 'Keldon Megaliths', 'Curse of Thirst', 'Counterflux', 'Teyo, the Shieldmage', 'Ordeal of Heliod', 'Night Market Lookout', 'Eerie Interlude', 'Strangleroot Geist', 'Vesperlark', 'Trostani''s Summoner', 'Mayael''s Aria', 'Vizier of the Anointed', 'Sylvan Advocate', 'Fleecemane Lion', 'Temporal Isolation', 'Harvest Wurm', 'Grasslands', 'Nevermaker', 'Condemn', 'Valorous Stance', 'Sandsteppe Citadel', 'Leonin Skyhunter', 'Nocturnal Raid', 'Aven Riftwatcher', 'Bile Blight', 'Obsessive Search', 'Adorned Pouncer', 'Become Immense', 'Clickslither', 'Murderous Cut', 'Izzet Charm', 'Sylvan Ranger', 'Grisly Salvage', 'Needletooth Raptor', 'Dreamstealer', 'Falkenrath Noble', 'King of the Pride', 'Armada Wurm', 'Tyrant''s Scorn', 'Deranged Hermit', 'Savannah Lions', 'Swiftwater Cliffs', 'Nomad Outpost', 'Impassioned Orator', 'Wretched Banquet', 'Diregraf Colossus', 'Talisman of Creativity', 'Slagstorm', 'Archery Training', 'Renegade Krasis', 'Spider Umbra', 'Experiment One', 'Arguel''s Blood Fast', 'Abbot of Keral Keep', 'Stromkirk Noble', 'Tattered Haunter', 'Dark Salvation', 'Kasmina, Enigmatic Mentor', 'Magmatic Sinkhole', 'Sign in Blood', 'Godsire', 'Ravenous Daggertooth', 'Dinosaur Stampede', 'Mimic Vat', 'Knight of the Stampede', 'Goblin Warchief', 'Ajani Goldmane', 'Fiend Hunter', 'Circular Logic', 'Mesmeric Fiend', 'Opulent Palace', 'Necropede', 'Addle', 'Rakdos Carnarium', 'Blessed Alliance', 'Pyroclasm', 'Stormblood Berserker'))) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

```

[] (slow_query, 183.7, mysql)

Reported on decksite by mysql-perf

Location Hash: 7b354949266b9e69344a3132845955552683b0e7

Labels: decksite

vorpal-buildbot commented 5 years ago

Exceeded slow_query limit (122.3 > 100.0) in mysql: ```

    SELECT
        d.id,
        d.finish,
        d.decklist_hash,
        cache.active_date,
        cache.wins,
        cache.losses,
        cache.draws,
        ct.name AS competition_type_name
    FROM
        deck AS d

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (SELECT deck_id FROM deck_card WHERE card IN ('Deranged Hermit', 'Charmed Stray', 'Lodestone Golem', 'Day of Judgment', 'Brave the Elements', 'Azorius Charm', 'Memory Lapse', 'Ajani''s Sunstriker', 'Kuldotha Forgemaster', 'Scrabbling Claws', 'Healer''s Hawk', 'Bygone Bishop', 'King of the Pride', 'Wydwen, the Biting Gale', 'Mana Leak', 'Zhalfirin Void', 'Obliterate', 'Anticipate', 'Trostani''s Summoner', 'Curious Homunculus', 'Cursed Scroll', 'Fact or Fiction', 'New Benalia', 'Sacred Mesa', 'Obsessive Search', 'Midnight Guard', 'Future Sight', 'Flood Plain', 'Honor of the Pure', 'Tin Street Dodger', 'Thaumatic Compass', 'Mystic Monastery', 'Dawn of Hope', 'Sea Gate Wreckage', 'Chandra Nalaar', 'Fatestitcher', 'Think Twice', 'Dread Statuary', 'Voidmage Husher', 'Myr Incubator', 'Arborback Stomper', 'Searing Spear', 'Ahn-Crop Crasher', 'Qasali Ambusher', 'The Mending of Dominaria', 'Burst Lightning', 'Izzet Charm', 'White Sun''s Zenith', 'Utter End', 'Evolving Wilds', 'Firedrinker Satyr', 'Valorous Stance', 'Su-Chi', 'Rakdos Cackler', 'Frantic Search', 'Devastating Dreams', 'Vesperlark', 'Slagstorm', 'Decree of Justice', 'Vivid Creek', 'Abbot of Keral Keep', 'Goblin Electromancer', 'Dig Through Time', 'Desolate Lighthouse', 'Incinerate', 'Cerulean Wisps', 'Stormblood Berserker', 'Elemental Mastery', 'Arboreal Grazer', 'Gargoyle Castle', 'Flame Javelin', 'Hanweir Battlements', 'Parhelion II', 'Vitu-Ghazi, the City-Tree', 'Fiend Hunter', 'Shock', 'Ajani Goldmane', 'Soul Warden', 'Oblivion Ring', 'Forbid', 'Seething Song', 'Foundry of the Consuls', 'Infiltration Lens', 'Devious Cover-Up', 'Electrolyze', 'Swiftwater Cliffs', 'Quicken', 'Rakdos Carnarium', 'Alesha, Who Smiles at Death', 'Cathodion', 'Mastery of the Unseen', 'Curator of Mysteries', 'Mimic Vat', 'Nagging Thoughts', 'Blessed Alliance', 'Memorial to Unity', 'Village Messenger', 'Spawning Pit', 'Watcher for Tomorrow', 'Keldon Megaliths', 'Mirari''s Wake', 'Zurgo Bellstriker', 'Porcelain Legionnaire', 'Power Sink', 'Sinuous Striker', 'Ash Zealot', 'Leyline of Vitality', 'Wind Zendikon', 'Tormenting Voice', 'Scoured Barrens', 'Roast', 'Wild Nacatl', 'Sylvan Awakening', 'Seal of Fire', 'Ajani''s Pridemate', 'Adorned Pouncer', 'The Flame of Keld', 'Kjeldoran Outpost', 'Jeskai Ascendancy', 'Flameshadow Conjuring', 'Sulfur Vent', 'Loam Lion', 'Epochrasite', 'Nantuko Monastery', 'Trail of Evidence', 'Urza''s Factory', 'Jungle Shrine', 'Sejiri Refuge', 'Spear of Heliod', 'Vizier of the Anointed', 'Condemn', 'Stromkirk Noble', 'Satyr Wayfinder', 'Vivid Meadow', 'Glyph Keeper', 'Crash Through', 'Avacyn''s Pilgrim', 'Foundry Inspector', 'Gavony Township', 'Arcane Sanctum', 'Vivid Crag', 'Strategic Planning', 'Impassioned Orator', 'Goblin Assault', 'Springbloom Druid', 'Farhaven Elf', 'Firebolt', 'Glare of Subdual', 'Repeal', 'Sterling Grove', 'Ancient Spring', 'Fortified Village', 'Nether Spirit', 'Frontier Bivouac', 'Tranquil Cove', 'Lightning Berserker', 'Geothermal Crevice', 'Ghitu Encampment', 'Triskelion', 'Sunscourge Champion', 'Dissolve', 'Treasure Cruise', 'Bazaar Trademage', 'Always Watching', 'Lone Rider', 'Hanweir Garrison', 'Bond of Flourishing', 'Secluded Steppe', 'Blossoming Sands', 'Ulvenwald Tracker', 'Arc Trail', 'Calciform Pools'))) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

```

[] (slow_query, 122.3, mysql)

Reported on decksite by mysql-perf

Location Hash: 7b354949266b9e69344a3132845955552683b0e7

Labels: decksite