PennyDreadfulMTG / perf-reports

2 stars 7 forks source link

Exceeded slow_query limit (60.1 > 60.0) in mysql: ``` #59727

Open vorpal-buildbot opened 1 year ago

vorpal-buildbot commented 1 year 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 ('Merfolk Windrobber', 'Golgari Grave-Troll', 'Chief of the Foundry', 'Scrapheap Scrounger', 'Vapor Snag', 'Sphere of Safety', 'Mana Leak', 'Oust', 'Cloudpost', 'Blackbloom Rogue', 'Yavimaya Coast', 'Basking Rootwalla', 'Goblin Anarchomancer', 'Isolated Chapel', 'Trickbind', 'Starfield Mystic', 'Thought Scour', 'Essence Flux', 'Mistcutter Hydra', 'Lochmere Serpent', 'Viscera Seer', 'Touch the Spirit Realm', 'Circular Logic', 'Temple of Enlightenment', 'Noose Constrictor', 'Tempered Steel', 'Temporal Extortion', 'Wall of Omens', 'Feed the Swarm', 'Murderous Redcap', 'Sylvan Scrying', 'Heartless Act', 'Master of Death', 'Glint-Sleeve Siphoner', 'Caves of Koilos', 'Shambling Vent', 'Clifftop Retreat', 'Dream Trawler', 'Temple of Malady', 'Dakmor Salvage', 'Animating Faerie', 'Grim Haruspex', 'Archaeomancer', 'Empty the Warrens', 'Pack Rat', 'Vedalken Mastermind', 'Faerie Vandal', 'Toolcraft Exemplar', 'Spell Pierce', 'Michiko''s Reign of Truth', 'Skyclave Shade', 'Steel Hellkite', 'Insolent Neonate', 'Ashen Ghoul', 'Late to Dinner', 'Grapple with the Past', 'Lose Focus', 'Wild Cantor', 'Voidmage Prodigy', 'Arcum''s Astrolabe', 'Satyr Wayfinder', 'Smallpox', 'Bitterheart Witch', 'Fire-Lit Thicket', 'Wonder', 'Seething Song', 'Day of Judgment', 'Auramancer', 'Tyrant''s Scorn', 'Delver of Secrets', 'Game Trail', 'Vault Skirge', 'Gatekeeper of Malakir', 'Growth-Chamber Guardian', 'Drowned Catacomb', 'Orzhov Basilica', 'Phantasmagorian', 'Goblin Bombardment', 'Frantic Search', 'Skirk Prospector', 'Blind Obedience', 'Mindslaver', 'Curse of Bloodletting', 'Patchwork Automaton', 'Nested Shambler', 'Stinkdrinker Bandit', 'Tasigur, the Golden Fang', 'Breakthrough', 'Nephalia Drownyard', 'Wild Mongrel', 'Idyllic Tutor', 'Ensoul Artifact', 'Sleight of Hand', 'Circuit Mender', 'Riveteers Overlook', 'Snow-Covered Plains', 'Restoration Angel', 'Sol Talisman', 'Phyrexian Dreadnought', 'Mogg War Marshal', 'Kabira Takedown', 'Cruel Reality', 'Fruit of Tizerus', 'Snow-Covered Swamp', 'Curse of Surveillance', 'Darksteel Citadel', 'Brokers Hideout', 'Dihada''s Ploy', 'Arcbound Worker', 'Tilling Treefolk', 'Lonely Sandbar', 'Woe Strider', 'Fetid Pools', 'Smuggler''s Copter', 'Vivid Marsh', 'Rootbound Crag', 'March of Swirling Mist', 'Sea Gate Oracle', 'Leonin Relic-Warder', 'Goblin Instigator', 'Simic Charm', 'Cathartic Reunion', 'Deep Analysis', 'Faerie Miscreant', 'Tangled Islet', 'Hieroglyphic Illumination', 'Step Through', 'Fecundity', 'Ponder', 'Ancient Stirrings', 'Goblin Chieftain', 'Academy Loremaster', 'Sigil of the Empty Throne', 'Temple of Deceit', 'Barrin, Tolarian Archmage', 'Hinterland Harbor', 'Gitaxian Probe', 'Icehide Golem', 'Steel Overseer', 'Watcher for Tomorrow', 'Dark Ritual', 'Court Homunculus', 'Curse of Thirst', 'Thraben Inspector', 'Slip Out the Back', 'Wasteland Strangler', 'Honored Hydra', 'Brineborn Cutthroat', 'Thieves'' Fortune', 'Riptide Laboratory', 'Magus of the Bazaar', 'Phyrexian Revoker', 'Buried Ruin', 'Duress', 'Oona''s Blackguard', 'Tear Asunder', 'Hotshot Mechanic', 'Death Cloud', 'Stinkweed Imp', 'Goblin Matron', 'Mesa Enchantress', 'Tidehollow Sculler', 'Search for Azcanta', 'Golgari Brownscale', 'Contaminated Aquifer', 'Deprive', 'Silversmote Ghoul', 'Nihil Spellbomb', 'Platinum Angel', 'Blood Artist', 'Zulaport Cutthroat', 'Impulse', 'Sylvan Library', 'Tolarian Terror', 'Founding the Third Path', 'Naban, Dean of Iteration', 'Shambling Shell', 'River of Tears', 'Timeless Dragon', 'Vivid Meadow', 'Soaring Thought-Thief', 'Arrogant Wurm', 'Disrupting Shoal', 'Memory Lapse', 'Parallax Wave', 'Spirited Companion', 'Crumbling Necropolis', 'Sudden Edict', 'Thief of Sanity', 'Norn''s Annex', 'Garruk Wildspeaker', 'Glacial Fortress', 'Venser, Shaper Savant', 'Sheltered Thicket', 'Nimbus Maze', 'Rise and Shine', 'Forbid', 'Blinkmoth Nexus', 'Temple of Malice', 'Creeping Chill', 'Pashalik Mons', 'Putrid Goblin', 'Curse of Misfortunes', 'Heliod''s Pilgrim', 'Kor Skyfisher', 'Radical Idea', 'Glimmerpost', 'Mishra''s Factory', 'Commune with the Gods', 'Bloodchief''s Thirst', 'Razortide Bridge', 'Okiba Reckoner Raid', 'Grumgully, the Generous', 'Cabal Therapist', 'Tempest Djinn', 'Repeal', 'Treasure Cruise', 'Sower of Temptation'))) 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.1, mysql)

Reported on decksite by mysql-perf

Location Hash: 0ac1fdccfb1f6263e29f5cb1ea6fa7016aa94305

vorpal-buildbot commented 1 year ago

Exceeded slow_query limit (86.4 > 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 ('Slitherhead', 'Ob Nixilis Reignited', 'Erebos''s Intervention', 'Unburial Rites', 'Domri, Anarch of Bolas', 'Temple of Triumph', 'Riftwing Cloudskate', 'Jodah''s Codex', 'Returned Reveler', 'Mogg War Marshal', 'Buried Ruin', 'Groundswell', 'Jungle Hollow', 'Hieroglyphic Illumination', 'Cloudshift', 'Okiba Reckoner Raid', 'Ember-Fist Zubera', 'Tempered Steel', 'Flame Rift', 'Master of Death', 'Militia Bugler', 'Ash Zealot', 'Birds of Paradise', 'Lightning Axe', 'Goblin Chieftain', 'Tear Asunder', 'Silundi Vision', 'Prophetic Prism', 'Resolute Reinforcements', 'Stromkirk Noble', 'Shambling Shell', 'Saffi Eriksdotter', 'Ancient Stirrings', 'Yorvo, Lord of Garenbrig', 'Grumgully, the Generous', 'Kami of False Hope', 'Archfiend''s Vessel', 'Haunted Dead', 'Chained to the Rocks', 'Silversmote Ghoul', 'Terminus', 'Ichorclaw Myr', 'Dread Return', 'Molten Tributary', 'Knight of the White Orchid', 'Skirge Familiar', 'Shadow Prophecy', 'Leonin Warleader', 'Phyrexian Dreadnought', 'Darksteel Colossus', 'Delver of Secrets', 'Unearth', 'Flametongue Yearling', 'Terminal Agony', 'Izzet Signet', 'Sin Prodder', 'Phantasmagorian', 'Lose Focus', 'Aggressive Mining', 'Domri Rade', 'Woodland Wanderer', 'Neutralize', 'Tocatli Honor Guard', 'Temple of Deceit', 'Treasure Cruise', 'Ral, Izzet Viceroy', 'Goblin Wardriver', 'Howling Mine', 'Timely Hordemate', 'Sandsteppe Citadel', 'Yuan-Ti Malison', 'Goblin Bombardment', 'Kithkin Spellduster', 'Nature''s Lore', 'Ranger''s Hawk', 'Creeping Chill', 'Unlucky Witness', 'Ball Lightning', 'Simic Guildgate', 'Day of Judgment', 'Mistveil Plains', 'Treasure Map', 'Baffling End', 'Deranged Hermit', 'Raging Ravine', 'Elvish Mystic', 'Faithless Salvaging', 'Glorious End', 'Idyllic Grange', 'Malakir Rebirth', 'Toolcraft Exemplar', 'Decree of Justice', 'Golgari Guildgate', 'Chandra Nalaar', 'Radiant Grove', 'Blackmail', 'Sram''s Expertise', 'Wing Shards', 'Bloodsoaked Champion', 'Maze''s End', 'Obzedat, Ghost Council', 'Graven Cairns', 'Radha''s Firebrand', 'Genju of the Spires', 'Stoke the Flames', 'Mishra''s Factory', 'Sea Gate Oracle', 'Azorius Charm', 'Necrotic Ooze', 'Oriq Loremage', 'Search for Azcanta', 'Seaside Citadel', 'Consecrate // Consume', 'Raven''s Crime', 'Augury Adept', 'Shambling Vent', 'Thaumatic Compass', 'Raffine''s Informant', 'Ardent Electromancer', 'Become Immense', 'Burning-Tree Emissary', 'Time Stretch', 'Seething Song', 'Orcus, Prince of Undeath', 'Ashen-Skin Zubera', 'Memory Lapse', 'Force of Virtue', 'Tribute Mage', 'Sonorous Howlbonder', 'Benevolent Bodyguard', 'Madcap Experiment', 'Stubborn Denial', 'Metallurgic Summonings', 'Wizened Cenn', 'Hunted Nightmare', 'Temple of Silence', 'Reckoner''s Bargain', 'Season of Growth', 'Coiling Oracle', 'Precinct Captain', 'Hushwing Gryff', 'Cleansing Wildfire', 'Woe Strider', 'Biting Rain', 'Savage Lands', 'Okina, Temple to the Grandfathers', 'Disrupting Shoal', 'Arch of Orazca', 'Ornithopter', 'Grisly Salvage', 'Smallpox', 'Forsake the Worldly', 'First-Sphere Gargantua', 'Azorius Guildgate', 'Sheltered Thicket', 'Scholar of the Ages', 'Nishoba Brawler', 'Gitaxian Probe', 'Snow-Covered Swamp', 'Blighted Agent', 'Rakdos Guildgate', 'Auramancer', 'Dark Ritual', 'Timeless Dragon', 'Thirst for Knowledge', 'Vesperlark', 'Drowned Secrets', 'Acidic Slime', 'Snow-Covered Plains', 'Conqueror''s Galleon', 'Return to the Ranks', 'Caves of Koilos', 'Maestros Theater', 'Shimmerdrift Vale', 'Goldmeadow Harrier', 'Drownyard Temple', 'Gideon Jura', 'Alchemist''s Refuge', 'Ghor-Clan Rampager', 'Ballyrush Banneret', 'Necrogen Mists', 'Didn''t Say Please', 'Canyon Slough', 'Scrapheap Scrounger', 'Idyllic Beachfront', 'Burst Lightning', 'End-Raze Forerunners', 'Farseek', 'Plow Under', 'Madblind Mountain', 'Rabbit Battery', 'Urza''s Factory', 'Ajani Goldmane', 'Vilis, Broker of Blood', 'Countersquall', 'Slimefoot''s Survey', 'Floating-Dream Zubera', 'Gavony Township', 'Tezzeret the Schemer', 'Nadaar, Selfless Paladin', 'Yosei, the Morning Star', 'Verdurous Gearhulk', 'Scattered Groves', 'Murderous Redcap', 'Chandra, Pyromaster', 'Jace, Memory Adept', 'Ajani, the Greathearted', 'Bedevil', 'Cold-Eyed Selkie', 'Sol Talisman', 'Erayo, Soratami Ascendant', 'River of Tears', 'Edge of Autumn', 'Hotshot Mechanic', 'Ravenous Chupacabra', 'Frantic Search', 'Timeless Witness', 'Bala Ged Recovery', 'Lightning Strike', 'Magister of Worth', 'Intangible Virtue', 'Triskelion', 'Elvish Hexhunter', 'Undercity Informer', 'Court Homunculus', 'Kambal, Consul of Allocation', 'Herd Migration', 'Call of the Death-Dweller', 'Legacy Weapon', 'Arcane Sanctum', 'Winds of Rebuke', 'Dusk Mangler', 'Darkmoss Bridge', 'Boreal Shelf', 'Thoughtweft Trio', 'Rona''s Vortex', 'Elixir of Immortality', 'Deep Forest Hermit', 'Blood Artist', 'Llanowar Elves', 'Game Trail', 'Thrill of Possibility', 'Vraska, Relic Seeker', 'Sundial of the Infinite', 'Stirring Wildwood', 'Bring to Light', 'Narcomoeba', 'Order of Whiteclay', 'Jokulhaups', 'Sprite Dragon', 'Prophetic Flamespeaker', 'Relic Robber', 'Primal Command', 'Bone Shards', 'Nimbus Maze', 'Morselhoarder', 'Disenchant', 'Kokusho, the Evening Star', 'Boros Guildgate', 'Postmortem Lunge', 'Brokers Ascendancy', 'Bolt Hound', 'Boros Garrison', 'Glorybringer', 'Plaza of Harmony', 'Froghemoth', 'Zombie Infestation', 'Sublime Archangel', 'Spirited Companion', 'Nether Spirit', 'Vampiric Rites', 'Vindicate', 'Search for Tomorrow', 'Forbid', 'Timely Reinforcements', 'Champion of Wits', 'Rune of Protection: Red', 'Opulent Palace', 'Touch the Spirit Realm', 'Dryad Militant', 'Izzet Guildgate', 'Echoing Return', 'Clattering Skeletons', 'Archon of Sun''s Grace', 'Hinterland Harbor', 'Honor of the Pure', 'Doom Foretold', 'Domri, Chaos Bringer', 'Flayer of the Hatebound', 'Labyrinth Raptor', 'Strangle', 'Carth the Lion', 'Dark-Dweller Oracle', 'Mana Leak', 'Ghalta, Primal Hunger', 'Massacre Girl', 'Tilling Treefolk', 'Aviary Mechanic', 'Leyline of the Meek', 'Glint Hawk', 'Vapor Snag', 'Spell Pierce', 'Abrade', 'Tectonic Giant', 'Rally the Ancestors', 'Empty the Warrens', 'Tamiyo''s Safekeeping', 'Undead Augur', 'Hordeling Outburst', 'Glowspore Shaman', 'Ponder', 'Rhox War Monk', 'Lavaclaw Reaches', 'Soldier of the Pantheon', 'Deep Analysis', 'Figure of Destiny', 'Obsessive Search', 'Gift of Immortality', 'Kor Skyfisher', 'Burning of Xinye', 'Stinkweed Imp', 'Spawning Pit', 'Painful Truths', 'Heartless Act', 'Pia and Kiran Nalaar', 'Jwari Disruption', 'Tyrant''s Scorn', 'Shadowborn Apostle', 'Chandra, Flamecaller', 'Thragtusk', 'Secluded Courtyard', 'Geomancer''s Gambit', 'Nevinyrral''s Disk', 'Ritual of Soot', 'Mystic Monastery', 'Haunted Mire', 'Glistener Elf', 'Barren Moor', 'Fyndhorn Elves', 'Clifftop Retreat', 'Bump in the Night', 'Rakdos Headliner', 'Secluded Steppe', 'Hour of Promise', 'Yavimaya Coast', 'Tasigur, the Golden Fang', 'Recurring Nightmare', 'Pelakka Predation', 'Thought Scour', 'Dreadhorde Butcher', 'Dreadfeast Demon', 'Phyrexian Revoker', 'Disallow', 'Sunlit Marsh', 'Splendid Reclamation', 'Moss-Pit Skeleton', 'Satyr Wayfinder', 'Asmodeus the Archfiend', 'Slip Out the Back', 'Immortal Servitude', 'Steel Overseer', 'March of Swirling Mist', 'Knight of Meadowgrain', 'Skyclave Cleric', 'Faerie Vandal', 'Blight Mamba', 'Fauna Shaman', 'Vampire Opportunist', 'Kitchen Imp', 'Primalcrux', 'Shrieking Affliction', 'Cult Conscript', 'Rumor Gatherer', 'Dream Stalker', 'Magmatic Channeler', 'Invigorate', 'Yahenni''s Expertise', 'Rot Farm Skeleton', 'Inkwell Leviathan', 'Drossforge Bridge', 'Goblin Matron', 'Brainstone', 'Lotleth Troll', 'Jaxis, the Troublemaker', 'Condemn', 'Greater Good', 'Ajani Steadfast', 'Wall of Blossoms', 'Yavimaya Iconoclast', 'Burning Inquiry', 'Grim Initiate', 'Grim Lavamancer', 'Braids, Cabal Minion', 'Glenn, the Voice of Calm', 'Drowned Catacomb', 'Sunpetal Grove', 'Eternal Dragon', 'Fire Prophecy', 'King Darien XLVIII', 'Shadow-Rite Priest', 'Circuit Mender', 'Feed the Swarm', 'Electrostatic Infantry', 'Selesnya Guildgate', 'Obsidian Charmaw', 'Mina and Denn, Wildborn', 'Dead of Winter', 'Opt', 'Cut Down', 'Sphinx of the Steel Wind', 'Astral Slide', 'Last Stand', 'Silverbluff Bridge', 'Myth Realized', 'Dimir Guildgate', 'Dripping-Tongue Zubera', 'Radha, Heart of Keld', 'Tainted Indulgence', 'Venser, Shaper Savant', 'Mythos of Nethroi', 'Magosi, the Waterveil', 'Reveillark', 'Spikefield Hazard', 'Corpse Appraiser', 'Arcum''s Astrolabe', 'Reality Acid', 'Crawling Barrens', 'Ayli, Eternal Pilgrim', 'Isolated Chapel', 'Dawn of Hope', 'Gruul Guildgate', 'Cenn''s Heir', 'Idyllic Tutor', 'Entropic Eidolon', 'Gutterbones', 'Sudden Edict', 'Glint-Sleeve Siphoner', 'Glittering Wish', 'Pillar of the Paruns', 'Kogla, the Titan Ape', 'Rune-Scarred Demon', 'Wonder', 'Thistledown Liege', 'Jace, Unraveler of Secrets', 'Flicker of Fate', 'Condescend', 'Sweltering Suns', 'Protect the Negotiators', 'Tempest Djinn', 'Rustvale Bridge', 'Repeal', 'Springbloom Druid', 'Crumbling Necropolis', 'Fraying Sanity', 'Sylvan Scrying', 'Escape to the Wilds', 'Dreadhorde Invasion', 'Viridian Emissary', 'Balustrade Spy', 'Kithkin Harbinger', 'Silent-Chant Zubera', 'Shivan Reef', 'Pentad Prism', 'Glimmerpost', 'Prismatic Omen', 'Garruk Wildspeaker', 'Orator of Ojutai', 'Slagstorm', 'Summer Bloom', 'Glacial Fortress', 'Geyadrone Dihada', 'Silver Scrutiny', 'Darksteel Citadel', 'Wayward Swordtooth', 'Wasteland Strangler', 'Harmless Offering', 'Goblin Instigator', 'Myr Battlesphere', 'Emmara, Soul of the Accord', 'Sacred Peaks', 'Zurgo Bellstriker', 'Dennick, Pious Apprentice', 'Blazing Rootwalla', 'Skull Prophet', 'Akoum Warrior', 'Putrid Goblin', 'Cloudpost', 'Rafiq of the Many', 'Fiend Hunter', 'Liliana Vess', 'Forked Bolt', 'Silent Gravestone', 'Temple of Enlightenment', 'Shinka, the Bloodsoaked Keep', 'Siege Rhino', 'Regal Force', 'Wandering Fumarole', 'Might of Old Krosa', 'Llanowar Greenwidow', 'Gather the Pack', 'Dream Trawler', 'Hanweir Garrison', 'Avacyn''s Pilgrim', 'Chief of the Foundry', 'Parallax Wave', 'Inspiring Overseer', 'Voldaren Pariah', 'Watcher for Tomorrow', 'Trickbind', 'Tranquil Thicket', 'Gigantomancer', 'Growth-Chamber Guardian', 'Slith Firewalker', 'Temple of Malady', 'Viscera Seer', 'Obscura Storefront', 'Bad River', 'Qasali Pridemage', 'Karmic Guide', 'Tangled Islet', 'Impulse', 'Prophet of Kruphix', 'Oracle of Mul Daya', 'Seasoned Hallowblade', 'Joraga Treespeaker', 'Titans'' Nest', 'Emeria, the Sky Ruin', 'Frostwalk Bastion', 'Barrenton Medic', 'Garruk Relentless', 'Agonizing Remorse', 'Founding the Third Path', 'Fiery Impulse', 'Shrine of Burning Rage', 'Orzhov Guildgate', 'Butcher of the Horde', 'Fiery Temper', 'Commune with the Gods', 'Harmonize', 'Ruin Crab', 'Dictate of Kruphix', 'Slagwoods Bridge', 'Priest of Urabrask', 'Barbarian Ring', 'Nihil Spellbomb', 'Golgari Rot Farm', 'Maestros Charm', 'Startled Awake', 'Blackbloom Rogue', 'Brokers Hideout', 'Goblin Anarchomancer', 'Steel Hellkite', 'Mind Rake', 'Sunscorch Regent', 'Wild Cantor', 'Priest of Fell Rites', 'Putrid Imp', 'Battle Screech', 'Call the Bloodline', 'Fire-Lit Thicket', 'Tolarian Terror', 'Mikokoro, Center of the Sea', 'Buried Alive', 'Xathrid Necromancer', 'Blood for Bones', 'Fetid Pools', 'Astral Drift', 'Rofellos, Llanowar Emissary', 'Restoration Angel', 'Mogg Fanatic', 'Scrabbling Claws', 'Orim''s Chant', 'Tragic Poet', 'Easy Prey', 'Experimental Synthesizer', 'Hanweir Militia Captain', 'Wall of Omens', 'Platinum Angel', 'Thraben Inspector', 'Needle Spires', 'Heap Doll', 'Teachings of the Kirin', 'Sylvan Library', 'Abiding Grace', 'Incinerate', 'Patchwork Automaton', 'Nicol Bolas, Planeswalker', 'Vedalken Mastermind', 'Mistcutter Hydra', 'Bloodchief''s Thirst', 'Improbable Alliance', 'Triumphant Adventurer', 'Experimental Frenzy', 'Raise the Alarm', 'Alms of the Vein', 'Rustic Clachan', 'Razortide Bridge', 'Woodlurker Mimic', 'Intervention Pact', 'Blinkmoth Nexus', 'Fecundity', 'Rootbound Crag', 'Kabira Takedown', 'Vines of Vastwood', 'Fact or Fiction', 'Cathedral of War', 'Think Twice', 'Putrid Leech', 'Lingering Souls', 'Llanowar Augur', 'Oust', 'Pashalik Mons', 'Cabal Initiate', 'Simian Spirit Guide', 'Scuttletide', 'Reaper from the Abyss', 'Mindslaver', 'Circular Logic', 'Late to Dinner', 'Domri''s Ambush', 'Dreamstealer', 'Sarkhan the Masterless', 'Brave the Elements', 'Westvale Abbey', 'Verdant Eidolon', 'Kaya, Ghost Assassin', 'Alchemist''s Gambit', 'Snow-Covered Forest', 'Hallowed Moonlight', 'Archfiend of Depravity', 'Asylum Visitor', 'Pyretic Ritual', 'Sorin, Vengeful Bloodlord', 'Bloodthrone Vampire', 'Tidehollow Sculler', 'Silverquill Silencer', 'Leonin Relic-Warder', 'Kumano Faces Kakkazan', 'Blessed Alliance', 'Ranger of Eos', 'Phoenix Chick', 'Mire Triton', 'Rot Wolf', 'Nested Shambler', 'Dark Withering', 'Smuggler''s Copter', 'Icehide Golem', 'Skirk Prospector', 'Chance for Glory', 'Nevermaker', 'Ranger''s Guile', 'Tatsunari, Toad Rider', 'Dragonskull Summit', 'Dimir Signet', 'Taborax, Hope''s Demise', 'Izzet Charm', 'Mizzium Mortars', 'Stonehorn Dignitary', 'Duress', 'Radiant Fountain', 'Judith, the Scourge Diva', 'Jaddi Offshoot'))) 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, 86.4, mysql)

Reported on decksite by mysql-perf

Location Hash: 0ac1fdccfb1f6263e29f5cb1ea6fa7016aa94305

Labels: decksite

vorpal-buildbot commented 1 year ago

Exceeded slow_query limit (76.8 > 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 ('Stonecloaker', 'Burst Lightning', 'Silumgar''s Command', 'Sacred Peaks', 'Wargate', 'Yavimaya Coast', 'Frontline Medic', 'Tasigur, the Golden Fang', 'Pull from Tomorrow', 'Mystic Retrieval', 'Activated Sleeper', 'Life of Toshiro Umezawa', 'Lay Down Arms', 'Mausoleum Secrets', 'Mistcutter Hydra', 'Faeburrow Elder', 'Repeal', 'Wayward Swordtooth', 'Nadaar, Selfless Paladin', 'Wooded Bastion', 'Sire of Insanity', 'Hostage Taker', 'Elvish Mystic', 'Compulsion', 'Pelakka Predation', 'The Elder Dragon War', 'Epochrasite', 'Resolute Archangel', 'Skyknight Vanguard', 'Harsh Mentor', 'Hamlet Captain', 'Rustwing Falcon', 'Zetalpa, Primal Dawn', 'Soaring Drake', 'Aria of Flame', 'Drownyard Temple', 'Ultimate Price', 'Memory Lapse', 'Detention Sphere', 'Sunlit Marsh', 'Dusk Legion Zealot', 'Shinka, the Bloodsoaked Keep', 'Phyrexian Dreadnought', 'Braids, Cabal Minion', 'Mindslaver', 'Sol Talisman', 'Vivid Meadow', 'Tree of Tales', 'Throne of Geth', 'Sterling Grove', 'Hapless Researcher', 'Grumgully, the Generous', 'Abiding Grace', 'Improbable Alliance', 'Staff of Domination', 'Plow Under', 'Ash Zealot', 'Sea Gate Oracle', 'Kabira Crossroads', 'Experimental Synthesizer', 'Crypt Incursion', 'Idyllic Beachfront', 'Tolsimir, Friend to Wolves', 'Castigate', 'Stonehorn Dignitary', 'Erebos''s Intervention', 'Benevolent Bodyguard', 'Search for Tomorrow', 'Heliod''s Intervention', 'Riftsweeper', 'Angel of Grace', 'Okiba Reckoner Raid', 'Risona, Asari Commander', 'Drossforge Bridge', 'Patriarch''s Bidding', 'Evacuation', 'Soul Snare', 'Rustvale Bridge', 'Goblin Electromancer', 'Raven''s Crime', 'Enchantress''s Presence', 'Lazotep Plating', 'Verduran Enchantress', 'Temple of Silence', 'Flame-Kin Zealot', 'Chandra''s Phoenix', 'Birds of Paradise', 'Isolated Chapel', 'Disallow', 'Conqueror''s Galleon', 'Sylvan Scrying', 'Thassa''s Intervention', 'Jungle Hollow', 'Nether Spirit', 'Faerie Vandal', 'Nether Traitor', 'Pilfer', 'Raging Goblin', 'Big Score', 'Ancient Stirrings', 'Boom // Bust', 'Carnival // Carnage', 'Fracturing Gust', 'Figure of Destiny', 'Nightmare Shepherd', 'Recruitment Officer', 'Pixie Illusionist', 'Maelstrom Pulse', 'Dryad Militant', 'Thirst for Meaning', 'Consume the Meek', 'Vilis, Broker of Blood', 'Lose Focus', 'Izzet Charm', 'The Underworld Cookbook', 'Terramorphic Expanse', 'Barren Moor', 'Ramunap Excavator', 'Skycat Sovereign', 'Genesis Wave', 'Silverbluff Bridge', 'Silent Gravestone', 'Vampire Lacerator', 'Myth Realized', 'Tear Asunder', 'Gnarlid Pack', 'Legion Lieutenant', 'Lich''s Mastery', 'Protean Hulk', 'Sejiri Shelter', 'Undercity Informer', 'Forbidden Alchemy', 'Nevinyrral''s Disk', 'Oblivion Ring', 'Lightning Strike', 'Kumano Faces Kakkazan', 'Silverquill Silencer', 'Fecundity', 'Lightning Mauler', 'Wildfield Borderpost', 'Ondu Inversion', 'Kazuul''s Fury', 'Viashino Pyromancer', 'Madcap Experiment', 'Mukotai Soulripper', 'Revitalize', 'Eternal Dragon', 'General Ferrous Rokiric', 'Cultivate', 'Aurelia''s Fury', 'Joraga Treespeaker', 'Glacial Fortress', 'Unlucky Witness', 'Forked Bolt', 'Obstinate Baloth', 'Avacyn''s Pilgrim', 'Heartfire Immolator', 'Disrupting Shoal', 'Drowned Rusalka', 'Virus Beetle', 'Mire''s Toll', 'Shambling Vent', 'Commit // Memory', 'Bedeck // Bedazzle', 'Abundant Growth', 'Thran Portal', 'Dream Twist', 'Teferi, Mage of Zhalfir', 'Coalition Victory', 'Essence Scatter', 'Rakdos Cackler', 'Glimmerpost', 'Egon, God of Death', 'Skarrg, the Rage Pits', 'Bloodchief''s Thirst', 'Burning Inquiry', 'Fast // Furious', 'Mortician Beetle', 'Psychic Strike', 'Tome Scour', 'Cryptic Caves', 'Pyroclasm', 'Daxos of Meletis', 'Energy Refractor', 'Night of Souls'' Betrayal', 'Cosmos Elixir', 'Aetherspouts', 'Starfield Mystic', 'Skyclave Cleric', 'Nighthawk Scavenger', 'Murderous Redcap', 'Mana Cylix', 'Peek', 'Shrine of Burning Rage', 'Hedron Archive', 'Precipitous Drop', 'Yarok''s Fenlurker', 'Spikefield Hazard', 'Prophet of Distortion', 'Ajani''s Pridemate', 'Sandwurm Convergence', 'Mnemonic Wall', 'Dread Return', 'Heartfire', 'Through the Breach', 'Hagra Mauling', 'Silundi Vision', 'Nested Shambler', 'Fallaji Wayfarer', 'Umara Wizard', 'Torment of Scarabs', 'Kami of False Hope', 'Crucible of Worlds', 'Segovian Angel', 'Captivating Vampire', 'Orzhov Pontiff', 'Thornglint Bridge', 'Vraska''s Contempt', 'Gideon Jura', 'Tajic, Legion''s Edge', 'Monastery Swiftspear', 'Tarfire', 'Towashi Songshaper', 'Doom Foretold', 'Stinkweed Imp', 'Nimbus Maze', 'Snapback', 'Wrath of God', 'Axebane Guardian', 'Canyon Slough', 'Kaho, Minamo Historian', 'Fireblade Charger', 'Abundant Harvest', 'Tempered in Solitude', 'Demonic Dread', 'Shred Memory', 'Firemind''s Research', 'Fiend Hunter', 'Hidetsugu, Devouring Chaos', 'Commune with Nature', 'Expendable Lackey', 'Reveillark', 'Endless Horizons', 'Haunted Dead', 'Dream Trawler', 'Titan''s Strength', 'Dead Weight', 'Arcbound Shikari', 'Architects of Will', 'Bridge from Below', 'Steel Hellkite', 'Expedite', 'Eiganjo Castle', 'Assemble the Legion', 'Seething Song', 'King Darien XLVIII', 'Offalsnout', 'Dragonskull Summit', 'Nimble Obstructionist', 'Vexing Shusher', 'Winds of Abandon', 'Fertile Ground', 'Master of Death', 'Flametongue Kavu', 'Dispel', 'Animate Dead', 'Warhost''s Frenzy', 'Moat Piranhas', 'Diabolic Tutor', 'Arch of Orazca', 'Samut, the Tested', 'Oust', 'General''s Enforcer', 'Greater Gargadon', 'Frantic Search', 'Undying Evil', 'Into the Roil', 'Never // Return', 'Liliana Vess', 'Goblin Ringleader', 'Slagstorm', 'Decree of Justice', 'Circuit Mender', 'Mana Leak', 'Cathartic Reunion', 'Increasing Vengeance', 'Temple of Enlightenment', 'Brokers Hideout', 'Seal of Removal', 'Cremate', 'Spatial Contortion', 'Faldorn, Dread Wolf Herald', 'Goblin Grenade', 'Haunted Mire', 'Black Sun''s Zenith', 'Curiosity', 'Duskmantle Guildmage', 'Cloudsteel Kirin', 'Pieces of the Puzzle', 'Gruul Signet', 'Darksteel Pendant', 'Searing Spear', 'Brave the Elements', 'Thryx, the Sudden Storm', 'Colossal Skyturtle', 'Veinfire Borderpost', 'Thraben Inspector', 'Dismal Backwater', 'Flame Slash', 'Etali, Primal Storm', 'Leonin Arbiter', 'Song-Mad Treachery', 'Inevitable Betrayal', 'Esper Charm', 'Irencrag Feat', 'Pulse of the Fields', 'Crash Through', 'Calamity Bearer', 'Mistvault Bridge', 'Ambitious Assault', 'Fists of Flame', 'Renewed Faith', 'Haunted Plate Mail', 'Vivid Marsh', 'Unburial Rites', 'Obscura Storefront', 'Ghostly Flicker', 'Seize the Spoils', 'Edge of Autumn', 'Crystalline Giant', 'Patchwork Automaton', 'Whirlwind Denial', 'Angel of Glory''s Rise', 'Lightning Stormkin', 'Honor of the Pure', 'Arcane Sanctum', 'Overwhelmed Apprentice', 'Opt', 'You Find Some Prisoners', 'Shrapnel Blast', 'Spellheart Chimera', 'Kitesail Freebooter', 'Deep Analysis', 'Horrifying Revelation', 'Curse of Exhaustion', 'Tangle', 'Jund Hackblade', 'Talisman of Resilience', 'Elvish Visionary', 'Clout of the Dominus', 'Exquisite Firecraft', 'Magmatic Channeler', 'Lumbering Falls', 'Akoum Warrior', 'Prophetic Prism', 'Elite Arcanist', 'Condescend', 'Aetherling', 'Sylvan Caryatid', 'Treasure Cruise', 'Triumphant Adventurer', 'Collective Defiance', 'Putrefy', 'Ruin Crab', 'Kaya, Ghost Assassin', 'Glare of Subdual', 'Ajani Goldmane', 'Mesa Enchantress', 'Bankrupt in Blood', 'Lavaball Trap', 'Frontier Bivouac', 'Rift Sower', 'Wasteland Strangler', 'Memoricide', 'Brute Force', 'Yahenni''s Expertise', 'Orim''s Chant', 'Murder', 'Gavony Township', 'Victim of Night', 'Strike It Rich', 'Wirewood Savage', 'Rampant Growth', 'Bloodbraid Marauder', 'Restoration Angel', 'Quirion Beastcaller', 'Oracle of Mul Daya', 'Condemn', 'Hero''s Downfall', 'Venser, Shaper Savant', 'Coiling Oracle', 'Chronic Flooding', 'Overgrowth', 'Wilt', 'Bag of Holding', 'Platinum Angel', 'Empyrean Eagle', 'Tangled Florahedron', 'Rootbound Crag', 'Swiftwater Cliffs', 'Extract the Truth', 'Hypnotic Specter', 'Approach of the Second Sun', 'Baird, Argivian Recruiter', 'Arcum''s Astrolabe', 'Blade Splicer', 'Assault Formation', 'Phyrexian Revoker', 'Invoke Calamity', 'Forsake the Worldly', 'Touch the Spirit Realm', 'Runed Halo', 'Supernatural Stamina', 'Drowned Catacomb', 'See Beyond', 'Pathrazer of Ulamog', 'Mirrorshell Crab', 'Brushstrider', 'Soul Warden', 'Flow of Knowledge', 'Springleaf Drum', 'Cleansing Wildfire', 'Thief of Sanity', 'Lodestone Golem', 'The Long Reach of Night', 'Judge''s Familiar', 'Crux of Fate', 'Anger of the Gods', 'Primal Command', 'Sticky Fingers', 'Selesnya Sanctuary', 'Unwind', 'Sign in Blood', 'Mystical Teachings', 'Kari Zev, Skyship Raider', 'Bloodbraid Elf', 'Coral Colony', 'Arcbound Ravager', 'Timely Reinforcements', 'Ravenous Baloth', 'Sunpetal Grove', 'Think Twice', 'Resurgent Belief', 'Fabricate', 'Champion of the Parish', 'Timeless Witness', 'Wall of Omens', 'Ranger of Eos', 'Rise and Shine', 'Skull Fracture', 'Lochmere Serpent', 'Woodland Cemetery', 'Stromkirk Noble', 'Spirited Companion', 'Mantis Rider', 'Smoldering Marsh', 'Rona''s Vortex', 'Tidehollow Sculler', 'Leonin Relic-Warder', 'Feed the Swarm', 'Fling', 'Discovery // Dispersal', 'Nivmagus Elemental', 'Doomed Traveler', 'Peer Through Depths', 'Planar Ally', 'Magmatic Insight', 'Transguild Courier', 'Grasp of Darkness', 'Howltooth Hollow', 'Grim Lavamancer', 'Mogg War Marshal', 'Elixir of Immortality', 'Arcbound Worker', 'Jubilant Skybonder', 'Incinerate', 'Wing Shards', 'Slagwoods Bridge', 'Pyretic Ritual', 'Form of the Dragon', 'Possessed Portal', 'Damn', 'Grapeshot', 'Treasure Map', 'Hokori, Dust Drinker', 'Impulse', 'Burning-Tree Emissary', 'Hinterland Harbor', 'Cut Your Losses', 'Mikaeus, the Lunarch', 'Metalwork Colossus', 'Blazing Specter', 'Bone Shards', 'Dire Tactics', 'Worldgorger Dragon', 'Pashalik Mons', 'Crawling Barrens', 'Karmic Guide', 'Tormenting Voice', 'Firebolt', 'Putrid Imp', 'Kunoros, Hound of Athreos', 'Memory Leak', 'Go for the Throat', 'Ponder', 'Void', 'Base Camp', 'Tolarian Terror', 'Phoenix Chick', 'Quarantine Field', 'Desperate Ritual', 'Norin the Wary', 'Shriekmaw', 'Gaea''s Will', 'Galvanic Alchemist', 'Late to Dinner', 'Reckoner''s Bargain', 'Ritual of Soot', 'Goblin Anarchomancer', 'Buried Ruin', 'Emmara, Soul of the Accord', 'Bala Ged Recovery', 'Tectonic Giant', 'Linvala, Shield of Sea Gate', 'Acquisitions Expert', 'Munitions Expert', 'Xorn', 'Temple of Deceit', 'Soldier of the Pantheon', 'Chandra, Pyromaster', 'Charix, the Raging Isle', 'Quicken', 'Ancient Amphitheater', 'Commune with the Gods', 'Maestros Theater', 'Lavaclaw Reaches', 'Reflector Mage', 'Call to the Feast', 'Darkmoss Bridge', 'Commune with Lava', 'Trickbind', 'Goblin Arsonist', 'Mayor of Avabruck', 'Knight of New Alara', 'Experiment One', 'Temple of Malady', 'Reanimate', 'The Birth of Meletis', 'Battlefield Forge', 'The Cruelty of Gix', 'Temple of Mystery', 'Bitter Reunion', 'Mathas, Fiend Seeker', 'Balustrade Spy', 'Siege-Gang Commander', 'Network Disruptor', 'Westvale Abbey', 'Fieldmist Borderpost', 'Llanowar Wastes', 'Malakir Rebirth', 'Mind Sculpt', 'Forbid', 'Tainted Indulgence', 'Esper Stormblade', 'Firewild Borderpost', 'Cruel Celebrant', 'Lost Legacy', 'Slith Bloodletter', 'Azami, Lady of Scrolls', 'Tanglepool Bridge', 'Glittering Wish', 'Archon of Sun''s Grace', 'Genju of the Fields', 'Overgrown Battlement', 'Savage Lands', 'Tribute to Horobi', 'Mind Rake', 'Braid of Fire', 'Goblin Charbelcher', 'Liliana''s Caress', 'Far // Away', 'Erayo, Soratami Ascendant', 'Hit // Run', 'Fatestitcher', 'Razortide Bridge', 'Ethersworn Canonist', 'Scoured Barrens', 'Urza''s Factory', 'Diabolic Edict', 'Spell Pierce', 'Pariah', 'Secluded Courtyard', 'Tireless Provisioner', 'Elspeth''s Nightmare', 'Day of Judgment', 'Raging Ravine', 'Increasing Ambition', 'Heartless Act', 'Jokulhaups', 'Judith, the Scourge Diva', 'Doomwake Giant', 'Obliterating Bolt', 'Restore Balance', 'Gifts Ungiven', 'Breakthrough', 'Foreboding Ruins', 'Cut // Ribbons', 'Chained to the Rocks', 'Mogg Fanatic', 'Krosan Grip', 'Flooded Grove', 'Ancient Ziggurat', 'Radiant Fountain', 'Demolition Field', 'Mastermind''s Acquisition', 'Hieroglyphic Illumination', 'Deprive', 'Llanowar Elves', 'Blessed Alliance', 'Tuktuk the Explorer', 'Goblin Matron', 'Serra Ascendant', 'Garruk Wildspeaker', 'Farseek', 'Aether Spellbomb', 'Huntmaster of the Fells', 'Sultai Charm', 'Legion Angel', 'Guided Passage', 'Foundry Street Denizen', 'Dreams of Steel and Oil', 'Notion Thief', 'Dwarven Forge-Chanter', 'Escape to the Wilds', 'Lead the Stampede', 'Divest', 'Megrim', 'Thornwood Falls', 'Coalition Relic', 'Labyrinth Raptor', 'Arcbound Mouser', 'Rampaging Ferocidon', 'Squadron Hawk', 'Ransack the Lab', 'Choked Estuary', 'Drift of Phantasms', 'Fact or Fiction', 'Mistvein Borderpost', 'Shadow Prophecy', 'Jwar Isle Refuge', 'Evolving Wilds', 'Sorin, Vengeful Bloodlord', 'Skirk Prospector', 'Ghost Quarter', 'Arcbound Javelineer', 'Magus of the Bazaar', 'Earthshaker Khenra', 'Cut Down', 'Caves of Koilos', 'Price of Progress', 'Hamlet Vanguard', 'Tymaret, Chosen from Death', 'Goldhound', 'Azorius Charm', 'Barbarian Ring', 'Pillar of the Paruns', 'Pirate''s Pillage', 'Master of the Wild Hunt', 'Tendo Ice Bridge', 'Dauntless Bodyguard', 'Thaumatic Compass', 'Nissa, Worldwaker', 'Duress', 'Yidaro, Wandering Monster', 'Call the Bloodline', 'Glorybringer', 'Founding the Third Path', 'Vedalken Shackles', 'Coldsteel Heart', 'Pestilent Haze', 'Jace''s Ingenuity', 'Idyllic Tutor', 'Nephalia Drownyard', 'Power Sink', 'Viscera Seer', 'Nature''s Lore', 'Mishra''s Research Desk', 'Seasoned Hallowblade', 'Goblin Bombardment', 'Orbs of Warding', 'Clifftop Retreat', 'Talara''s Battalion', 'Dreadhorde Butcher', 'Glint-Sleeve Siphoner', 'Golgari Grave-Troll', 'Last-Ditch Effort', 'Karn, Silver Golem', 'Sylvan Library', 'Torens, Fist of the Angels', 'Explore', 'Soul''s Attendant', 'Inspired Idea', 'Tempest Djinn', 'Fumigate', 'Giant Killer', 'Boros Elite', 'Ugin, the Spirit Dragon', 'Outlaws'' Merriment', 'Lapse of Certainty', 'Blackbloom Rogue', 'Dimir Charm', 'Thawing Glaciers', 'Sulfur Falls', 'Anax, Hardened in the Forge', 'Murderous Cut', 'Battlewing Mystic', 'Battle of Wits', 'Sylvan Anthem', 'Lavabrink Venturer', 'Mana Bloom', 'Upheaval', 'Shatter the Sky', 'Shardless Agent', 'Zurgo Bellstriker', 'Kiln Fiend', 'Glint-Horn Buccaneer', 'Favorable Winds', 'Laboratory Maniac', 'Yuan-Ti Fang-Blade', 'Vraska, Relic Seeker', 'Port Town', 'Dawn of Hope', 'Generous Patron', 'Sprite Dragon', 'Stormfist Crusader', 'Slip Out the Back', 'Deafening Clarion', 'Footlight Fiend', 'Tangled Islet', 'Ensoul Artifact', 'Ajani''s Chosen', 'Silence', 'Samurai of the Pale Curtain', 'Duskwatch Recruiter', 'Molten Tributary', 'Didn''t Say Please', 'Exclude', 'Forgotten Cave', 'Mnemonic Betrayal', 'Stenn, Paranoid Partisan', 'Wild Cantor', 'Whipflare', 'Cordial Vampire', 'Fallaji Archaeologist', 'The Modern Age', 'Stern Dismissal', 'Rob the Archives', 'Jace, Architect of Thought', 'Kaijin of the Vanishing Touch', 'Bedlam Reveler', 'Inventive Iteration', 'Obzedat, Ghost Council', 'Wheel of Fate', 'Anurid Swarmsnapper', 'Walking Bulwark', 'Tyrant''s Scorn', 'Vapor Snag', 'Rabbit Battery', 'Keldon Marauders', 'Render Silent', 'Titania''s Command', 'Contaminated Aquifer', 'Smallpox', 'Rix Maadi Reveler', 'Temple of Epiphany', 'Indulgent Aristocrat', 'Meddling Mage', 'Cease-Fire', 'Unsummon', 'Izzet Boilerworks', 'Spell Shrivel', 'Gatekeeper of Malakir', 'Jace, Memory Adept', 'Cloudpost', 'Crab Umbra', 'Sheltered Thicket', 'Rise // Fall', 'Mindcrank', 'Gather the Pack', 'Llanowar Visionary', 'Goro-Goro, Disciple of Ryusei', 'Snow-Covered Plains', 'Crashing Drawbridge', 'Vindicate', 'Dark Ritual', 'Acidic Slime', 'Zendikar''s Roil', 'Pride of the Clouds', 'Jwari Disruption', 'Witching Well', 'Scattered Groves', 'Delver of Secrets', 'Goblin Dark-Dwellers'))) 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.8, mysql)

Reported on decksite by mysql-perf

Location Hash: 0ac1fdccfb1f6263e29f5cb1ea6fa7016aa94305

Labels: decksite

vorpal-buildbot commented 1 year ago

Exceeded slow_query limit (66.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 ('Veinfire Borderpost', 'Kuldotha Rebirth', 'Primal Bellow', 'Overgrown Battlement', 'Deprive', 'Story Circle', 'Nissa''s Renewal', 'Tangle', 'Woodland Cemetery', 'Howling Mine', 'Vapor Snag', 'Linvala, Shield of Sea Gate', 'Network Disruptor', 'Captivating Vampire', 'Assemble the Legion', 'Clout of the Dominus', 'Field Marshal', 'Towashi Songshaper', 'Irencrag Feat', 'Jace Beleren', 'Maestros Theater', 'Evolving Wilds', 'Doomed Traveler', 'Graveyard Marshal', 'Kambal, Consul of Allocation', 'Viashino Pyromancer', 'Zurgo Bellstriker', 'Goblin Blast-Runner', 'Esper Charm', 'Duskwatch Recruiter', 'Lavabrink Venturer', 'Guided Passage', 'Nimble Obstructionist', 'Patriarch''s Bidding', 'Triskelion', 'Ash Zealot', 'Resurgent Belief', 'Bitter Reunion', 'Tendo Ice Bridge', 'The Birth of Meletis', 'Darigaaz Reincarnated', 'Bone Shards', 'Ondu Inversion', 'Howltooth Hollow', 'Offalsnout', 'Sejiri Shelter', 'Spell Shrivel', 'Kumano Faces Kakkazan', 'Vraska, Relic Seeker', 'Flow of Knowledge', 'Lightning Stormkin', 'Crashing Drawbridge', 'Kiln Fiend', 'Jace, the Living Guildpact', 'Metalwork Colossus', 'Karn, Silver Golem', 'Swiftwater Cliffs', 'Duskmantle Guildmage', 'Legion Lieutenant', 'Hinterland Harbor', 'Black Sun''s Zenith', 'Condescend', 'Ghost Quarter', 'Malakir Blood-Priest', 'Faith''s Reward', 'Mnemonic Wall', 'Ritual of Soot', 'Mystic Retrieval', 'Purify the Grave', 'Aether Spellbomb', 'Lavaball Trap', 'Hagra Mauling', 'Ghalta, Primal Hunger', 'Plow Under', 'Grand Coliseum', 'Commune with Lava', 'Flame Rift', 'Huntmaster of the Fells', 'Eye of Nowhere', 'Crystalline Giant', 'Goblin Gaveleer', 'Axebane Guardian', 'Forced Fruition', 'Isolated Chapel', 'Escape to the Wilds', 'Goblin Bombardment', 'Tear Asunder', 'Stirring Wildwood', 'Horrifying Revelation', 'Diregraf Colossus', 'Rune-Scarred Demon', 'Coldsteel Heart', 'Rabbit Battery', 'Cruel Celebrant', 'Ezuri, Renegade Leader', 'Feed the Swarm', 'Chandra, Pyromaster', 'Silent Gravestone', 'Tyrant''s Choice', 'Stormfist Crusader', 'Xorn', 'Pieces of the Puzzle', 'Secluded Steppe', 'Drake Haven', 'Sphinx''s Tutelage', 'Pashalik Mons', 'Caves of Koilos', 'Ghitu Encampment', 'Fists of Flame', 'Canyon Slough', 'Foundry Street Denizen', 'Esper Stormblade', 'Last Stand', 'Fog', 'Tormenting Voice', 'River Serpent', 'Charix, the Raging Isle', 'Bag of Holding', 'Llanowar Loamspeaker', 'Tentative Connection', 'Rix Maadi Reveler', 'Battle of Wits', 'Sylvan Anthem', 'Molten Tributary', 'Indulgent Aristocrat', 'Tasigur, the Golden Fang', 'Windcaller Aven', 'Birds of Paradise', 'Ethersworn Canonist', 'Stonehorn Dignitary', 'Benalish Marshal', 'Pathrazer of Ulamog', 'Soul Snare', 'Dauntless Bodyguard', 'Nevermore', 'Akoum Warrior', 'Big Score', 'Diabolic Edict', 'Hit // Run', 'Korlash, Heir to Blackblade', 'Temple of Enlightenment', 'Arcane Sanctum', 'Vault of the Archangel', 'Colossal Skyturtle', 'Burning Inquiry', 'Cut // Ribbons', 'Boomerang', 'Fleetfoot Dancer', 'Brute Force', 'Duress', 'Orim''s Chant', 'Dream Trawler', 'Vampire Lacerator', 'Undead Augur', 'Desperate Ravings', 'Sarkhan the Masterless', 'Jeskai Ascendancy', 'Magmatic Channeler', 'Go for the Throat', 'Render Silent', 'Silence', 'Shardless Agent', 'Gifts Ungiven', 'Steel Hellkite', 'Sylvan Messenger', 'Serra Ascendant', 'Expedite', 'Soaring Drake', 'Slagwoods Bridge', 'Terrarion', 'Samut, the Tested', 'Skycat Sovereign', 'Raging Goblin', 'Goblin Grenade', 'Figure of Destiny', 'Clifftop Retreat', 'Experimental Synthesizer', 'Thraben Inspector', 'Pillar of Flame', 'Megrim', 'Ghitu Lavarunner', 'Egon, God of Death', 'Lose Focus', 'Scattered Groves', 'Sultai Charm', 'Demigod of Revenge', 'Tree of Tales', 'Llanowar Wastes', 'Ghostly Flicker', 'Arcum''s Astrolabe', 'Tempered Steel', 'Crucible of Worlds', 'Brain Freeze', 'Sacred Peaks', 'Llanowar Tribe', 'Murderous Cut', 'Oran-Rief, the Vastwood', 'Exclude', 'Dakmor Salvage', 'Dreams of Steel and Oil', 'Talara''s Battalion', 'Gruul Signet', 'Joraga Warcaller', 'Zetalpa, Primal Dawn', 'Magmatic Insight', 'Rustvale Bridge', 'Meddling Mage', 'Michiko''s Reign of Truth', 'Auramancer', 'Kaya, Ghost Assassin', 'Commune with the Gods', 'Shaman of the Pack', 'Spine of Ish Sah', 'Inventive Iteration', 'Crash Through', 'Sorin, Vengeful Bloodlord', 'Farseek', 'Dusk Legion Zealot', 'Faldorn, Dread Wolf Herald', 'Rampant Growth', 'Haunted Plate Mail', 'Tranquil Cove', 'Wall of Omens', 'Game Trail', 'Dictate of Kruphix', 'Spider Umbra', 'Yavimaya Coast', 'Gruul Turf', 'Goblin Arsonist', 'Mobilized District', 'Cosmos Elixir', 'Chandra, Flamecaller', 'Hostage Taker', 'Increasing Vengeance', 'Ransack the Lab', 'Lochmere Serpent', 'Kabira Takedown', 'Rampaging Ferocidon', 'Shrine of Burning Rage', 'Lumbering Falls', 'Tymaret, Chosen from Death', 'Lonely Sandbar', 'Goblin Matron', 'Emmara, Soul of the Accord', 'Divest', 'Shriekmaw', 'Pandemonium', 'Calamity Bearer', 'Sarinth Steelseeker', 'Angel of Condemnation', 'Yuan-Ti Fang-Blade', 'Dreadhorde Butcher', 'Kari Zev, Skyship Raider', 'Mantis Rider', 'Sejiri Refuge', 'Soul''s Attendant', 'Crush of Tentacles', 'Dwynen''s Elite', 'Magister of Worth', 'Urza''s Factory', 'Seal of Fire', 'Castigate', 'Aurelia, Exemplar of Justice', 'Leechridden Swamp', 'Hidetsugu, Devouring Chaos', 'Thornglint Bridge', 'Forbid', 'Vivid Meadow', 'Galvanic Alchemist', 'Price of Progress', 'Tempered in Solitude', 'Ancient Amphitheater', 'Izzet Charm', 'Priest of Fell Rites', 'Treasure Map', 'Staff of Domination', 'Death Baron', 'Generous Patron', 'Vedalken Shackles', 'Goblin Electromancer', 'Yahenni''s Expertise', 'Venser, Shaper Savant', 'Curious Pair', 'Genesis Ultimatum', 'Thirst for Knowledge', 'Glimmerpost', 'Brave the Elements', 'Raging Ravine', 'Putrid Imp', 'Diregraf Ghoul', 'Bedlam Reveler', 'Boros Signet', 'Glint-Sleeve Siphoner', 'Tajic, Legion''s Edge', 'Fecundity', 'Pilfer', 'Disallow', 'Temur Battle Rage', 'Aethermage''s Touch', 'Choked Estuary', 'Bloodbraid Elf', 'Settle the Wreckage', 'Forked Bolt', 'Coiling Oracle', 'Cleansing Wildfire', 'Torment of Scarabs', 'Battle of Frost and Fire', 'Joraga Treespeaker', 'Obzedat, Ghost Council', 'Tidehollow Sculler', 'Scryb Ranger', 'Delver of Secrets', 'Jokulhaups', 'Azorius Charm', 'Empyrean Eagle', 'Orcish Lumberjack', 'Mire''s Toll', 'Lashwrithe', 'Conqueror''s Galleon', 'Repeal', 'Second Sunrise', 'Karrthus, Tyrant of Jund', 'Ghitu Chronicler', 'Tanglepool Bridge', 'Ramunap Excavator', 'Prohibit', 'Benevolent Bodyguard', 'Goblin Anarchomancer', 'Eerie Interlude', 'Flame Slash', 'Battlewing Mystic', 'Prismatic Omen', 'Blazing Specter', 'Llanowar Elves', 'Satyr Wayfinder', 'The Raven''s Warning', 'Cryptic Caves', 'Bloodbraid Marauder', 'Ghostfire Blade', 'Crab Umbra', 'Spell Pierce', 'Mistvein Borderpost', 'Phoenix of Ash', 'Teferi''s Moat', 'Mistvault Bridge', 'Kederekt Leviathan', 'Wharf Infiltrator', 'Heliod''s Intervention', 'Savage Lands', 'Avacyn''s Pilgrim', 'Heartless Act', 'Garruk Wildspeaker', 'Riveteers Overlook', 'Tendrils of Agony', 'Hour of Promise', 'Impulse', 'Valiant Rescuer', 'Chandra''s Phoenix', 'Blessed Alliance', 'Generous Visitor', 'Torens, Fist of the Angels', 'Sign in Blood', 'Legion Angel', 'Drift of Phantasms', 'Imposing Vantasaur', 'Mathas, Fiend Seeker', 'Troll Ascetic', 'Earthshaker Khenra', 'Greater Gargadon', 'Incinerate', 'Phoenix Chick', 'Restoration Angel', 'Faithless Salvaging', 'Golden Egg', 'Firemind''s Research', 'Seething Song', 'Outlaws'' Merriment', 'Elvish Archdruid', 'Warhost''s Frenzy', 'Last-Ditch Effort', 'Pixie Illusionist', 'Fumigate', 'Knight of New Alara', 'Memory Lapse', 'Maelstrom Pulse', 'Planar Ally', 'Cultivate', 'Peek', 'Cremate', 'Timely Reinforcements', 'Crawling Barrens', 'Foreboding Ruins', 'Power Sink', 'Nissa, Worldwaker', 'Shrapnel Blast', 'Lead the Stampede', 'Bring to Light', 'Resolute Archangel', 'Ranger of Eos', 'Fireblade Charger', 'Burning-Tree Emissary', 'Festival Crasher', 'Oracle of Mul Daya', 'Thawing Glaciers', 'Fiend Hunter', 'Assault Formation', 'Assault Strobe', 'Audacity', 'Dawn of Hope', 'Nivmagus Elemental', 'Silverbluff Bridge', 'Fyndhorn Elves', 'Triumphant Adventurer', 'Thran Portal', 'Tectonic Giant', 'Goblin Ringleader', 'Mnemonic Sphere', 'Lay Down Arms', 'Angel of Despair', 'Zuran Orb', 'Universal Automaton', 'Sheltered Thicket', 'Fabricate', 'Never // Return', 'Thaumatic Compass', 'Goblin Dark-Dwellers', 'Titania''s Command', 'Forsake the Worldly', 'Sea Gate Oracle', 'Mirrorshell Crab', 'Arcbound Worker', 'Oblivion Ring', 'Gray Merchant of Asphodel', 'Judith, the Scourge Diva', 'Skyknight Vanguard', 'Runed Halo', 'Wasteland Strangler', 'Dimir Charm', 'Aurelia''s Fury', 'Regal Force', 'Sphinx of Uthuun', 'Blade Splicer', 'Phyrexian Dreadnought', 'Shadow Alley Denizen', 'Scab-Clan Berserker', 'Empty the Warrens', 'Brokers Hideout', 'Unwind', 'Dragonskull Summit', 'Drowned Catacomb', 'Glassdust Hulk', 'Lapse of Certainty', 'Seasons Past', 'Idyllic Tutor', 'Genju of the Fields', 'Otherworldly Journey', 'Gilt-Leaf Palace', 'Desperate Ritual', 'Rosethorn Acolyte', 'Baird, Argivian Recruiter', 'Sylvan Scrying', 'Hada Freeblade', 'Visions of Phyrexia', 'Springleaf Drum', 'Nantuko Cultivator', 'Condemn', 'Bala Ged Recovery', 'Faerie Vandal', 'Glacial Fortress', 'Arcbound Ravager', 'Warstorm Surge', 'Mindslaver', 'Fling', 'Drannith Healer', 'Spellheart Chimera', 'Murderous Redcap', 'Jwari Disruption', 'Deceiver of Form', 'Wildfield Borderpost', 'Dire Tactics', 'Obscura Storefront', 'Blazing Archon', 'Keep Safe', 'Dungrove Elder', 'Energy Refractor', 'Keldon Marauders', 'Eldrazi Mimic', 'Collective Defiance', 'Wing Shards', 'Titan''s Strength', 'Hearth Charm', 'Future Sight', 'Hypnotic Specter', 'Quarantine Field', 'Glare of Subdual', 'Sire of Insanity', 'Worm Harvest', 'General''s Enforcer', 'Yidaro, Wandering Monster', 'Artful Dodge', 'Wheel of Fate', 'Unlucky Witness', 'Bogardan Hellkite', 'Shock', 'Ugin, the Spirit Dragon', 'Asylum Visitor', 'Out of Time', 'Argivian Restoration', 'Damn', 'Honor of the Pure', 'Tangled Islet', 'Servo Exhibition', 'Jund Hackblade', 'Linessa, Zephyr Mage', 'Kaho, Minamo Historian', 'Fast // Furious', 'Restore Balance', 'Liliana''s Caress', 'Ajani Goldmane', 'Mistcutter Hydra', 'Kazuul''s Fury', 'Flametongue Yearling', 'Temple of Epiphany', 'Mana Leak', 'Bump in the Night', 'Doomwake Giant', 'Shambling Vent', 'Animate Dead', 'Fertile Ground', 'Founding the Third Path', 'Yotian Frontliner', 'Judge''s Familiar', 'Firewild Borderpost', 'Buried Alive', 'Touch the Spirit Realm', 'Glorybringer', 'Nezahal, Primal Tide', 'Barren Moor', 'Sunpetal Grove', 'Flourishing Fox', 'Zendikar''s Roil', 'Raven''s Crime', 'Arch of Orazca', 'Orzhov Pontiff', 'Smother', 'Gladecover Scout', 'Frontline Medic', 'Monastery Swiftspear', 'Contaminated Aquifer', 'Genesis Wave', 'Dark Salvation', 'Braid of Fire', 'Fallaji Archaeologist', 'Ominous Seas', 'Commune with Nature', 'Rootbound Crag', 'Gatekeeper of Malakir', 'Lavaclaw Reaches', 'Urabrask the Hidden', 'Flooded Grove', 'Elderscale Wurm', 'Grumgully, the Generous', 'Voldaren Bloodcaster', 'Bloodline Keeper', 'Izzet Boilerworks', 'Phyrexian Unlife', 'Gideon Jura', 'Hokori, Dust Drinker', 'Firebolt', 'Endless Horizons', 'Master of Death', 'Eternal Dragon', 'Nighthawk Scavenger', 'Ancient Stirrings', 'Seize the Spoils', 'Invoke Calamity', 'Labyrinth of Skophos', 'Tomakul Honor Guard', 'Garth One-Eye', 'Skyclave Cleric', 'Dimir Aqueduct', 'Shinka, the Bloodsoaked Keep', 'Tolarian Terror', 'Elsewhere Flask', 'Port Town', 'Nevinyrral''s Disk', 'Hero''s Downfall', 'The Flame of Keld', 'Sulfur Falls', 'Whirlwind Denial', 'Munitions Expert', 'Platinum Angel', 'Oust', 'God-Pharaoh''s Gift', 'Ambitious Assault', 'Stenn, Paranoid Partisan', 'Cloudpost', 'Gloomshrieker', 'The Elder Dragon War', 'Fieldmist Borderpost', 'Decree of Justice', 'Tainted Indulgence', 'Destroy Evil', 'Brimstone Dragon', 'Mind Rake', 'Cabaretti Courtyard', 'Rootwater Depths', 'Grapeshot', 'Rob the Archives', 'Phyrexia''s Core', 'Rise // Fall', 'Hieroglyphic Illumination', 'Skull Fracture', 'Valiant Changeling', 'Ultimate Price', 'Blanchwood Armor', 'Razortide Bridge', 'Silver Scrutiny', 'Goblin Charbelcher', 'Primal Surge', 'Elvish Visionary', 'Hard Evidence', 'Drossforge Bridge', 'Psychic Strike', 'Epochrasite', 'Slagstorm', 'Ruin Crab', 'Impostor of the Sixth Pride', 'Fanatical Firebrand', 'Void', 'Pillar of the Paruns', 'Leonin Arbiter', 'Aetherspouts', 'Unburial Rites', 'Prophetic Prism', 'Ponder', 'Inevitable Betrayal', 'Glittering Wish', 'Qasali Pridemage', 'Fatestitcher', 'Soul Warden', 'Secluded Courtyard', 'Erebos''s Intervention', 'Cordial Vampire', 'Cathartic Reunion', 'Demonic Dread', 'Haunted Mire', 'Timeless Witness', 'Ethersworn Sphinx', 'Tolsimir, Friend to Wolves', 'Demolition Field', 'Hypergenesis', 'Ancient Ziggurat', 'Song-Mad Treachery', 'Sylvan Library', 'Smiting Helix', 'Norin the Wary', 'Thundermaw Hellkite', 'Dryad Militant', 'Slip Out the Back', 'Disrupting Shoal', 'Jace, Architect of Thought', 'Needle Spires', 'Scarab Feast', 'Lotus Cobra', 'Fiery Justice', 'Hamlet Captain', 'Reanimate', 'Enchantress''s Presence', 'Tamiyo, Collector of Tales', 'Burst Lightning', 'Architects of Will', 'Abundant Growth', 'Explore', 'Reflector Mage', 'Victim of Night', 'Vindicate', 'Unsubstantiate', 'Mnemonic Betrayal', 'Forgotten Cave', 'Saproling Burst', 'Sylvan Caryatid', 'Base Camp', 'Wooded Bastion', 'Exquisite Firecraft', 'Elvish Mystic', 'Heartfire', 'Treasure Cruise', 'Sprite Dragon', 'Hazoret''s Undying Fury', 'Nameless Inversion', 'Guild Globe', 'Wrath of God', 'Essence Scatter', 'Wargate', 'Winds of Abandon', 'Kazandu Blademaster', 'Doom Blade', 'Vraska''s Contempt', 'Sandwurm Convergence', 'Sticky Fingers', 'Frantic Search', 'Boom // Bust', 'Tranquil Thicket', 'Courier''s Briefcase', 'Skirk Prospector', 'Silumgar''s Command', 'Frontier Bivouac', 'Silverquill Silencer', 'Prophet of Distortion', 'Heartfire Immolator', 'Cut Down', 'Defiler of Vigor', 'Turn // Burn', 'You Find Some Prisoners', 'Spikefield Hazard', 'Detention Sphere', 'Dread Wanderer', 'Late to Dinner', 'Archetype of Endurance', 'Wayward Guide-Beast', 'Glen Elendra Archmage', 'Mindcrank', 'Privileged Position', 'Regrowth', 'Daxos of Meletis', 'Hamlet Vanguard', 'Grim Lavamancer', 'Goldmire Bridge', 'Labyrinth Raptor', 'Lightning Strike', 'Kunoros, Hound of Athreos', 'Possibility Storm', 'Mausoleum Secrets', 'Cease-Fire', 'General Ferrous Rokiric', 'Seal of Removal', 'Conduit of Ruin', 'Rona''s Vortex', 'Nadaar, Selfless Paladin', 'Stubborn Denial', 'Bloodchief''s Thirst', 'Heliod''s Pilgrim', 'Skyshroud Ranger', 'Mogg War Marshal', 'Lord of the Undead', 'Ammit Eternal', 'Spirited Companion', 'Glorious Protector', 'Eiganjo Castle', 'Tireless Provisioner', 'Aria of Flame', 'Negan, the Cold-Blooded', 'Nivix Cyclops', 'Stromkirk Noble', 'Thrill of Possibility', 'Cemetery Reaper', 'Barkhide Troll', 'Vilis, Broker of Blood', 'Stormtide Leviathan', 'Darkmoss Bridge', 'Frantic Inventory', 'Nimbus Maze', 'Form of the Dragon', 'Fact or Fiction', 'Dovin Baan', 'Overwhelming Splendor', 'Dwarven Forge-Chanter', 'Enrage', 'Siege Rhino', 'Rise and Shine', 'Rakdos Cackler', 'Mishra''s Factory', 'Tarfire', 'Recruitment Officer', 'Master of the Wild Hunt', 'Carnival // Carnage', 'Combat Thresher', 'Westvale Abbey', 'Kitesail Freebooter', 'Giant Killer', 'Elves of Deep Shadow', 'Strike It Rich', 'Sunlit Marsh', 'The Underworld Cookbook', 'Circuit Mender', 'Cloudsteel Kirin', 'Tomb of Urami', 'Elixir of Immortality', 'Smallpox', 'Snapback', 'Expendable Lackey', 'Tempest Djinn', 'Buried Ruin', 'Walk the Aeons', 'Revitalize', 'Snow-Covered Plains', 'Squadron Hawk', 'Stern Dismissal', 'Ivy Lane Denizen', 'Easy Prey', 'Revoke Existence', 'Icehide Golem', 'Moon-Blessed Cleric', 'Desolation Twin', 'Opt', 'Leonin Relic-Warder', 'Primal Command', 'Goldhound', 'Genesis Hydra', 'Gaea''s Will', 'Madcap Experiment', 'Devoted Druid', 'Champion of the Parish', 'Reckless Charge', 'Obliterating Bolt', 'Walking Bulwark', 'Elite Arcanist', 'King Darien XLVIII', 'Angel of Grace', 'Barbarian Ring', 'Abiding Grace', 'Thermo-Alchemist', 'Gavony Township', 'Tyrant''s Scorn', 'Disintegrate', 'Assault // Battery', 'Temmet, Vizier of Naktamun', 'Mishra''s Research Desk', 'Ziatora''s Envoy', 'Day of Judgment', 'Porphyry Nodes', 'Discovery // Dispersal', 'Battlefield Forge', 'Radiant Fountain', 'The Cruelty of Gix', 'Searing Spear', 'Dark Ritual', 'Idyllic Beachfront', 'Abundant Harvest', 'Quicken', 'Thief of Sanity', 'Wild Cantor', 'Thirst for Meaning', 'Bedeck // Bedazzle', 'Pyretic Ritual', 'Dragonstorm', 'Scurry Oak', 'Mayor of Avabruck', 'Trickbind', 'Pirate''s Pillage', 'Anax, Hardened in the Forge', 'Endless Detour', 'Myth Realized', 'Chained to the Rocks', 'Spatial Contortion', 'Siege-Gang Commander'))) 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, 66.5, mysql)

Reported on decksite by mysql-perf

Location Hash: 0ac1fdccfb1f6263e29f5cb1ea6fa7016aa94305

Labels: decksite

vorpal-buildbot commented 1 year ago

Exceeded slow_query limit (80.6 > 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 ('Varolz, the Scar-Striped', 'Reflector Mage', 'Labyrinth Raptor', 'Diabolic Tutor', 'Codex Shredder', 'Collected Conjuring', 'Dreadhorde Butcher', 'Barkhide Troll', 'Silver Scrutiny', 'Shriekmaw', 'Tangled Islet', 'Steel Hellkite', 'Guided Passage', 'Nephalia Drownyard', 'Bontu''s Last Reckoning', 'Rona''s Vortex', 'Birds of Paradise', 'Power Sink', 'Savage Lands', 'Mnemonic Wall', 'Lay Down Arms', 'Canyon Slough', 'Doomwake Giant', 'Temple of Epiphany', 'Bloodbraid Marauder', 'Thief of Sanity', 'Crush of Tentacles', 'Destroy Evil', 'Kazandu Blademaster', 'Slagwoods Bridge', 'Meddling Mage', 'Worm Harvest', 'Nevinyrral''s Disk', 'Porcelain Legionnaire', 'Mishra''s Factory', 'Huntmaster of the Fells', 'Deprive', 'Rabbit Battery', 'Soul Snare', 'Burning Inquiry', 'Endless Detour', 'Kabira Takedown', 'Disrupting Shoal', 'Rustvale Bridge', 'Abundant Harvest', 'Liliana''s Caress', 'Sylvan Anthem', 'Secluded Courtyard', 'Staff of Domination', 'Ethersworn Sphinx', 'Patchwork Automaton', 'Pieces of the Puzzle', 'Drakuseth, Maw of Flames', 'Scarab Feast', 'Indulgent Aristocrat', 'Sarinth Steelseeker', 'Sol Talisman', 'Master of the Wild Hunt', 'Drowned Catacomb', 'Mist-Syndicate Naga', 'Squadron Hawk', 'Hokori, Dust Drinker', 'Wharf Infiltrator', 'Smiting Helix', 'Flooded Grove', 'Discovery // Dispersal', 'Jund Hackblade', 'Gruul Signet', 'Elvish Mystic', 'Elvish Visionary', 'Icehide Golem', 'Lavabrink Venturer', 'Harmonic Prodigy', 'Patriarch''s Bidding', 'Fireblade Charger', 'Oust', 'Llanowar Wastes', 'Farseek', 'Epochrasite', 'Stirring Wildwood', 'Disallow', 'Grim Lavamancer', 'Foreboding Ruins', 'Shock', 'Orim''s Chant', 'Castigate', 'Vindicate', 'Tolsimir, Friend to Wolves', 'Krosan Grip', 'Sultai Charm', 'Expendable Lackey', 'Rampaging Ferocidon', 'Ritual of Soot', 'Artful Dodge', 'Platinum Angel', 'Ajani Goldmane', 'Forsake the Worldly', 'Wrath of God', 'Fieldmist Borderpost', 'Gideon Jura', 'Seething Song', 'Dawn of Hope', 'The Cruelty of Gix', 'Coalition Relic', 'Warstorm Surge', 'Triskelion', 'Battlewing Mystic', 'Seal of Removal', 'Fiend Hunter', 'Empty the Warrens', 'Rune-Scarred Demon', 'Torment of Scarabs', 'Brave the Elements', 'Trail of Crumbs', 'Field Marshal', 'Joraga Treespeaker', 'Ominous Seas', 'Glorybringer', 'Animate Dead', 'Possibility Storm', 'Miasmic Mummy', 'Treasure Map', 'Grumgully, the Generous', 'Sunpetal Grove', 'Willow Geist', 'Shardless Agent', 'Qasali Pridemage', 'Timeless Witness', 'Crawling Barrens', 'Erebos''s Intervention', 'Hour of Promise', 'Chief of the Foundry', 'Fabricate', 'Commune with Lava', 'Argivian Restoration', 'Hagra Mauling', 'Aria of Flame', 'Sheltered Thicket', 'Silver-Fur Master', 'Sandsteppe Citadel', 'Aether Spellbomb', 'Siege Rhino', 'Dryad Militant', 'Conduit of Ruin', 'Giant Killer', 'Radha, Heart of Keld', 'Primal Command', 'Dire Tactics', 'Shred Memory', 'Champion of the Parish', 'Nadaar, Selfless Paladin', 'Barren Moor', 'Prophet of Distortion', 'Steel Overseer', 'Judith, the Scourge Diva', 'Tear Asunder', 'Recurring Nightmare', 'Treasure Cruise', 'Silverquill Silencer', 'Raging Goblin', 'Mystic Monastery', 'Glorious Protector', 'Rise and Shine', 'Seasoned Hallowblade', 'Yosei, the Morning Star', 'Boros Signet', 'Bitter Reunion', 'Ugin, the Spirit Dragon', 'Gladecover Scout', 'Shrine of Burning Rage', 'Sire of Insanity', 'Sprite Dragon', 'Burst Lightning', 'Heliod''s Pilgrim', 'Visions of Phyrexia', 'Goblin Grenade', 'Dragon''s Hoard', 'Crux of Fate', 'Crashing Drawbridge', 'Tendo Ice Bridge', 'Silumgar''s Command', 'Tectonic Giant', 'Spider Umbra', 'Tempest Djinn', 'Haunted Mire', 'Vilis, Broker of Blood', 'Genju of the Fields', 'Kaho, Minamo Historian', 'Lotus Cobra', 'Upheaval', 'Fecundity', 'Sea Gate Oracle', 'Last-Ditch Effort', 'Tanglepool Bridge', 'Skyknight Vanguard', 'Expedite', 'Gifts Ungiven', 'Eiganjo Castle', 'Pull from Tomorrow', 'Lonely Sandbar', 'Mirrorshell Crab', 'Bedlam Reveler', 'Obstinate Baloth', 'Sigrid, God-Favored', 'Coiling Oracle', 'Goblin Bombardment', 'Coldsteel Heart', 'Recruitment Officer', 'Izzet Boilerworks', 'Jungle Hollow', 'Seal of Fire', 'Jace Beleren', 'Balmor, Battlemage Captain', 'Charix, the Raging Isle', 'Honor of the Pure', 'Unwind', 'Nezahal, Primal Tide', 'Duskmantle Guildmage', 'Skyclave Cleric', 'Commune with Nature', 'Dauntless Bodyguard', 'Faldorn, Dread Wolf Herald', 'Inscription of Ruin', 'Maelstrom Pulse', 'Fact or Fiction', 'Wargate', 'Magmatic Insight', 'Flow of Knowledge', 'Restoration Angel', 'Glassdust Hulk', 'Deceiver of Form', 'Impulse', 'Frostwalk Bastion', 'Feed the Swarm', 'Triumphant Adventurer', 'Sandwurm Convergence', 'Ghostly Flicker', 'Prophetic Prism', 'Kazuul''s Fury', 'Devoted Druid', 'Contaminated Aquifer', 'Opt', 'Bloodchief''s Thirst', 'Mana Leak', 'Regrowth', 'Torens, Fist of the Angels', 'Court Homunculus', 'Desolation Twin', 'Chandra, Flamecaller', 'Cease-Fire', 'Kederekt Leviathan', 'Rampant Growth', 'Dark Ritual', 'Touch the Spirit Realm', 'Drossforge Bridge', 'Talara''s Battalion', 'Delver of Secrets', 'Spell Shrivel', 'Energy Refractor', 'Runed Halo', 'Tireless Provisioner', 'Izzet Charm', 'Mogg War Marshal', 'Munitions Expert', 'Urza''s Factory', 'Universal Automaton', 'God-Pharaoh''s Gift', 'Madcap Experiment', 'Bala Ged Recovery', 'Exclude', 'Bump in the Night', 'Teferi, Mage of Zhalfir', 'Fallaji Archaeologist', 'Kari Zev, Skyship Raider', 'Always Watching', 'Greater Gargadon', 'Fanatic of Xenagos', 'Flaying Tendrils', 'Wall of Omens', 'Kumano Faces Kakkazan', 'Spatial Contortion', 'Rootbound Crag', 'Caldera Lake', 'Demolition Field', 'Dictate of Kruphix', 'Whirlwind Denial', 'Phoenix Chick', 'Calamity Bearer', 'Samut, the Tested', 'Searing Spear', 'Inevitable Betrayal', 'Maestros Theater', 'Oblivion Ring', 'Venser, Shaper Savant', 'Pathrazer of Ulamog', 'Firemind''s Research', 'Rosethorn Acolyte', 'Empyrean Eagle', 'Cloudsteel Kirin', 'Outlaws'' Merriment', 'Pilfer', 'Jace, Architect of Thought', 'The Modern Age', 'Negan, the Cold-Blooded', 'Arcbound Javelineer', 'Walking Bulwark', 'Ornithopter', 'Bedeck // Bedazzle', 'Thermo-Alchemist', 'Arcbound Ravager', 'Mantis Rider', 'Veinfire Borderpost', 'Day of Judgment', 'Smallpox', 'Rix Maadi Reveler', 'Revitalize', 'Knight of New Alara', 'Assault Formation', 'Goblin Ringleader', 'Repeal', 'Golgari Grave-Troll', 'Captivating Vampire', 'Mausoleum Secrets', 'Isolated Chapel', 'Goblin Blast-Runner', 'Moon-Circuit Hacker', 'Render Silent', 'Purify the Grave', 'Strike It Rich', 'Never // Return', 'Reckless Charge', 'Ramunap Excavator', 'Thryx, the Sudden Storm', 'Phyrexian Arena', 'Inventive Iteration', 'Shambling Vent', 'Hit // Run', 'Scattered Groves', 'Stromkirk Noble', 'Increasing Ambition', 'Damn', 'Ancient Ziggurat', 'Molten Tributary', 'Cloudpost', 'Hada Freeblade', 'Valiant Rescuer', 'Jace, the Living Guildpact', 'Putrefy', 'Commune with the Gods', 'Thraben Inspector', 'Angel of Condemnation', 'Mindslaver', 'Gatekeeper of Malakir', 'Sylvan Library', 'Ravenous Squirrel', 'Witching Well', 'Tempered in Solitude', 'Slagstorm', 'Thirst for Meaning', 'Skull Fracture', 'Gavony Township', 'Korlash, Heir to Blackblade', 'Mnemonic Betrayal', 'Lumbering Falls', 'Lapse of Certainty', 'Condescend', 'Obzedat, Ghost Council', 'Tajic, Legion''s Edge', 'Esper Stormblade', 'Hotshot Mechanic', 'Sylvan Caryatid', 'Murderous Redcap', 'Resolute Archangel', 'Bad River', 'Legion Lieutenant', 'Audacity', 'Snow-Covered Plains', 'Llanowar Elves', 'Stormtide Leviathan', 'Vapor Snag', 'Evolving Wilds', 'Thrill of Possibility', 'Conqueror''s Galleon', 'Valiant Changeling', 'Raging Ravine', 'Nissa, Worldwaker', 'Nighthawk Scavenger', 'Cut // Ribbons', 'Gallia of the Endless Dance', 'Heartless Act', 'Battle of Wits', 'Disciple of the Vault', 'Assault Strobe', 'Archangel of Wrath', 'Walk the Aeons', 'Game Trail', 'Temple of Malady', 'Silverbluff Bridge', 'Vault Skirge', 'Jace''s Ingenuity', 'Commit // Memory', 'Gloomshrieker', 'Shrapnel Blast', 'Otherworldly Journey', 'Putrid Imp', 'Lose Focus', 'King Darien XLVIII', 'Grand Coliseum', 'Ghost Quarter', 'Yahenni''s Expertise', 'Vraska, Relic Seeker', 'Soaring Drake', 'Pyretic Ritual', 'Vivid Marsh', 'Ancient Stirrings', 'Mindcrank', 'Mesmeric Fiend', 'Blanchwood Armor', 'Thunderbreak Regent', 'Pillar of Flame', 'Hypnotic Specter', 'Chandra Nalaar', 'Dead Weight', 'Chandra''s Phoenix', 'Heliod''s Intervention', 'Fallen Shinobi', 'Temple of Deceit', 'Eye of Nowhere', 'Kunoros, Hound of Athreos', 'Explore', 'Angel of Grace', 'Mathas, Fiend Seeker', 'Quicken', 'Burning-Tree Emissary', 'Auramancer', 'Sign in Blood', 'Unburial Rites', 'Forbid', 'Pillar of the Paruns', 'Imposing Vantasaur', 'Vedalken Shackles', 'Wildfield Borderpost', 'Titan''s Strength', 'Howltooth Hollow', 'Tymaret, Chosen from Death', 'Hostage Taker', 'Leonin Relic-Warder', 'Orcish Lumberjack', 'Braid of Fire', 'Flame Rift', 'Primal Bellow', 'Tempered Steel', 'Woodland Cemetery', 'Heartfire', 'Satyr Hedonist', 'Orzhov Pontiff', 'Xorn', 'Scrapwork Mutt', 'Implement of Improvement', 'Horrifying Revelation', 'Unsubstantiate', 'Llanowar Visionary', 'Buried Ruin', 'Form of the Dragon', 'Ondu Inversion', 'Obscura Storefront', 'Duress', 'Spellheart Chimera', 'Price of Progress', 'Kiln Fiend', 'Changeling Outcast', 'Lavaclaw Reaches', 'Colossal Skyturtle', 'Dismal Backwater', 'Vexing Shusher', 'Glare of Subdual', 'Arcum''s Astrolabe', 'Boomerang', 'Skycat Sovereign', 'Pixie Illusionist', 'Azorius Charm', 'Winds of Abandon', 'Satyr Wayfinder', 'Faithless Salvaging', 'Sunlit Marsh', 'Nissa''s Renewal', 'Sticky Fingers', 'Elixir of Immortality', 'Bring to Light', 'Late to Dinner', 'Pestilent Haze', 'Cleansing Wildfire', 'Vraska''s Contempt', 'Nimbus Maze', 'Clifftop Retreat', 'Memorial to Genius', 'Anger of the Gods', 'Firebolt', 'Academy Manufactor', 'Cruel Celebrant', 'Tyrant''s Scorn', 'Tormenting Voice', 'Lightning Stormkin', 'Opulent Palace', 'Far // Away', 'Brokers Hideout', 'Galvanic Alchemist', 'Emmara, Soul of the Accord', 'Tentative Connection', 'Metalwork Colossus', 'Faerie Miscreant', 'Hedron Archive', 'Condemn', 'Cabaretti Courtyard', 'Foundry Street Denizen', 'Clear the Mind', 'Soul Warden', 'Blazing Specter', 'Karn, Silver Golem', 'Crystalline Giant', 'Chandra, Pyromaster', 'Tooth and Nail', 'Into the Roil', 'Wheel of Fate', 'Flourishing Fox', 'Drannith Healer', 'Battlefield Forge', 'Norin the Wary', 'Yuan-Ti Fang-Blade', 'Magmatic Channeler', 'Hero''s Downfall', 'Silent Gravestone', 'Decree of Justice', 'Ash Zealot', 'Temple of Enlightenment', 'Vault of the Archangel', 'Skyshroud Ranger', 'Offalsnout', 'Overgrown Battlement', 'Temple of Mystery', 'Leonin Arbiter', 'Gruul Turf', 'Revoke Existence', 'Forgotten Cave', 'Mire''s Toll', 'Assault // Battery', 'Fauna Shaman', 'Monastery Swiftspear', 'Black Sun''s Zenith', 'Memory Lapse', 'Nimble Obstructionist', 'Memoricide', 'Priest of Fell Rites', 'Aetherspouts', 'Duskwatch Recruiter', 'Phyrexian Dreadnought', 'Idyllic Beachfront', 'Cryptic Caves', 'Prismatic Omen', 'Nivmagus Elemental', 'Tyrant''s Choice', 'Verdant Command', 'Plow Under', 'Ral, Storm Conduit', 'Spell Pierce', 'Yidaro, Wandering Monster', 'Irencrag Feat', 'Darkmoss Bridge', 'Aurelia''s Fury', 'Vampire Lacerator', 'Rakdos Signet', 'Last Stand', 'Mystical Teachings', 'Goblin Matron', 'Hinterland Harbor', 'Crash Through', 'Eternal Dragon', 'Zetalpa, Primal Dawn', 'Divest', 'Clout of the Dominus', 'Mirrorweave', 'Faith''s Reward', 'Blade Splicer', 'Combat Thresher', 'Fracturing Gust', 'Chained to the Rocks', 'Consume the Meek', 'Sarkhan the Masterless', 'Escape to the Wilds', 'Think Twice', 'Legion Angel', 'Magister of Worth', 'Judge''s Familiar', 'Wilt', 'Cathartic Reunion', 'Keldon Marauders', 'Ancient Amphitheater', 'Impostor of the Sixth Pride', 'Ingenious Infiltrator', 'Mistvault Bridge', 'Carnival // Carnage', 'Terramorphic Expanse', 'Figure of Destiny', 'Rise // Fall', 'Sorin, Vengeful Bloodlord', 'Hidetsugu, Devouring Chaos', 'Dusk Legion Zealot', 'Myrkul, Lord of Bones', 'You Find Some Prisoners', 'Fling', 'Primal Surge', 'Tattermunge Maniac', 'Planar Ally', 'Thran Portal', 'Squee, Goblin Nabob', 'Quarantine Field', 'Akoum Warrior', 'Glint-Sleeve Siphoner', 'Silundi Vision', 'Linessa, Zephyr Mage', 'Pirate''s Pillage', 'Warhost''s Frenzy', 'Heartfire Immolator', 'Augmenter Pugilist', 'Sejiri Shelter', 'Slip Out the Back', 'Frontline Medic', 'Fists of Flame', 'Skirk Prospector', 'Stonehorn Dignitary', 'Towashi Songshaper', 'Arch of Orazca', 'Oracle of Mul Daya', 'Riftsweeper', 'Frontier Bivouac', 'Mystifying Maze', 'Yavimaya Coast', 'Tendrils of Agony', 'Tolarian Terror', 'Reanimate', 'Nantuko Cultivator', 'Daxos of Meletis', 'Monoskelion', 'Lotleth Troll', 'Hieroglyphic Illumination', 'Myth Realized', 'Barbarian Ring', 'Mastermind''s Acquisition', 'Rift Sower', 'Aven Heartstabber', 'Kokusho, the Evening Star', 'Acidic Slime', 'Elspeth''s Nightmare', 'Timely Reinforcements', 'Windcaller Aven', 'Psychic Strike', 'Boom // Bust', 'Tree of Tales', 'Dwarven Forge-Chanter', 'Siege-Gang Commander', 'Trickbind', 'Peek', 'Wooded Bastion', 'Goblin Anarchomancer', 'Oran-Rief, the Vastwood', 'Bone Shards', 'Deep Analysis', 'Okiba-Gang Shinobi', 'Zuran Orb', 'Architects of Will', 'Mistcutter Hydra', 'Search for Tomorrow', 'Grapeshot', 'Thornwood Falls', 'Boartusk Liege', 'Spikefield Hazard', 'Cordial Vampire', 'Mistblade Shinobi', 'Pashalik Mons', 'Troll Ascetic', 'Riveteers Charm', 'Festival Crasher', 'Drake Haven', 'Ghalta, Primal Hunger', 'Bloodbraid Elf', 'Generous Patron', 'Call of the Herd', 'Glimmerpost', 'Seaside Citadel', 'Thirst for Knowledge', 'River Serpent', 'Blacksmith''s Skill', 'Endless Horizons', 'Courier''s Briefcase', 'Seasons Past', 'Crab Umbra', 'Bone Dragon', 'Mishra''s Research Desk', 'Megrim', 'Sylvan Scrying', 'Aetherling', 'Song-Mad Treachery', 'General''s Enforcer', 'Network Disruptor', 'Mistvein Borderpost', 'Lazotep Plating', 'Tidehollow Sculler', 'Swiftwater Cliffs', 'Lead the Stampede', 'Thawing Glaciers', 'Rob the Archives', 'Increasing Vengeance', 'Forbidden Alchemy', 'Lathliss, Dragon Queen', 'Detention Sphere', 'Dreams of Steel and Oil', 'Nivix Cyclops', 'Slaughter Pact', 'Jokulhaups', 'Elite Arcanist', 'Serra Ascendant', 'Void', 'Lost Legacy', 'Secluded Steppe', 'Invoke Calamity', 'Obliterating Bolt', 'Thaumatic Compass', 'Benalish Marshal', 'Benevolent Bodyguard', 'Fast // Furious', 'Stenn, Paranoid Partisan', 'Cultivate', 'Diabolic Edict', 'Wasteland Strangler', 'General Ferrous Rokiric', 'Fertile Ground', 'Arcane Sanctum', 'Razortide Bridge', 'Victim of Night', 'Goldmire Bridge', 'The Elder Dragon War', 'Baird, Argivian Recruiter', 'Dream Trawler', 'Pyrite Spellbomb', 'Forced Fruition', 'Caves of Koilos', 'Tainted Indulgence', 'Choked Estuary', 'Abiding Grace', 'Unlucky Witness', 'Avacyn''s Pilgrim', 'Axebane Guardian', 'Forked Bolt', 'Ziatora''s Envoy', 'Spirited Companion', 'Glen Elendra Archmage', 'Skarrgan Hellkite', 'Demonic Dread', 'Rootwater Depths', 'Curious Pair', 'Tangle', 'Fumigate', 'Cremate', 'Demigod of Revenge', 'Kaya, Ghost Assassin', 'Feasting Troll King', 'Eerie Interlude', 'Thornglint Bridge', 'Aethermage''s Touch', 'Eldrazi Mimic', 'Dokuchi Silencer', 'Essence Scatter', 'Bloodline Keeper', 'Westvale Abbey', 'Shared Discovery', 'Ajani, Caller of the Pride', 'Tamiyo, Collector of Tales', 'Restore Balance', 'Stormfist Crusader', 'Genesis Wave', 'Incinerate', 'Sphinx''s Tutelage', 'Sarkhan, the Dragonspeaker', 'Fog', 'Kolaghan, the Storm''s Fury', 'Ultimate Price', 'Seize the Spoils', 'Tasigur, the Golden Fang', 'The Underworld Cookbook', 'Cloudshift', 'Exquisite Firecraft', 'Urabrask the Hidden', 'Cut Down', 'Viashino Pyromancer', 'Haunted Plate Mail', 'Bag of Holding', 'Generous Visitor', 'Stern Dismissal', 'Lightning Strike', 'Mind Rake', 'Biovisionary', 'Buried Alive', 'Lavaball Trap', 'Evacuation', 'Genesis Ultimatum', 'Silence', 'Tranquil Thicket', 'Drift of Phantasms', 'Raven''s Crime', 'Cosmos Elixir', 'Saproling Burst', 'Goblin Gaveleer', 'Tyrant of Discord', 'Hazoret''s Undying Fury', 'Glittering Wish', 'Murderous Cut', 'Ruin Crab', 'Ranger of Eos', 'Wing Shards', 'Mogg Fanatic', 'Second Sunrise', 'Ponder', 'Goldhound', 'Sulfur Falls', 'Garruk Wildspeaker', 'Soul''s Attendant', 'Needle Spires', 'Night of Souls'' Betrayal', 'Doomed Traveler', 'Realm Razer', 'Dungrove Elder', 'Master of Death', 'Zendikar''s Roil', 'Collective Defiance', 'Jwari Disruption', 'Howling Mine', 'Firewild Borderpost', 'Ambitious Assault', 'Radiant Fountain', 'Experimental Synthesizer', 'The Birth of Meletis', 'Big Score', 'Tranquil Garden', 'Malicious Malfunction', 'Ethersworn Canonist', 'Dimir Charm', 'Crucible of Worlds', 'Garth One-Eye', 'Glacial Fortress', 'Wild Cantor', 'Assemble the Legion', 'Rakdos Cackler', 'Enter the God-Eternals', 'Eater of Virtue', 'Raffine''s Informant', 'Flame Slash', 'Riveteers Overlook', 'Notion Thief', 'Gray Merchant of Asphodel', 'Dragonskull Summit', 'Circuit Mender', 'Wasitora, Nekoru Queen', 'Brute Force', 'Abundant Growth', 'Electrostatic Infantry', 'Ransack the Lab', 'Port Town', 'Founding the Third Path', 'Resurgent Belief', 'Goblin Dark-Dwellers', 'Sacred Peaks', 'Frantic Search', 'Desperate Ritual', 'Blessed Alliance', 'Faerie Vandal', 'Go for the Throat', 'Fanatical Firebrand', 'Easy Prey', 'Lochmere Serpent', 'Arcbound Mouser', 'Goblin Charbelcher', 'Egon, God of Death', 'Angel of Despair', 'Goblin Arsonist'))) 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, 80.6, mysql)

Reported on decksite by mysql-perf

Location Hash: 0ac1fdccfb1f6263e29f5cb1ea6fa7016aa94305

Labels: decksite