PennyDreadfulMTG / perf-reports

2 stars 2 forks source link

Exceeded slow_query limit (76.4 > 60.0) in mysql: ``` #58585

Open vorpal-buildbot opened 2 years ago

vorpal-buildbot commented 2 years ago
    SELECT

    d.id,
    d.finish,
    d.decklist_hash,
    cache.active_date,
    cache.wins,
    cache.losses,
    cache.draws,
    cache.color_sort,
    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 deck_cache AS season ON d.id = season.deck_id
    WHERE
        (d.id IN (SELECT deck_id FROM deck_card WHERE card IN ('Fanatical Firebrand', 'Olivia Voldaren', 'Falkenrath Gorger', 'Myth Realized', 'Sudden Shock', 'Mission Briefing', 'Spirit Mantle', 'Cellar Door', 'Court Homunculus', 'Nezumi Bladeblesser', 'Bogardan Hellkite', 'Assault Strobe', 'Metalwork Colossus', 'Titanic Growth', 'Dauntless Escort', 'Severed Legion', 'Spell Pierce', 'Wheel of Fate', 'Fiend Hunter', 'Olivia, Mobilized for War', 'Life of Toshiro Umezawa', 'Mantis Rider', 'Nivmagus Elemental', 'Thirst for Meaning', 'Mishra''s Factory', 'Bident of Thassa', 'Firewild Borderpost', 'Vindicate', 'Astral Slide', 'Ayara, First of Locthwain', 'Darksteel Juggernaut', 'Falkenrath Forebear', 'Irencrag Pyromancer', 'Tasigur, the Golden Fang', 'Priest of Fell Rites', 'Terrarion', 'Champion of Dusk', 'Silverbluff Bridge', 'Trusty Machete', 'Glorybringer', 'Squadron Hawk', 'Circuit Mender', 'Swans of Bryn Argoll', 'Wolfwillow Haven', 'Nimble Trapfinder', 'Dragon Turtle', 'Dimir Guildgate', 'Prophet of Kruphix', 'Merchant of the Vale', 'Bloodtithe Harvester', 'Searing Spear', 'Treasure Mage', 'Enigma Sphinx', 'Prairie Stream', 'Polukranos, World Eater', 'Universal Automaton', 'Glaring Aegis', 'Gitaxian Probe', 'Pull from Tomorrow', 'Rakdos Headliner', 'Elvish Visionary', 'Infernal Grasp', 'Vessel of Nascency', 'Tectonic Giant', 'Kambal, Consul of Allocation', 'Winds of Abandon', 'The Flame of Keld', 'Garruk Wildspeaker', 'Monk of the Open Hand', 'Dread Wanderer', 'Blistercoil Weird', 'Foundry Street Denizen', 'Temple of Malady', 'Cathartic Pyre', 'Sulfur Falls', 'Shrapnel Blast', 'Hotshot Mechanic', 'Lava Dart', 'Buried Ruin', 'Bloodthrone Vampire', 'Akoum Refuge', 'Rise and Shine', 'Sigrid, God-Favored', 'Zof Consumption', 'Strike It Rich', 'Mindslaver', 'Liquimetal Coating', 'Heartless Act', 'Akroan Skyguard', 'Blightning', 'Eiganjo Castle', 'Thought Scour', 'Narcomoeba', 'Pelakka Predation', 'Field of Ruin', 'Phalanx Leader', 'Shambling Vent', 'Inkwell Leviathan', 'Joraga Treespeaker', 'Stinkweed Imp', 'Weathered Wayfarer', 'Underworld Connections', 'Tarfire', 'Creakwood Liege', 'Rakdos Cackler', 'Mistvault Bridge', 'Sphinx of Foresight', 'Quest for Ula''s Temple', 'Undercity Scrounger', 'Timeless Witness', 'Dawn of Hope', 'Primal Command', 'Tempered Steel', 'Story Circle', 'Reckoner Shakedown', 'Indulgent Aristocrat', 'Electric Revelation', 'Mirror Entity', 'Bloodline Keeper', 'Shalai, Voice of Plenty', 'Lose Focus', 'Elvish Archdruid', 'Soulscour', 'Notion Thief', 'Goblin Dark-Dwellers', 'Bloodchief Ascension', 'Slaughter Pact', 'Mirrorworks', 'Delirium Skeins', 'Choking Sands', 'Countersquall', 'Flamekin Harbinger', 'Ponder', 'Seething Song', 'Pelakka Wurm', 'Platinum Angel', 'Peer Through Depths', 'Viashino Pyromancer', 'Hostage Taker', 'Thirst for Discovery', 'Tatsunari, Toad Rider', 'Destroy the Evidence', 'Play with Fire', 'Staff of Domination', 'Drowned Catacomb', 'Ethersworn Sphinx', 'Languish', 'Spiteful Visions', 'Flametongue Kavu', 'Sleight of Hand', 'Deprive', 'Colossal Skyturtle', 'March of the Machines', 'Lingering Souls', 'Enlisted Wurm', 'Worm Harvest', 'Lantern of the Lost', 'Skull Skaab', 'Empty the Warrens', 'Spoils of Adventure', 'Drider', 'Turn Aside', 'Kessig Malcontents', 'Fell Stinger', 'Brittle Effigy', 'Hall of Oracles', 'Pyroclasm', 'Memory Lapse', 'Cleansing Wildfire', 'Collective Defiance', 'Unmoored Ego', 'Clout of the Dominus', 'Easy Prey', 'Pyretic Ritual', 'Goblin Ringleader', 'Dark Ritual', 'Alchemist''s Vial', 'Arcbound Overseer', 'Vampire Socialite', 'Geralf, Visionary Stitcher', 'Nevermaker', 'Vapor Snag', 'Tezzeret the Schemer', 'Tombstalker', 'Rakdos Signet', 'Cloudpost', 'Dwynen''s Elite', 'Nicol Bolas, Planeswalker', 'Gods Willing', 'Llanowar Elves', 'Repeal', 'Basilica Bell-Haunt', 'Miscast', 'Sage of Epityr', 'Sculpting Steel', 'Confirm Suspicions', 'Shrine of Burning Rage', 'Overwhelmed Apprentice', 'Okiba Reckoner Raid', 'Zurgo Bellstriker', 'Sire of Insanity', 'Dispel', 'Virus Beetle', 'Ishkanah, Grafwidow', 'Firedrinker Satyr', 'Titanoth Rex', 'Faerie Miscreant', 'Genesis', 'Buried Alive', 'Rustvale Bridge', 'Pillage', 'Mastermind''s Acquisition', 'Haakon, Stromgald Scourge', 'Frogmite', 'Birds of Paradise', 'Gilded Lotus', 'Grim Wanderer', 'Reckoner''s Bargain', 'Goblin Bushwhacker', 'Curiosity', 'Kitesail Freebooter', 'Temple of Deceit', 'Stromkirk Noble', 'Servo Exhibition', 'Burning Inquiry', 'Muddle the Mixture', 'Riftwing Cloudskate', 'Mirrodin Besieged', 'Stirring Wildwood', 'Jace Beleren', 'Squad Commander', 'Sojourner''s Companion', 'Goblin Chainwhirler', 'Izzet Boilerworks', 'Thraben Inspector', 'Bedlam Reveler', 'Icebreaker Kraken', 'Elvish Mystic', 'Possessed Skaab', 'Theater of Horrors', 'Stoic Rebuttal', 'Blade Splicer', 'Soaring Thought-Thief', 'Orim''s Chant', 'Return to Action', 'Evolving Wilds', 'Spoils of the Vault', 'First-Sphere Gargantua', 'Glory-Bound Initiate', 'Decree of Justice', 'Ruric Thar, the Unbowed', 'Jokulhaups', 'Secluded Steppe', 'Stoneshaker Shaman', 'Negate', 'Falkenrath Noble', 'Telling Time', 'Quarantine Field', 'Prowling Serpopard', 'Eruth, Tormented Prophet', 'Master Splicer', 'Shardless Agent', 'Viscera Seer', 'Isolated Chapel', 'Become Immense', 'Stormfist Crusader', 'Memory Leak', 'Hit // Run', 'Gatekeeper of Malakir', 'Signal Pest', 'Expedite', 'Genesis Hydra', 'Akoum Warrior', 'Restore Balance', 'Faerie Vandal', 'Bloodchief''s Thirst', 'Mistvein Borderpost', 'Fading Hope', 'Trading Post', 'Startling Development', 'Simian Spirit Guide', 'Turtleshell Changeling', 'Forked Bolt', 'Pariah', 'Dreadhound', 'Fertile Ground', 'Satyr Wayfinder', 'Vivid Crag', 'Radiant Grace', 'Cackling Counterpart', 'Bladestitched Skaab', 'You See a Guard Approach', 'Augur of Bolas', 'Tajuru Preserver', 'Dream Trawler', 'Journey to Oblivion', 'Warden of the First Tree', 'Nissa, Worldwaker', 'Twisted Embrace', 'Murderous Redcap', 'The Antiquities War', 'Glare of Subdual', 'Barbarian Ring', 'Harmonic Prodigy', 'Dismal Backwater', 'Mana Leak', 'Flood Plain', 'Cut // Ribbons', 'Howling Mine', 'Chain of Plasma', 'Expansion // Explosion', 'Incendiary Flow', 'Epochrasite', 'Steel Hellkite', 'Runed Halo', 'Slagwoods Bridge', 'Arch of Orazca', 'Oathsworn Knight', 'Woe Strider', 'Thryx, the Sudden Storm', 'Sylvan Library', 'Sweltering Suns', 'Smallpox', 'Bond of Insight', 'Ghost Quarter', 'Port Town', 'Seaside Citadel', 'Scattered Groves', 'Brilliant Ultimatum', 'Barbed Sextant', 'Flickerwisp', 'Prophetic Prism', 'Sunpetal Grove', 'Greater Gargadon', 'Ornithopter', 'Blighted Agent', 'Army of the Damned', 'Master of the Feast', 'Ash Zealot', 'Rotting Rats', 'Vanquisher''s Banner', 'Condemn', 'Hypergenesis', 'Cunning Nightbonder', 'Aetherspouts', 'Elvish Hexhunter', 'Jace, the Living Guildpact', 'Dying to Serve', 'Powerstone Shard', 'Liliana''s Standard Bearer', 'Barren Moor', 'Sylvan Advocate', 'Delver of Secrets', 'Tidehollow Sculler', 'Frantic Inventory', 'Zulaport Cutthroat', 'Wandering Fumarole', 'Skyscanner', 'Traveler''s Amulet', 'Ad Nauseam', 'Stormtide Leviathan', 'Dakmor Salvage', 'Dokuchi Silencer', 'Kazuul''s Fury', 'Inscription of Ruin', 'Citadel Siege', 'Lantern-Lit Graveyard', 'Origin Spellbomb', 'Razortide Bridge', 'Judge''s Familiar', 'Go-Shintai of Hidden Cruelty', 'Stone Rain', 'Porcelain Legionnaire', 'Astral Drift', 'Tibalt''s Trickery', 'Rain of Tears', 'Stoneforge Masterwork', 'Kogla, the Titan Ape', 'Linvala, Shield of Sea Gate', 'Myr Retriever', 'Cloudblazer', 'Dimir Charm', 'Imperious Perfect', 'Watcher for Tomorrow', 'Strangleroot Geist', 'Demonic Dread', 'Laboratory Maniac', 'Gray Merchant of Asphodel', 'Secluded Courtyard', 'Nevinyrral''s Disk', 'Lofty Denial', 'Vampire Interloper', 'Fieldmist Borderpost', 'Bloodfell Caves', 'Pillar of Flame', 'Lavaclaw Reaches', 'Colossus of Akros', 'Kami of Restless Shadows', 'Hellrider', 'Shenanigans', 'Terminus', 'Melira, Sylvok Outcast', 'Call to the Kindred', 'Underworld Dreams', 'Thirst for Knowledge', 'Anje, Maid of Dishonor', 'Rampaging Ferocidon', 'Harmonize', 'Favored Hoplite', 'Tectonic Edge', 'Rush of Adrenaline', 'Balustrade Spy', 'Hypnotic Specter', 'The Long Reach of Night', 'Ral, Storm Conduit', 'Veinfire Borderpost', 'Stigma Lasher', 'Arlinn Kord', 'Zenith Flare', 'Disfigure', 'Flame Sweep', 'Glint-Sleeve Siphoner', 'Grasp of Darkness', 'Crumbling Vestige', 'Feed the Swarm', 'Drannith Healer', 'Clawing Torment', 'Thaumatic Compass', 'Plow Under', 'Valiant Rescuer', 'Shatter the Sky', 'Unburial Rites', 'Darkmoss Bridge', 'Blackbloom Rogue', 'Lightning Storm', 'Chief of the Foundry', 'Conflagrate', 'Cinder Pyromancer', 'Stubborn Denial', 'Raging Ravine', 'Hell Mongrel', 'Toolcraft Exemplar', 'Goblin Warchief', 'Arcbound Crusher', 'Kari Zev, Skyship Raider', 'Frontier Bivouac', 'Ethereal Armor', 'Arbor Elf', 'Silundi Vision', 'Power Sink', 'Radha, Heart of Keld', 'Asylum Visitor', 'Kiln Fiend', 'Warstorm Surge', 'Collateral Damage', 'Hypnotic Sprite', 'Search for Azcanta', 'Leech Gauntlet', 'Grisly Salvage', 'Stormblood Berserker', 'Hieroglyphic Illumination', 'Tempest Djinn', 'Sorin Markov', 'Stromkirk Captain', 'Dollhouse of Horrors', 'Grozoth', 'Yuan-Ti Malison', 'Spikefield Hazard', 'Mindcrank', 'Elves of Deep Shadow', 'Burst Lightning', 'Thassa''s Intervention', 'Archpriest of Iona', 'Vivid Marsh', 'Phyrexian Revoker', 'Sheltered Thicket', 'Submerged Boneyard', 'Glimmerpost', 'Phoenix of Ash', 'Arcbound Mouser', 'Song of Creation', 'Frantic Search', 'Chromatic Lantern', 'Tangled Florahedron', 'Wolf-Skull Shaman', 'Throes of Chaos', 'Declaration in Stone', 'Goblin Ruinblaster', 'Nullpriest of Oblivion', 'Crumbling Necropolis', 'Forbid', 'Spell Burst', 'Gaea''s Will', 'Flourishing Fox', 'Nissa, Steward of Elements', 'Sandsteppe Citadel', 'Foulmire Knight', 'Logic Knot', 'Duress', 'Malakir Rebirth', 'Faithless Salvaging', 'Rofellos, Llanowar Emissary', 'Pain Seer', 'Blackmail', 'Dragon Fodder', 'Kessig Wolf Run', 'Traverse the Ulvenwald', 'Mycosynth Golem', 'Skyclave Cleric', 'Ammit Eternal', 'Arcum Dagsson', 'Midnight Reaper', 'Temple of the Dragon Queen', 'Mistform Ultimus', 'Forgotten Cave', 'Lightning Strike', 'Skyclave Shade', 'Izzet Charm', 'Dragonskull Summit', 'Temple of Enlightenment', 'Crash Through', 'Nameless Inversion', 'Mirrorhall Mimic', 'Brilliant Restoration', 'Disallow', 'Master of Etherium', 'Selesnya Sanctuary', 'Urza''s Factory', 'Deep Forest Hermit', 'Blood Sun', 'Wolfbriar Elemental', 'Thalia, Heretic Cathar', 'Approach of the Second Sun', 'Patchwork Automaton', 'Bring to Light', 'Shard Volley', 'Abundant Harvest', 'Experiment One', 'Kumano Faces Kakkazan', 'Vivid Creek', 'Scorch Spitter', 'Bile Blight', 'Birthing Boughs', 'Footfall Crater', 'Ghostly Pilferer', 'Thopter Spy Network', 'Magister Sphinx', 'Sign in Blood', 'Avacyn''s Pilgrim', 'Hanged Executioner', 'Hyena Umbra', 'Vines of Vastwood', 'Dire-Strain Rampage', 'Fleecemane Lion', 'Expedition Map', 'Chandra''s Phoenix', 'Legion Angel', 'Slitherwisp', 'Dread Fugue', 'Nyxathid', 'Vexing Shusher', 'Impostor of the Sixth Pride', 'Momentary Blink', 'Whispers of Emrakul', 'Yahenni''s Expertise', 'Master of Death', 'Arcane Sanctum', 'Fanatic of Mogis', 'Dread Return', 'Assassin''s Ink', 'Feat of Resistance', 'Unforgiving One', 'Diamond Lion', 'Jack-o''-Lantern', 'Bone Shards', 'Of One Mind', 'Sprite Dragon', 'Young Wolf', 'Elvish Champion', 'Lochmere Serpent', 'Price of Progress', 'Voldaren Epicure', 'Dwynen, Gilt-Leaf Daen', 'Cave of Temptation', 'Day of Judgment', 'Demigod of Revenge', 'Unholy Heat', 'Shock', 'Elixir of Immortality', 'Vithian Renegades', 'Eldrazi Displacer', 'Brago, King Eternal', 'Game Trail', 'Savage Lands', 'Grapeshot', 'Leonin Relic-Warder', 'Goro-Goro, Disciple of Ryusei', 'Dennick, Pious Apprentice', 'Reflector Mage', 'Dread', 'Drannith Stinger', 'Rootbound Crag', 'Firebolt', 'Arc Trail', 'Encroaching Wastes', 'Goblin Cohort', 'Power Depot', 'Mercurial Pretender', 'Arcbound Worker', 'Urge to Feed', 'Haunted Dead', 'Blight Mamba', 'Akroma, Angel of Fury', 'Might of Old Krosa', 'Vendetta', 'Gilt-Leaf Ambush', 'Xathrid Necromancer', 'Joraga Warcaller', 'Leechridden Swamp', 'Shambling Ghast', 'Rage Forger', 'Spear of Heliod', 'Pentad Prism', 'Pyromancer Ascension', 'Mogg War Marshal', 'Basal Sliver', 'Vivid Grove', 'Duskwatch Recruiter', 'Sea-Dasher Octopus', 'Wall of Omens', 'Magister of Worth', 'Gavony Township', 'Treasure Cruise', 'Go for Blood', 'Sram''s Expertise', 'Fact or Fiction', 'Mystic Monastery', 'Putrid Goblin', 'Goblin Chieftain', 'Korlash, Heir to Blackblade', 'Gyruda, Doom of Depths', 'Gideon Jura', 'Extractor Demon', 'Abbot of Keral Keep', 'Gleaming Overseer', 'Lethal Exploit', 'Firebrand Archer', 'Unwinding Clock', 'Quiet Speculation', 'Kefnet the Mindful', 'Bloodcrazed Paladin', 'Inspired Idea', 'Michiko''s Reign of Truth', 'Clockspinning', 'Phantasmagorian', 'Fabricate', 'Lys Alana Huntmaster', 'Bolas''s Citadel', 'Jackal Pup', 'Kitchen Finks', 'Moon-Circuit Hacker', 'Temple of Mystery', 'Flame-Kin Zealot', 'Reckless Impulse', 'Dockside Chef', 'March of Wretched Sorrow', 'Artful Dodge', 'Undercity Informer', 'Molten Rain', 'Condescend', 'Helm of the Host', 'Drossforge Bridge', 'Vizier of the Scorpion', 'Goblin Anarchomancer', 'Wildfield Borderpost', 'Goblin Matron', 'Golgari Rot Farm', 'Heartless Summoning', 'Battle Cry Goblin', 'Blessed Alliance', 'Umara Wizard', 'Zareth San, the Trickster', 'Goblin Instigator', 'Tendrils of Agony', 'Earthquake', 'Mwonvuli Acid-Moss', 'Surrak, the Hunt Caller', 'Duskmantle Guildmage', 'Golgari Grave-Troll', 'Corpse Cobble', 'Kederekt Parasite', 'Voyaging Satyr', 'Bastion of Remembrance', 'Chainflail Centipede', 'Blacksmith''s Skill', 'Wasteland Strangler', 'Canyon Slough', 'Darksteel Colossus', 'Myr Battlesphere', 'Godo, Bandit Warlord', 'Fetid Pools', 'Angel''s Grace', 'Goblin Bombardment', 'Ensoul Artifact', 'Ground Rift', 'Silver Raven', 'Blood Vassal', 'Deep Analysis', 'Power Word Kill', 'Necrotic Ooze', 'Consider', 'Kaito''s Pursuit', 'Cordial Vampire', 'Benevolent Bodyguard', 'Carrier Thrall', 'Spark Spray', 'Ondu Inversion', 'Channel the Suns', 'Benalish Marshal', 'Mogg Fanatic', 'Invigorate', 'Honored Hydra', 'Aethersphere Harvester', 'Earthshaker Khenra', 'Oust', 'Dokuchi Shadow-Walker', 'Tomb of Urami', 'Incinerate', 'Lumbering Falls', 'Grim Haruspex', 'Costly Plunder', 'Rootwater Depths', 'Gryff''s Boon', 'Brainstone', 'Lotleth Giant', 'Flame Slash', 'Reinforced Ronin', 'Acidic Slime', 'Dark Withering', 'Aether Spellbomb', 'Neutralize', 'Ichorclaw Myr', 'Rabbit Battery', 'Dead // Gone'))) 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.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
        TRUE
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

```

[] (slow_query, 76.4, mysql)

Reported on decksite by mysql-perf

Location Hash: 98bffc24c50ca70dbb5180792d7d80e0d0bac65e

vorpal-buildbot commented 2 years ago

Exceeded slow_query limit (60.5 > 60.0) in mysql: ```

    SELECT

    d.id,
    d.finish,
    d.decklist_hash,
    cache.active_date,
    cache.wins,
    cache.losses,
    cache.draws,
    cache.color_sort,
    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 deck_cache AS season ON d.id = season.deck_id
    WHERE
        (d.id IN (SELECT deck_id FROM deck_card WHERE card IN ('Tymaret, Chosen from Death', 'Reprocess', 'Buried Ruin', 'Lodestone Golem', 'Shambling Ghast', 'Destroy the Evidence', 'Master of Etherium', 'Sulfur Falls', 'Bala Ged Recovery', 'Starstorm', 'Liquimetal Torque', 'Wasteland Strangler', 'Negate', 'Infernal Grasp', 'Ancient Stirrings', 'Sagu Mauler', 'Magister Sphinx', 'Bone Shards', 'Melira, Sylvok Outcast', 'Dictate of Kruphix', 'Nissa, Worldwaker', 'Blood Vassal', 'Hypergenesis', 'Blazing Rootwalla', 'Archon of Sun''s Grace', 'Zulaport Cutthroat', 'Become Immense', 'Cackling Counterpart', 'Kefnet the Mindful', 'Fact or Fiction', 'Lumbering Falls', 'Brainstone', 'Mesmeric Fiend', 'Blood Fountain', 'Reinforced Ronin', 'Viashino Pyromancer', 'Glint Hawk', 'Dark Withering', 'Jace, the Living Guildpact', 'Thrill of Possibility', 'Doomwake Giant', 'Suture Priest', 'Winged Words', 'Trail of Mystery', 'Kitchen Imp', 'Glimmerpost', 'Aether Charge', 'Kumano Faces Kakkazan', 'Terrarion', 'Spell Pierce', 'Darigaaz Reincarnated', 'Summer Bloom', 'Ancestral Anger', 'Nezahal, Primal Tide', 'Wedding Invitation', 'Heart-Piercer Manticore', 'Mina and Denn, Wildborn', 'Archon of Absolution', 'Myr Battlesphere', 'Demigod of Revenge', 'Incinerate', 'Signal Pest', 'Azorius Charm', 'Reckless Impulse', 'Entomber Exarch', 'Countryside Crusher', 'Simic Ascendancy', 'Metalwork Colossus', 'Teferi''s Puzzle Box', 'Alms of the Vein', 'Kessig Wolf Run', 'Hanweir Garrison', 'Heartless Act', 'Kessig Flamebreather', 'Boggart Ram-Gang', 'Etherium Sculptor', 'Firewild Borderpost', 'Prismari Campus', 'Braids, Cabal Minion', 'Aethersphere Harvester', 'Commune with the Gods', 'Kitchen Finks', 'Radiant Fountain', 'Broodhatch Nantuko', 'Shalai, Voice of Plenty', 'Molten-Tail Masticore', 'Nahiri''s Wrath', 'Restless Dreams', 'Chandra, Pyromaster', 'Restore Balance', 'Lightning Strike', 'Vivid Creek', 'Whisperwood Elemental', 'Engulf the Shore', 'Read the Bones', 'Mana Leak', 'Ohran Viper', 'Rites of Initiation', 'Miscast', 'Squadron Hawk', 'Slag Fiend', 'Dennick, Pious Apprentice', 'Rootwater Depths', 'Dark Petition', 'Fungal Reaches', 'Satyr Wayfinder', 'Mystifying Maze', 'Teferi''s Tutelage', 'Burning Inquiry', 'Cloud Key', 'Mulch', 'Mistvein Borderpost', 'Reality Heist', 'Sunpetal Grove', 'Treetop Village', 'Experimental Synthesizer', 'Narcomoeba', 'Timeless Witness', 'Viscera Seer', 'Scrabbling Claws', 'Hostile Desert', 'Kuldotha Forgemaster', 'Spine of Ish Sah', 'Opt', 'Tasigur, the Golden Fang', 'Forked Bolt', 'Frogmite', 'Lava Dart', 'Sanity Grinding', 'Demonic Bargain', 'Raging Ravine', 'Increasing Vengeance', 'Galvanic Relay', 'Scion of Oona', 'Arch of Orazca', 'Warbriar Blessing', 'Moonsnare Prototype', 'Goblin Instigator', 'Abiding Grace', 'Garruk Wildspeaker', 'Windborn Muse', 'Pelakka Wurm', 'Unburial Rites', 'Goblin Chieftain', 'Cascading Cataracts', 'Seeker of the Way', 'Obzedat, Ghost Council', 'Voidslime', 'Goblin Wardriver', 'Eternal Dominion', 'Expansion // Explosion', 'Dauntless Bodyguard', 'One with Nothing', 'Shardless Agent', 'Infuriate', 'Turnabout', 'Skyclave Cleric', 'Goblin Anarchomancer', 'Bolas''s Citadel', 'Faerie Miscreant', 'Talisman of Impulse', 'Fanatical Firebrand', 'Flinthoof Boar', 'Nest Invader', 'Sidisi, Undead Vizier', 'Orzhov Signet', 'Assault Strobe', 'Shrine of Burning Rage', 'Myth Realized', 'Malakir Rebirth', 'Hypnotic Sprite', 'Skarrgan Hellkite', 'Michiko''s Reign of Truth', 'Anafenza, Kin-Tree Spirit', 'Bond of Flourishing', 'Song of Creation', 'Mishra''s Factory', 'Rampant Growth', 'Boros Reckoner', 'Anguished Unmaking', 'Temple of Silence', 'Sprite Dragon', 'Keruga, the Macrosage', 'Eye of Vecna', 'Dead // Gone', 'Tendrils of Agony', 'Pelakka Predation', 'Kami of False Hope', 'Nahiri''s Lithoforming', 'Tectonic Giant', 'Cleric of Life''s Bond', 'Demonic Dread', 'Bloodhall Priest', 'Pyrite Spellbomb', 'Crumbling Vestige', 'Animist''s Awakening', 'Deeproot Champion', 'Guild Globe', 'Sylvan Primordial', 'Spikefield Hazard', 'Foundry Street Denizen', 'March of Wretched Sorrow', 'Faithless Salvaging', 'Pili-Pala', 'Ash Zealot', 'Walk the Aeons', 'Thirst for Knowledge', 'Glint-Sleeve Siphoner', 'Crypt Ghast', 'Horseshoe Crab', 'Molten Slagheap', 'Benevolent Bodyguard', 'Circuit Mender', 'Harmonize', 'Salt Road Ambushers', 'Drowned Catacomb', 'Wayward Guide-Beast', 'Play with Fire', 'Grisly Salvage', 'Desecration Demon', 'Woodfall Primus', 'Primal Command', 'Delver of Secrets', 'Big Game Hunter', 'Regisaur Alpha', 'Leatherback Baloth', 'Bogardan Hellkite', 'Goblin Cohort', 'Pristine Talisman', 'Baneslayer Angel', 'Kor Skyfisher', 'Vivid Grove', 'Ripjaw Raptor', 'Forgotten Cave', 'Curate', 'Tezzeret the Schemer', 'Army of the Damned', 'Growth Spasm', 'Khalni Ambush', 'Hellkite Overlord', 'You See a Guard Approach', 'Gaea''s Will', 'Prairie Stream', 'Dusk Legion Zealot', 'Ravenous Squirrel', 'Chief of the Foundry', 'Sphinx''s Tutelage', 'Frantic Inventory', 'Nightveil Specter', 'Radha, Heart of Keld', 'Dream Trawler', 'Iname as One', 'Oni-Cult Anvil', 'Darksteel Colossus', 'Fiery Fall', 'Jukai Naturalist', 'Fresh Meat', 'Sower of Temptation', 'Novijen, Heart of Progress', 'Extraplanar Lens', 'Dark Ritual', 'Temur War Shaman', 'Game Trail', 'Necrogoyf', 'Chandra, Fire of Kaladesh', 'Lavaclaw Reaches', 'Peer Through Depths', 'Soaring Seacliff', 'Darkmoss Bridge', 'Endless One', 'Undercity Informer', 'Terminus', 'Drowned Secrets', 'Genesis Wave', 'Murderous Redcap', 'Plagued Rusalka', 'Samut, the Tested', 'Dragonskull Summit', 'Chaplain of Alms', 'Future Sight', 'Lyra Dawnbringer', 'Kiln Fiend', 'Mindslaver', 'Regrowth', 'Winds of Abandon', 'Murderous Cut', 'Helix Pinnacle', 'Precursor Golem', 'Lofty Denial', 'Wildfield Borderpost', 'Maralen of the Mornsong', 'Battle Screech', 'Thaumatic Compass', 'Cloudpost', 'Haunted Dead', 'Westvale Abbey', 'Ghalta, Primal Hunger', 'Stubborn Denial', 'Bastion of Remembrance', 'Grand Warlord Radha', 'Hanweir Battlements', 'Searing Spear', 'Viashino Sandsprinter', 'Oust', 'Greater Gargadon', 'Ranger of Eos', 'Helm of the Gods', 'Voldaren Epicure', 'Silundi Vision', 'Tomb of Urami', 'Angel of Despair', 'Sylvan Ranger', 'Vault of the Archangel', 'Barren Moor', 'Ancient Amphitheater', 'Terastodon', 'Moon-Circuit Hacker', 'Kiora''s Follower', 'Brood Birthing', 'Lose Focus', 'Panharmonicon', 'Wheel of Fate', 'Gray Merchant of Asphodel', 'Quag Sickness', 'Strike It Rich', 'Myr Superion', 'Heir of Falkenrath', 'Desert of the Indomitable', 'Thryx, the Sudden Storm', 'Gideon Jura', 'Yahenni''s Expertise', 'Memory Lapse', 'Birds of Paradise', 'Rugged Highlands', 'Ponder', 'Sarkhan the Masterless', 'Elvish Visionary', 'Slagwoods Bridge', 'Elixir of Immortality', 'Monastery Siege', 'Spawning Pool', 'Magister of Worth', 'Strangleroot Geist', 'New Horizons', 'Greed', 'Ghor-Clan Rampager', 'Bile Blight', 'Thought Scour', 'Platinum Angel', 'Pyretic Ritual', 'Tatsunari, Toad Rider', 'Sapseep Forest', 'Ajani''s Pridemate', 'Dread Return', 'Tibalt''s Trickery', 'Gruul Spellbreaker', 'Fabricate', 'Hopeful Eidolon', 'Elvish Mystic', 'Hard Evidence', 'Avacyn''s Pilgrim', 'Balustrade Spy', 'Temple of Enlightenment', 'Izzet Charm', 'Foul Renewal', 'Volcano Hellion', 'Mistvault Bridge', 'Guttersnipe', 'Grim Haruspex', 'Barbarian Ring', 'Orzhov Pontiff', 'Dead Weight', 'Fume Spitter', 'Dread Fugue', 'Liliana''s Contract', 'Voldaren Pariah', 'Spare Supplies', 'Spider Umbra', 'Flame Slash', 'Rally the Peasants', 'Incubation Druid', 'Ayara, First of Locthwain', 'Opulent Palace', 'Bedlam Reveler', 'Ensoul Artifact', 'Shrapnel Blast', 'Spirited Companion', 'Thoughts of Ruin', 'Treasure Cruise', 'Akoum Warrior', 'Obscuring Aether', 'Season of Growth', 'Putrid Imp', 'Blackbloom Rogue', 'Fieldmist Borderpost', 'Sheltered Thicket', 'Cloudshift', 'Harmonic Prodigy', 'Fading Hope', 'Boros Recruit', 'Experiment One', 'Lotleth Giant', 'Marauding Raptor', 'Phantasmagorian', 'Hellrider', 'Brilliant Ultimatum', 'Throne of the God-Pharaoh', 'Biomancer''s Familiar', 'Gatekeeper of Malakir', 'Arlinn Kord', 'Conspiracy', 'Castigate', 'Port Town', 'Dreadhorde Invasion', 'Phylactery Lich', 'Stromkirk Noble', 'Mogg Fanatic', 'Grapeshot', 'Beacon of Tomorrows', 'Cathartic Pyre', 'Vampire Nighthawk', 'Pyromancer Ascension', 'Eye of Nowhere', 'Serrated Scorpion', 'Mogis''s Favor', 'Temple of Mystery', 'Zof Consumption', 'Hypnotic Specter', 'Commune with Dinosaurs', 'Network Disruptor', 'Herald of Torment', 'Semblance Anvil', 'Rite of Oblivion', 'Wandering Fumarole', 'Essence Flux', 'Krosan Tusker', 'Call of the Death-Dweller', 'Ember Swallower', 'Protean Hulk', 'Foulmire Knight', 'Battle Cry Goblin', 'Cathartic Reunion', 'Concealing Curtains', 'Stirring Wildwood', 'Deliberate', 'Kindle the Carnage', 'Spiteful Sliver', 'Flood Plain', 'Angel of Grace', 'Llanowar Elves', 'Kuldotha Rebirth', 'Duskwatch Recruiter', 'Talisman of Conviction', 'The Antiquities War', 'Gavony Township', 'Consider', 'Karn''s Temporal Sundering', 'Mark of Mutiny', 'Simian Spirit Guide', 'Chandra Ablaze', 'Veinfire Borderpost', 'Lavaball Trap', 'Dread Shade', 'Awakening Zone', 'Bring to Light', 'Duress', 'Acolyte of Affliction', 'Alchemist''s Vial', 'Aether Spellbomb', 'Mogg War Marshal', 'Undead Butler', 'Timely Reinforcements', 'Shamanic Revelation', 'Court Hussar', 'Vampire''s Kiss', 'Druid Class', 'Master of Death', 'Chancellor of the Spires', 'Tidehollow Sculler', 'Burning of Xinye', 'Rootbound Crag', 'Wall of Omens', 'Rubblebelt Maaka', 'Patchwork Automaton', 'Sanguine Statuette', 'Kabira Takedown', 'Bloodchief''s Thirst', 'Lingering Souls', 'Woe Strider', 'Zuran Orb', 'Tempest Djinn', 'Forbid', 'Ixidron', 'Boomerang', 'Jace, Memory Adept', 'Judge''s Familiar', 'Glittering Wish', 'Isolated Chapel', 'Kozilek''s Predator', 'Prophetic Prism', 'Yidaro, Wandering Monster', 'Vapor Snag', 'Faithful Mending', 'Blighted Woodland', 'Unexpected Windfall', 'Grand Architect', 'Once and Future', 'Channel the Suns', 'Needle Spires', 'Blessed Respite', 'Titanoth Rex', 'Verdant Command', 'Eiganjo Castle', 'Moorland Haunt', 'Reliquary Tower', 'Fiery Temper', 'Complicate', 'Sylvan Library', 'Glorious Protector', 'Mystic Snake', 'Logic Knot', 'Legion Angel', 'Savage Lands', 'Cabal Stronghold', 'Electrolyze', 'Pathrazer of Ulamog', 'Silver Raven', 'Jace Beleren', 'Angelic Destiny', 'Touch the Spirit Realm', 'Canyon Slough', 'Aeve, Progenitor Ooze', 'Cloudblazer', 'Grand Arbiter Augustin IV', 'Volcanic Salvo', 'Declaration in Stone', 'Ornithopter', 'Burst Lightning', 'Serra Avenger', 'Experiment Kraj', 'Warstorm Surge', 'Temple of the Dragon Queen', 'Tamiyo''s Safekeeping', 'Shriekmaw', 'Clawing Torment', 'Huatli, Warrior Poet', 'Chandra, Fire Artisan', 'Hateful Eidolon', 'Wall of Blossoms', 'Gallia of the Endless Dance', 'Zhur-Taa Goblin', 'Repeal', 'Urza''s Factory', 'Fetid Pools', 'Tamiyo, Collector of Tales', 'Nicol Bolas, Planeswalker', 'Midnight Clock', 'Rofellos, Llanowar Emissary', 'Commence the Endgame', 'Storm Herd', 'Razormane Masticore', 'Hushwing Gryff', 'Explore', 'Elves of Deep Shadow', 'Artificer''s Assistant', 'Dimir Aqueduct', 'Talisman of Curiosity', 'Ghost Quarter', 'Crash Through', 'Dragonstorm', 'Sokenzan Smelter', 'Festival Crasher', 'Chief Engineer', 'Rustvale Bridge', 'Pentad Prism', 'Mastermind''s Acquisition', 'Lunarch Veteran', 'Golgari Rot Farm', 'Kunoros, Hound of Athreos', 'Lantern of the Lost', 'Sudden Edict', 'Rampaging Ferocidon', 'Earthquake', 'Cryptic Caves', 'Stratus Dancer', 'Braid of Fire', 'Gadwick, the Wizened', 'Venser, Shaper Savant', 'Etali, Primal Storm', 'Elsewhere Flask', 'Tangled Florahedron', 'Dryad''s Revival', 'Blighted Fen', 'Smokestack', 'Sleight of Hand', 'Temple of Malady', 'Asylum Visitor', 'Exhaustion', 'Thornwood Falls', 'Goldmire Bridge', 'Blinkmoth Well', 'Drossforge Bridge', 'Scattered Groves', 'Basking Rootwalla', 'Curiosity', 'Thraben Inspector', 'Shatterskull Charger', 'Dread', 'Everflowing Chalice', 'Cartel Aristocrat', 'Secret Plans', 'Field of Ruin', 'Basilica Bell-Haunt', 'Ghitu Encampment', 'Seething Song', 'Vindicate', 'Turn the Earth', 'Undying Malice', 'Aria of Flame', 'Gryff''s Boon', 'Condemn', 'Fraying Sanity', 'Bag of Holding', 'Sweltering Suns', 'Expedition Map', 'Containment Construct', 'Gitaxian Probe', 'Kazandu Refuge', 'Heartfire', 'Heartbeat of Spring', 'Fiendslayer Paladin', 'Goblin Bushwhacker', 'Firebrand Archer', 'Merfolk Secretkeeper', 'Dreamshackle Geist', 'Magmatic Insight', 'Aphemia, the Cacophony', 'Desert of the Fervent', 'Zephyr Sprite', 'Shambling Vent', 'Wildfire', 'Search for Azcanta', 'Carrier Thrall', 'Jolrael, Mwonvuli Recluse', 'Sign in Blood', 'Sandsteppe Citadel', 'Generous Visitor', 'Faerie Vandal', 'Sunset Revelry', 'Nyxborn Shieldmate', 'Rabbit Battery', 'Frantic Search', 'Ethereal Armor', 'Cruel Celebrant', 'Arbor Elf', 'Glorybringer', 'Abundant Harvest', 'Jwari Disruption', 'Willbreaker', 'Cabal Therapist', 'Bump in the Night'))) 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.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
        TRUE
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

```

[] (slow_query, 60.5, mysql)

Reported on decksite by mysql-perf

Location Hash: 98bffc24c50ca70dbb5180792d7d80e0d0bac65e

Labels: decksite