Open vorpal-buildbot opened 4 years ago
Exceeded slow_query limit (148.6 > 30.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
(
SELECT
`start`.id,
`start`.code,
`start`.start_date AS start_date,
`end`.start_date AS end_date
FROM
season AS `start`
LEFT JOIN
season AS `end` ON `end`.id = `start`.id + 1
) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)
WHERE
(d.id IN (SELECT deck_id FROM deck_card WHERE card IN ('Cloudstone Curio', 'Glory-Bound Initiate', 'Secluded Steppe', 'Bloodhall Priest', 'Cavalcade of Calamity', 'Blightning', 'Weapons Trainer', 'Prophetic Prism', 'Soul''s Attendant', 'Judith, the Scourge Diva', 'Reki, the History of Kamigawa', 'Gitaxian Probe', 'Fetid Heath', 'Stone Haven Outfitter', 'Tranquil Thicket', 'Student of Warfare', 'Clackbridge Troll', 'Fling', 'Basking Rootwalla', 'Transcendent Master', 'Duskmantle Guildmage', 'Fyndhorn Elves', 'Vivid Meadow', 'Volcano Hellion', 'Ornithopter', 'Shock', 'Linvala, Shield of Sea Gate', 'Frontier Bivouac', 'Varchild''s War-Riders', 'Runed Halo', 'Assault // Battery', 'Akiri, Fearless Voyager', 'Titanoth Rex', 'Seasoned Hallowblade', 'Trespasser''s Curse', 'Creeping Chill', 'Haunted Dead', 'Omen of the Hunt', 'Carnophage', 'Opt', 'Lone Rider', 'Goblin Assault', 'Sign in Blood', 'Syr Konrad, the Grim', 'Brushfire Elemental', 'Runeflare Trap', 'Crimson Wisps', 'Kodama''s Reach', 'Stonehewer Giant', 'Lavaclaw Reaches', 'Animist''s Awakening', 'Elvish Mystic', 'Incinerate', 'Pelakka Predation', 'Electrolyze', 'Ayula, Queen Among Bears', 'Tranquil Cove', 'Oona''s Prowler', 'Terramorphic Expanse', 'Llanowar Elves', 'Scavenged Blade', 'Temple of Triumph', 'Copperhorn Scout', 'Magmatic Sinkhole', 'Precinct Captain', 'Tyrant''s Choice', 'Darkblast', 'Tangled Florahedron', 'Rampant Growth', 'Staff of Nin', 'Flayer Husk', 'Veteran Adventurer', 'Splinter', 'Boomerang', 'Nihil Spellbomb', 'Arboreal Grazer', 'Death Baron', 'Tempered Steel', 'Deep Analysis', 'Priest of Urabrask', 'Grasslands', 'Beanstalk Giant', 'Triplicate Spirits', 'Abzan Charm', 'Weatherlight', 'Seeker of the Way', 'Lazotep Reaver', 'Pharika''s Libation', 'Tectonic Edge', 'Tolsimir, Friend to Wolves', 'Read the Bones', 'Cloudcrest Lake', 'Grand Architect', 'Migration Path', 'Metallic Rebuke', 'Neutralize', 'Genesis', 'Hunted Nightmare', 'Nether Traitor', 'Rakdos Signet', 'Ethereal Armor', 'Chandra''s Phoenix', 'Teferi''s Tutelage', 'Ruin Crab', 'Grafted Wargear', 'Animate Dead', 'Deftblade Elite', 'Zur''s Weirding', 'Judge''s Familiar', 'Burst Lightning', 'Silversmote Ghoul', 'Faerie Vandal', 'Village Rites', 'River of Tears', 'Kefnet the Mindful', 'Curious Obsession', 'Ghostfire Blade', 'Underworld Dreams', 'War Falcon', 'Evolving Wilds', 'Conflagrate', 'Karametra''s Blessing', 'Nullmage Shepherd', 'Mimic Vat', 'Orzhov Charm', 'Foreboding Fruit', 'Squadron Hawk', 'Master of the Pearl Trident', 'Fire-Lit Thicket', 'Steel Hellkite', 'Blood Seeker', 'Dragon Fodder', 'Fleecemane Lion', 'Mistveil Plains', 'Rugged Prairie', 'Bala Ged Recovery', 'Scepter of Fugue', 'Wooded Bastion', 'Akoum Hellhound', 'Demonic Dread', 'Fevered Visions', 'Favored Hoplite', 'Boros Elite', 'Transcendent Envoy', 'Treacherous Blessing', 'Setessan Petitioner', 'Satyr Wayfinder', 'Glimmerpost', 'Temur Ascendancy', 'Ebony Owl Netsuke', 'Welding Jar', 'Burning Inquiry', 'Thief of Sanity', 'Urza''s Factory', 'Disfigure', 'Precursor Golem', 'Viscera Seer', 'Kathari Remnant', 'Lead the Stampede', 'Kederekt Parasite', 'Stromkirk Noble', 'Deep Forest Hermit', 'Kazuul''s Fury', 'Temple of Silence', 'Mana Leak', 'Emerge Unscathed', 'Skirk Prospector', 'Divinity of Pride', 'Noose Constrictor', 'Agonizing Remorse', 'Flourishing Fox', 'Spiteful Visions', 'Underworld Connections', 'Mogg War Marshal', 'Cloudpost', 'Vivid Creek', 'Reap the Past', 'Shredded Sails', 'Approach of the Second Sun', 'Crib Swap', 'Mother Bear', 'Piracy Charm', 'Igneous Pouncer', 'Blessed Alliance', 'Chandra''s Spitfire', 'Magus of the Bazaar', 'Throne of the God-Pharaoh', 'Hellrider', 'Tragic Lesson', 'Witch''s Oven', 'Fissure Wizard', 'Champion of Wits', 'Hymn to Tourach', 'Sunken Ruins', 'Sarcomancy', 'Izzet Boilerworks', 'Bond of Flourishing', 'Charge', 'Heartbeat of Spring', 'Trade Routes', 'Jace Beleren', 'Mist-Cloaked Herald', 'Stuffy Doll', 'Sinister Sabotage', 'Talisman of Conviction', 'Sire of Insanity', 'Darksteel Citadel', 'Displace', 'Benalish Marshal', 'Ancient Stirrings', 'Legion Angel', 'Astral Drift', 'Frantic Inventory', 'Phalanx Leader', 'Stupor', 'Claim the Firstborn', 'Aphemia, the Cacophony', 'Ajani''s Pridemate', 'Merfolk Sovereign', 'Elvish Visionary', 'Temple of Mystery', 'Scoured Barrens', 'Jungle Hollow', 'Dowsing Dagger', 'Spark Spray', 'Mire Triton', 'Kambal, Consul of Allocation', 'Wretched Banquet', 'Brainstorm', 'Mesmeric Fiend', 'Day of Judgment', 'Tomb of Urami', 'Where Ancients Tread', 'Flaxen Intruder', 'Revel in Riches', 'Diregraf Ghoul', 'Ash Zealot', 'Wandering Fumarole', 'Memnarch', 'Woodland Wanderer', 'Barbarian Ring', 'Grove of the Guardian', 'Ponder', 'Destroy the Evidence', 'Hypnotic Sprite', 'Daxos, Blessed by the Sun', 'Nomad Outpost', 'Mystic Monastery', 'Endless Horizons', 'Shrieking Affliction', 'Nezumi Shortfang', 'Shalai, Voice of Plenty', 'Drownyard Temple', 'Reclamation Sage', 'Angrath''s Rampage', 'Curse of Death''s Hold', 'Lightning Greaves', 'Thraben Inspector', 'Jackal Pup', 'Ulamog''s Crusher', 'Buried Alive', 'Swiftwater Cliffs', 'Selfless Savior', 'Orim''s Chant', 'Deprive', 'Coiling Oracle', 'Nearheath Pilgrim', 'Duskwatch Recruiter', 'Bonesplitter', 'Dwynen, Gilt-Leaf Daen', 'Kiora, Behemoth Beckoner', 'Dark Withering', 'Dark Prophecy', 'Spoils of Adventure', 'Flood Plain', 'Growth-Chamber Guardian', 'Bump in the Night', 'Scrabbling Claws', 'Sejiri Shelter', 'Drown in the Loch', 'Melira, Sylvok Outcast', 'Putrid Imp', 'Temple of Malice', 'Imperious Perfect', 'Clutch of the Undercity', 'Astral Slide', 'Valiant Rescuer', 'Summer Bloom', 'Dictate of Kruphix', 'Winding Way', 'Balustrade Spy', 'Golgari Findbroker', 'Savage Lands', 'Blackblade Reforged', 'Mystifying Maze', 'Castigate', 'Crumbling Vestige', 'Collective Defiance', 'Rakdos Cackler', 'Wurm''s Tooth', 'Cranial Plating', 'Glissa Sunseeker', 'Mana Flare', 'Reanimate', 'Mwonvuli Acid-Moss', 'Porcelain Legionnaire', 'Torch Courier', 'Jeskai Ascendancy', 'Lonely Sandbar', 'Mayhem Devil', 'Armadillo Cloak', 'Arcbound Worker', 'Thrill of Possibility', 'Master of the Feast', 'Kargan Intimidator', 'Progenitor Mimic', 'Mishra''s Factory', 'Dauntless Escort', 'Tribal Forcemage', 'Idol of Endurance', 'Hypnotic Specter', 'Gideon''s Intervention', 'Khalni Ambush', 'Deeproot Champion', 'Drannith Healer', 'Wildborn Preserver', 'Boros Reckoner', 'Kessig Wolf Run', 'Skull Fracture', 'Sandsteppe Citadel', 'Revitalize', 'Lightning Rift', 'Pathrazer of Ulamog', 'Gingerbrute', 'Village Messenger', 'Heartless Act', 'Bogardan Hellkite', 'Shinka, the Bloodsoaked Keep', 'Banefire', 'Expedition Map', 'Mythos of Nethroi', 'Ethersworn Canonist', 'Bloodfell Caves', 'Gavony Township', 'Generator Servant', 'Desecration Demon', 'Discovery // Dispersal', 'Tymaret Calls the Dead', 'Dusk Legion Zealot', 'Sky Skiff', 'Death Cloud', 'Sentinel''s Eyes', 'Goblin Dark-Dwellers', 'Thornwood Falls', 'Marwyn, the Nurturer', 'Stubborn Denial', 'Groundskeeper', 'Grim Lavamancer', 'Phylath, World Sculptor', 'Pharika''s Spawn', 'Luminarch Ascension', 'Jaddi Offshoot', 'Silence', 'Strategic Planning', 'Kamahl''s Druidic Vow', 'Planar Outburst', 'Banishing Light', 'Arcane Sanctum', 'Galvanic Blast', 'Drannith Stinger', 'Mastermind''s Acquisition', 'Navigator''s Compass', 'Liliana''s Triumph', 'Ajani Goldmane', 'Nimbus Maze', 'Crackling Drake', 'Dimir Aqueduct', 'Throes of Chaos', 'Fanatical Firebrand', 'Tajuru Paragon', 'Blackbloom Rogue', 'Asylum Visitor', 'Vapor Snag', 'Varolz, the Scar-Striped', 'Shriekhorn', 'Frogmite', 'Safehold Elite', 'Prophet of Kruphix', 'Torment of Scarabs', 'Mystic Archaeologist', 'Haktos the Unscarred', 'Endless Atlas', 'Liquimetal Coating', 'Arrogant Wurm', 'Selesnya Sanctuary', 'Firedrinker Satyr', 'Bloodthrone Vampire', 'Stormfist Crusader', 'Oust', 'Walk the Aeons', 'Dovin, Hand of Control', 'Toil // Trouble', 'Renewed Faith', 'Nyxathid', 'Falkenrath Aristocrat', 'Umbra Mystic', 'Masked Admirers', 'Smallpox', 'Captain''s Claws', 'Esper Charm', 'Might of the Masses', 'Laquatus''s Champion', 'Illness in the Ranks', 'Ruric Thar, the Unbowed', 'Eternal Dragon', 'Azami, Lady of Scrolls', 'Grave Scrabbler', 'Zektar Shrine Expedition', 'Firebolt', 'Phoenix of Ash', 'Kemba, Kha Regent', 'Vampire Lacerator', 'Zhalfirin Void', 'Archpriest of Iona', 'Vindicate', 'Dynavolt Tower', 'Etherium Sculptor', 'Earthshaker Khenra', 'Imposing Vantasaur', 'Stinkweed Imp', 'Deathless Knight', 'Skymarcher Aspirant', 'Twinflame', 'Fertile Thicket', 'Vraska''s Contempt', 'Mina and Denn, Wildborn', 'Exhaustion', 'Call of the Conclave', 'Charnel Troll', 'Artificer''s Assistant', 'Skyclave Cleric', 'Renata, Called to the Hunt', 'Edge of the Divinity', 'Imaginary Pet', 'Nightsky Mimic', 'Thornling', 'Stormblood Berserker', 'Boros Challenger', 'Negate', 'Guilty Conscience', 'Chandra''s Pyreling', 'Cursed Scroll', 'Forgotten Cave', 'Coralhelm Commander', 'Ayula''s Influence', 'Pyroclasm', 'Tombstalker', 'Seaside Citadel', 'Suture Priest', 'Izzet Charm', 'Vivien''s Arkbow', 'Primal Command', 'Master of Etherium', 'Boros Garrison', 'Fatestitcher', 'Zombie Infestation', 'Ultimate Price', 'Cauldron Familiar', 'Ransack the Lab', 'Rune Snag', 'Ivory Tower', 'Undead Augur', 'Ostracize', 'Chain Lightning', 'Kiora''s Follower', 'Nahiri, Storm of Stone', 'Call of the Death-Dweller', 'Vivid Grove', 'Dead Weight', 'Viashino Pyromancer', 'Angel of Glory''s Rise', 'Wind-Scarred Crag', 'Helm of the Gods', 'Trail of Crumbs', 'Geth''s Grimoire', 'Kari Zev, Skyship Raider', 'Desperate Ravings', 'Delver of Secrets', 'Etched Champion', 'Tradewind Rider', 'Champion of the Flame', 'All That Glitters', 'Golgari Rot Farm', 'Spell Pierce', 'Stonehorn Dignitary', 'Universal Automaton', 'Ghostly Flicker', 'Skirsdag High Priest', 'Go for Blood', 'Dimir Charm', 'Blasphemous Act', 'Outflank', 'Garruk Wildspeaker', 'Dwynen''s Elite', 'Oblivion Ring', 'Mnemonic Wall', 'Pore Over the Pages', 'Sprite Dragon', 'Keep Safe', 'Sylvan Messenger', 'Urza''s Ruinous Blast', 'Marauding Blight-Priest', 'Gatekeeper of Malakir', 'Invoke the Firemind', 'Chandra, Pyromaster', 'Squee, Goblin Nabob', 'Justice Strike', 'Field of Ruin', 'Orzhov Basilica', 'Servo Exhibition', 'Plow Under', 'Signal Pest', 'Desecrated Tomb', 'Cartouche of Solidarity', 'Hyena Umbra', 'Battle Hymn', 'Silundi Vision', 'Hunted Phantasm', 'Rosheen Meanderer', 'Driven // Despair', 'Murderous Redcap', 'Glass of the Guildpact', 'Explore', 'Vivid Marsh', 'Falkenrath Gorger', 'Jwari Disruption', 'Llanowar Mentor', 'Worldgorger Dragon', 'Lantern-Lit Graveyard', 'Kabira Takedown', 'Blossoming Sands', 'Gideon Jura', 'Akroan Skyguard', 'Howltooth Hollow', 'Rugged Highlands', 'Obsessive Search', 'Drag to the Underworld', 'Tidehollow Sculler', 'Prison Realm', 'Loxodon Smiter', 'Bygone Bishop', 'Condemn', 'Sparkmage Apprentice', 'Cyclops of Eternal Fury', 'Spirit Mantle', 'Ensoul Artifact', 'Phyrexian Dreadnought', 'Helm of the Host', 'Goblin Banneret', 'Archfiend of Ifnir', 'Titan''s Strength', 'Advent of the Wurm', 'Grapeshot', 'Gigadrowse', 'Ayli, Eternal Pilgrim', 'Yahenni''s Expertise', 'Anax, Hardened in the Forge', 'Malakir Rebirth', 'Quest for the Nihil Stone', 'Setessan Training', 'Staff of Domination', 'Mire''s Toll', 'Dark Ritual', 'Treasure Cruise', 'Vesperlark', 'Cling to Dust', 'Beckon Apparition', 'Duress', 'Smiting Helix', 'Divest', 'Mindcrank', 'Goblin Matron', 'Springleaf Drum', 'Gryff''s Boon', 'Muddle the Mixture', 'Thermo-Alchemist', 'Liliana''s Caress', 'Forbidden Alchemy', 'Dusk // Dawn', 'Azorius Charm', 'Llanowar Visionary', 'Sylvan Library', 'Tectonic Giant', 'Mystic Sanctuary', 'Soldier of the Pantheon', 'Selvala, Explorer Returned', 'End-Raze Forerunners', 'Laboratory Maniac', 'Tajic, Legion''s Edge', 'Wild Mongrel', 'Imposing Sovereign', 'Selesnya Charm', 'Call the Bloodline', 'Chief of the Foundry', 'Vampire Nighthawk', 'Encroaching Wastes', 'Ritual of Rejuvenation', 'Kor Cartographer', 'Alirios, Enraptured', 'Toolcraft Exemplar', 'Fight with Fire', 'Primal Amulet', 'Giant Killer', 'Hateful Eidolon', 'Healing Hands', 'Archaeomancer', 'Cruel Bargain', 'Augur of Bolas', 'Kor Skyfisher', 'Ranger of Eos', 'Yasharn, Implacable Earth', 'Fiend Hunter', 'Apostle''s Blessing', 'Trygon Predator', 'Base Camp', 'Improbable Alliance', 'Nimble Trapfinder', 'Graven Cairns', 'The Antiquities War', 'Broodmate Dragon', 'Saproling Burst', 'Bronzehide Lion', 'Cabal Ritual', 'Honor of the Pure', 'Turnabout', 'Rhys the Redeemed', 'Faith''s Fetters', 'Unsubstantiate', 'Elvish Archdruid', 'Wirewood Hivemaster', 'Psychic Strike', 'Scion of Vitu-Ghazi', 'Nim Deathmantle', 'Goblin Gaveleer', 'Endbringer', 'Gruul Turf', 'Avacyn''s Pilgrim', 'Barren Moor', 'Lava Dart', 'Vanguard of Brimaz', 'Dread Return', 'Shizo, Death''s Storehouse', 'Fact or Fiction', 'Myr Landshaper', 'Rootborn Defenses', 'Merrow Reejerey', 'Legacy Weapon', 'Silvergill Adept', 'Easy Prey', 'Flame Jab', 'Tendrils of Agony', 'Magus of the Candelabra', 'Ovalchase Daredevil', 'Chromatic Star', 'Expedite', 'Birds of Paradise', 'Fireblade Charger', 'Phyrexian Tyranny', 'Decree of Justice', 'Ondu Inversion', 'Mire''s Grasp', 'Howling Mine', 'Cut // Ribbons', 'Bile Blight', 'Footfall Crater', 'Nip Gwyllion', 'Kitesail Freebooter', 'Pieces of the Puzzle', 'Defiant Strike', 'Sunscour', 'Frantic Search', 'Spikefield Hazard', 'Artisan of Kozilek', 'Inscription of Ruin', 'Dryad Militant', 'Krenko''s Command', 'Intangible Virtue', 'Gray Merchant of Asphodel', 'Searing Spear', 'Brave the Elements', 'Mind Rake', 'Benevolent Bodyguard', 'Browbeat', 'Grizzly Fate', 'Cathartic Reunion', 'Fiery Temper', 'Concerted Defense', 'Ghitu Encampment', 'Protean Hulk', 'Truefire Captain', 'Vault of Whispers', 'Kataki, War''s Wage', 'Hypergenesis', 'Doomed Traveler', 'Wipe Away', 'Magister Sphinx', 'Acidic Slime', 'Fumigate', 'Sphinx''s Tutelage', 'Vedalken Certarch', 'Temple of Malady', 'Buried Ruin', 'Cultivate', 'Golgari Grave-Troll', 'Drana''s Emissary', 'Dovin''s Veto', 'Witch''s Cottage', 'Predator''s Gambit', 'Psychic Spiral', 'Syr Faren, the Hengehammer', 'Davriel, Rogue Shadowmage', 'Mothdust Changeling', 'Feed the Swarm', 'Man-o''-War', 'Heliod''s Pilgrim', 'Radiant Flames', 'Zenith Flare', 'Vendetta', 'Forked Bolt', 'Zada, Hedron Grinder', 'Griffin Aerie', 'Curiosity', 'Lys Alana Huntmaster', 'Court Homunculus', 'Dive Down', 'Lotleth Troll', 'Wistful Thinking', 'Orzhov Signet', 'Crumbling Necropolis', 'Dream Trawler', 'Repeal', 'Slagstorm', 'Alms of the Vein', 'Survival Cache', 'Go for the Throat', 'Mogis''s Marauder', 'Knight of New Alara', 'Mortarpod', 'Reassembling Skeleton', 'Quirion Dryad', 'Mystic Gate', 'Neoform', 'Cemetery Reaper', 'Evolutionary Leap', 'Omen of the Forge', 'Dismal Backwater', 'Light of Promise', 'Lodestone Golem', 'Cursecatcher', 'Porphyry Nodes', 'Brineborn Cutthroat', 'Elves of Deep Shadow', 'Wayfaring Temple', 'Calciform Pools', 'Think Twice', 'Bazaar Trademage', 'Khalni Garden', 'Jace''s Archivist', 'The Flame of Keld', 'Tymaret, Chosen from Death', 'Kor Outfitter', 'Sangromancer', 'Alseid of Life''s Bounty', 'Bant Panorama', 'Pillage', 'Cliffhaven Kitesail', 'Lochmere Serpent', 'Sylvan Scrying', 'Traxos, Scourge of Kroog', 'Goreclaw, Terror of Qal Sisma', 'Bad River'))) AND (TRUE)
GROUP BY
d.id,
d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
HAVING
TRUE
ORDER BY
active_date DESC, d.finish IS NULL, d.finish
```
[]
(slow_query, 148.6, mysql)
Reported on decksite by mysql-perf
Location Hash: b29c1931f05797b8c1fceb71e506a56b639183e5
Labels: decksite
Exceeded slow_query limit (72.3 > 30.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
(
SELECT
`start`.id,
`start`.code,
`start`.start_date AS start_date,
`end`.start_date AS end_date
FROM
season AS `start`
LEFT JOIN
season AS `end` ON `end`.id = `start`.id + 1
) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)
WHERE
(d.id IN (SELECT deck_id FROM deck_card WHERE card IN ('Sejiri Shelter', 'Renewed Faith', 'Vampire Nighthawk', 'Balustrade Spy', 'Reap the Past', 'Dream Trawler', 'Kor Cartographer', 'Reassembling Skeleton', 'Scavenged Blade', 'Disfigure', 'Neutralize', 'Field of Ruin', 'Wirewood Hivemaster', 'Rhys the Redeemed', 'Flame Jab', 'Knight of New Alara', 'Astral Slide', 'Mythos of Nethroi', 'Tidehollow Sculler', 'Bant Panorama', 'Kodama''s Reach', 'Orzhov Charm', 'Decree of Justice', 'Precinct Captain', 'Goblin Dark-Dwellers', 'Driven // Despair', 'Grafted Wargear', 'Cyclops of Eternal Fury', 'Burning Inquiry', 'Elvish Mystic', 'Cranial Plating', 'Easy Prey', 'Faerie Vandal', 'Death Cloud', 'Navigator''s Compass', 'Selfless Savior', 'Spikefield Hazard', 'Sunken Ruins', 'Mystic Archaeologist', 'Mystic Sanctuary', 'Boros Elite', 'Animist''s Awakening', 'Lodestone Golem', 'Wipe Away', 'Spark Spray', 'Dark Withering', 'Kiora, Behemoth Beckoner', 'Thornwood Falls', 'Kari Zev, Skyship Raider', 'Firebolt', 'Lightning Rift', 'Ethereal Armor', 'Angel of Glory''s Rise', 'Varchild''s War-Riders', 'Lead the Stampede', 'Mortarpod', 'Nip Gwyllion', 'Charge', 'Dauntless Escort', 'Bond of Flourishing', 'Blessed Alliance', 'Satyr Wayfinder', 'Lotleth Troll', 'Vivid Grove', 'Orzhov Signet', 'Alms of the Vein', 'Vesperlark', 'Gryff''s Boon', 'Fevered Visions', 'Deeproot Champion', 'Favored Hoplite', 'Pore Over the Pages', 'Guilty Conscience', 'Stonehorn Dignitary', 'Base Camp', 'Arcane Sanctum', 'Benevolent Bodyguard', 'Steel Hellkite', 'Seeker of the Way', 'Akiri, Fearless Voyager', 'Stubborn Denial', 'Slagstorm', 'Haunted Dead', 'Chromatic Star', 'Judge''s Familiar', 'Blossoming Sands', 'Call of the Conclave', 'Champion of the Flame', 'Silversmote Ghoul', 'Grove of the Guardian', 'Oblivion Ring', 'Divinity of Pride', 'Goreclaw, Terror of Qal Sisma', 'Ebony Owl Netsuke', 'Exhaustion', 'Witch''s Oven', 'Justice Strike', 'Vault of Whispers', 'Ruin Crab', 'Temple of Triumph', 'Wildborn Preserver', 'Ancient Stirrings', 'Ondu Inversion', 'Agonizing Remorse', 'Safehold Elite', 'Drownyard Temple', 'Flourishing Fox', 'Dynavolt Tower', 'Skirsdag High Priest', 'Flaxen Intruder', 'Underworld Connections', 'Cruel Bargain', 'Krenko''s Command', 'Concerted Defense', 'Hateful Eidolon', 'Rakdos Cackler', 'Evolutionary Leap', 'Grasslands', 'Smallpox', 'Dimir Aqueduct', 'Progenitor Mimic', 'Coralhelm Commander', 'Ayula''s Influence', 'Azorius Charm', 'Etched Champion', 'Healing Hands', 'Rugged Prairie', 'Barren Moor', 'Stone Haven Outfitter', 'Seaside Citadel', 'Archfiend of Ifnir', 'Ajani Goldmane', 'Zombie Infestation', 'Conflagrate', 'Banishing Light', 'Where Ancients Tread', 'The Antiquities War', 'Migration Path', 'Repeal', 'Piracy Charm', 'Ivory Tower', 'Wandering Fumarole', 'Mishra''s Factory', 'Lantern-Lit Graveyard', 'Cauldron Familiar', 'Judith, the Scourge Diva', 'Spoils of Adventure', 'Elves of Deep Shadow', 'Nomad Outpost', 'Deftblade Elite', 'Endless Horizons', 'Cabal Ritual', 'War Falcon', 'Helm of the Host', 'Master of Etherium', 'Faith''s Fetters', 'Fleecemane Lion', 'Tymaret, Chosen from Death', 'Ornithopter', 'Tymaret Calls the Dead', 'Rugged Highlands', 'Mire Triton', 'Nyxathid', 'Read the Bones', 'Basking Rootwalla', 'Dusk // Dawn', 'Gideon Jura', 'Vapor Snag', 'Ulamog''s Crusher', 'Grim Lavamancer', 'Curious Obsession', 'Foreboding Fruit', 'Mind Rake', 'Idol of Endurance', 'Winding Way', 'Khalni Garden', 'Unsubstantiate', 'Kiora''s Follower', 'Glory-Bound Initiate', 'Wurm''s Tooth', 'Claim the Firstborn', 'Teferi''s Tutelage', 'Expedite', 'Varolz, the Scar-Striped', 'Savage Lands', 'Akoum Hellhound', 'Armadillo Cloak', 'Howltooth Hollow', 'Putrid Imp', 'Noose Constrictor', 'Mothdust Changeling', 'Shinka, the Bloodsoaked Keep', 'Fireblade Charger', 'Drana''s Emissary', 'Pillage', 'Runed Halo', 'Emerge Unscathed', 'Selesnya Charm', 'Etherium Sculptor', 'Dead Weight', 'Secluded Steppe', 'Demonic Dread', 'Dismal Backwater', 'Toil // Trouble', 'Explore', 'Sunscour', 'Broodmate Dragon', 'All That Glitters', 'Jaddi Offshoot', 'Hypnotic Sprite', 'Flood Plain', 'Nearheath Pilgrim', 'Cloudpost', 'Mystic Gate', 'Nightsky Mimic', 'Cloudcrest Lake', 'Nimble Trapfinder', 'Call of the Death-Dweller', 'Mastermind''s Acquisition', 'Revitalize', 'Stromkirk Noble', 'Plow Under', 'Rakdos Signet', 'Aphemia, the Cacophony', 'Crumbling Vestige', 'Kor Outfitter', 'Chandra''s Phoenix', 'Deathless Knight', 'Master of the Pearl Trident', 'Edge of the Divinity', 'Marwyn, the Nurturer', 'Scrabbling Claws', 'Fanatical Firebrand', 'Hunted Nightmare', 'Nullmage Shepherd', 'Urza''s Factory', 'Generator Servant', 'Brushfire Elemental', 'Copperhorn Scout', 'Valiant Rescuer', 'Akroan Skyguard', 'Genesis', 'Kederekt Parasite', 'Oona''s Prowler', 'Squee, Goblin Nabob', 'Tomb of Urami', 'Flayer Husk', 'Skyclave Cleric', 'Lava Dart', 'Archaeomancer', 'Vanguard of Brimaz', 'Geth''s Grimoire', 'End-Raze Forerunners', 'Shriekhorn', 'Selvala, Explorer Returned', 'Seasoned Hallowblade', 'Porphyry Nodes', 'Magister Sphinx', 'Dictate of Kruphix', 'Servo Exhibition', 'Kathari Remnant', 'Mistveil Plains', 'Sky Skiff', 'Legion Angel', 'Pelakka Predation', 'Earthshaker Khenra', 'Igneous Pouncer', 'Mayhem Devil', 'Bazaar Trademage', 'Pathrazer of Ulamog', 'Legacy Weapon', 'Blackblade Reforged', 'Keep Safe', 'Endless Atlas', 'Davriel, Rogue Shadowmage', 'Kefnet the Mindful', 'Shock', 'Drannith Healer', 'Trygon Predator', 'Acidic Slime', 'Cut // Ribbons', 'Electrolyze', 'Graven Cairns', 'Illness in the Ranks', 'Bump in the Night', 'Angrath''s Rampage', 'Mogis''s Marauder', 'Blackbloom Rogue', 'Weapons Trainer', 'Banefire', 'Stormblood Berserker', 'Cathartic Reunion', 'Blood Seeker', 'Ayula, Queen Among Bears', 'Cursed Scroll', 'Traxos, Scourge of Kroog', 'Kitesail Freebooter', 'Ash Zealot', 'Forbidden Alchemy', 'Light of Promise', 'Footfall Crater', 'Crib Swap', 'Dusk Legion Zealot', 'Melira, Sylvok Outcast', 'Protean Hulk', 'Sphinx''s Tutelage', 'Cliffhaven Kitesail', 'Golgari Rot Farm', 'Ensoul Artifact', 'Fyndhorn Elves', 'Inscription of Ruin', 'Silvergill Adept', 'Syr Konrad, the Grim', 'Veteran Adventurer', 'Ostracize', 'Thermo-Alchemist', 'Mire''s Grasp', 'Chief of the Foundry', 'Fiend Hunter', 'Apostle''s Blessing', 'Ranger of Eos', 'Darkblast', 'Fire-Lit Thicket', 'Yasharn, Implacable Earth', 'Treasure Cruise', 'Treacherous Blessing', 'Drag to the Underworld', 'Gigadrowse', 'Beanstalk Giant', 'Kambal, Consul of Allocation', 'Rosheen Meanderer', 'Buried Ruin', 'Mina and Denn, Wildborn', 'Zhalfirin Void', 'Howling Mine', 'Predator''s Gambit', 'Crackling Drake', 'Shredded Sails', 'Masked Admirers', 'Scion of Vitu-Ghazi', 'Imaginary Pet', 'Sinister Sabotage', 'Jace''s Archivist', 'Tyrant''s Choice', 'Omen of the Hunt', 'Dwynen''s Elite', 'Vraska''s Contempt', 'Mire''s Toll', 'Kessig Wolf Run', 'Talisman of Conviction', 'Primal Command', 'Kataki, War''s Wage', 'Castigate', 'Phoenix of Ash', 'Neoform', 'Toolcraft Exemplar', 'Terramorphic Expanse', 'Reki, the History of Kamigawa', 'Dwynen, Gilt-Leaf Daen', 'Vindicate', 'Alseid of Life''s Bounty', 'Wild Mongrel', 'Duskwatch Recruiter', 'Radiant Flames', 'Shizo, Death''s Storehouse', 'Dark Ritual', 'Helm of the Gods', 'Artificer''s Assistant', 'Trail of Crumbs', 'Kemba, Kha Regent', 'Fiery Temper', 'Tradewind Rider', 'Tajic, Legion''s Edge', 'Divest', 'Lonely Sandbar', 'Jace Beleren', 'Ghostfire Blade', 'Displace', 'Azami, Lady of Scrolls', 'Temur Ascendancy', 'Evolving Wilds', 'Orim''s Chant', 'Bile Blight', 'Vampire Lacerator', 'Walk the Aeons', 'Throne of the God-Pharaoh', 'Crimson Wisps', 'Sentinel''s Eyes', 'Rampant Growth', 'Mother Bear', 'Insolent Neonate', 'Turnabout', 'Goblin Assault', 'Survival Cache', 'Jwari Disruption', 'Hypnotic Specter', 'Izzet Boilerworks', 'Tajuru Paragon', 'Urza''s Ruinous Blast', 'Planar Outburst', 'Desperate Ravings', 'Dovin, Hand of Control', 'Desecrated Tomb', 'Mindcrank', 'Saproling Burst', 'Ghostly Flicker', 'Man-o''-War', 'Growth-Chamber Guardian', 'Anax, Hardened in the Forge', 'Orzhov Basilica', 'Wooded Bastion', 'Ayli, Eternal Pilgrim', 'Magus of the Candelabra', 'Springleaf Drum', 'Golgari Grave-Troll', 'Go for the Throat', 'Sangromancer', 'Wayfaring Temple', 'Buried Alive', 'Cavalcade of Calamity', 'Soul''s Attendant', 'Incinerate', 'Benalish Marshal', 'Reanimate', 'Ransack the Lab', 'Weatherlight', 'Psychic Strike', 'Lightning Greaves', 'Vivid Creek', 'Bloodfell Caves', 'Temple of Malice', 'Astral Drift', 'Titan''s Strength', 'Chandra''s Spitfire', 'Duskmantle Guildmage', 'Augur of Bolas', 'Dimir Charm', 'Imposing Sovereign', 'Carnophage', 'Setessan Training', 'Garruk Wildspeaker', 'Alirios, Enraptured', 'Pharika''s Spawn', 'Tendrils of Agony', 'Hunted Phantasm', 'Forked Bolt', 'Firedrinker Satyr', 'Elvish Archdruid', 'The Flame of Keld', 'Lone Rider', 'Grizzly Fate', 'Go for Blood', 'Student of Warfare', 'Dive Down', 'Artisan of Kozilek', 'Underworld Dreams', 'Endbringer', 'Kor Skyfisher', 'Grand Architect', 'Phylath, World Sculptor', 'Boros Reckoner', 'Heartless Act', 'Trespasser''s Curse', 'Precursor Golem', 'Frantic Search', 'Signal Pest', 'Khalni Ambush', 'Goblin Gaveleer', 'Cultivate', 'Giant Killer', 'Thief of Sanity', 'Zada, Hedron Grinder', 'Welding Jar', 'Gatekeeper of Malakir', 'Hymn to Tourach', 'Creeping Chill', 'Setessan Petitioner', 'Magmatic Sinkhole', 'Malakir Rebirth', 'Ghitu Encampment', 'Doomed Traveler', 'Brainstorm', 'Swiftwater Cliffs', 'Lazotep Reaver', 'Expedition Map', 'Duress', 'Skull Fracture', 'Marauding Blight-Priest', 'Bloodthrone Vampire', 'Birds of Paradise', 'Sarcomancy', 'Ajani''s Pridemate', 'Psychic Spiral', 'Village Rites', 'Fatestitcher', 'Frontier Bivouac', 'Fight with Fire', 'Prophet of Kruphix', 'Tempered Steel', 'Zenith Flare', 'Collective Defiance', 'Pieces of the Puzzle', 'Nimbus Maze', 'Tombstalker', 'Trade Routes', 'Burst Lightning', 'Boros Garrison', 'Universal Automaton', 'Crumbling Necropolis', 'Arrogant Wurm', 'Cemetery Reaper', 'Goblin Banneret', 'Champion of Wits', 'Approach of the Second Sun', 'Tolsimir, Friend to Wolves', 'Sylvan Messenger', 'Phyrexian Dreadnought', 'Wistful Thinking', 'Skirk Prospector', 'Blightning', 'Mwonvuli Acid-Moss', 'Destroy the Evidence', 'Boomerang', 'Beckon Apparition', 'Eternal Dragon', 'Sparkmage Apprentice', 'Stormfist Crusader', 'Shrieking Affliction', 'Diregraf Ghoul', 'Hypergenesis', 'Transcendent Master', 'Spirit Mantle', 'Thraben Inspector', 'Magus of the Bazaar', 'Nezumi Shortfang', 'Llanowar Visionary', 'Strategic Planning', 'Delver of Secrets', 'Torch Courier', 'Yahenni''s Expertise', 'Esper Charm', 'Dread Return', 'Charnel Troll', 'Pyroclasm', 'Phyrexian Tyranny', 'Improbable Alliance', 'Tectonic Giant', 'Heartbeat of Spring', 'Sylvan Library', 'Captain''s Claws', 'Linvala, Shield of Sea Gate', 'Curse of Death''s Hold', 'Vivid Meadow', 'Death Baron', 'Nahiri, Storm of Stone', 'Luminarch Ascension', 'Gingerbrute', 'Splinter', 'Liliana''s Triumph', 'Negate', 'Spell Pierce', 'Scepter of Fugue', 'Stuffy Doll', 'Outflank', 'Jungle Hollow', 'Call the Bloodline', 'Nihil Spellbomb', 'Arboreal Grazer', 'Kazuul''s Fury', 'Grave Scrabbler', 'Sylvan Scrying', 'Rune Snag', 'Imperious Perfect', 'Brineborn Cutthroat', 'Gray Merchant of Asphodel', 'Fact or Fiction', 'Cling to Dust', 'Throes of Chaos', 'Drannith Stinger', 'Sandsteppe Citadel', 'Primal Amulet', 'Temple of Mystery', 'Fumigate', 'Woodland Wanderer', 'Zektar Shrine Expedition', 'Ruric Thar, the Unbowed', 'Thrill of Possibility', 'Memnarch', 'Gavony Township', 'Tribal Forcemage', 'Vedalken Certarch', 'Murderous Redcap', 'Curiosity', 'Scoured Barrens', 'Bygone Bishop', 'Gitaxian Probe', 'Ultimate Price', 'Reclamation Sage', 'Silundi Vision', 'Jackal Pup', 'Deep Forest Hermit', 'Golgari Findbroker', 'Nether Traitor', 'Dark Prophecy', 'Fetid Heath', 'Glissa Sunseeker', 'Tranquil Cove', 'Mana Leak', 'Think Twice', 'Opt', 'Nim Deathmantle', 'Liquimetal Coating', 'Ritual of Rejuvenation', 'Stupor', 'Forgotten Cave', 'River of Tears', 'Lavaclaw Reaches', 'Omen of the Forge', 'Oust', 'Boros Challenger', 'Myr Landshaper', 'Vendetta', 'Stonehewer Giant', 'Smiting Helix', 'Tranquil Thicket', 'Bad River', 'Ovalchase Daredevil', 'Wind-Scarred Crag', 'Tragic Lesson', 'Advent of the Wurm', 'Ethersworn Canonist', 'Stinkweed Imp', 'Darksteel Citadel', 'Asylum Visitor', 'Witch''s Cottage', 'Sign in Blood', 'Sprite Dragon', 'Coiling Oracle', 'Lys Alana Huntmaster', 'Undead Augur', 'Frantic Inventory', 'Browbeat', 'Temple of Silence', 'Worldgorger Dragon', 'Clackbridge Troll', 'Llanowar Mentor', 'Phalanx Leader', 'Selesnya Sanctuary', 'Goblin Matron', 'Summer Bloom', 'Glass of the Guildpact', 'Soldier of the Pantheon', 'Prophetic Prism', 'Brave the Elements', 'Karametra''s Blessing', 'Gruul Turf', 'Glimmerpost', 'Fertile Thicket', 'Ponder', 'Heliod''s Pilgrim', 'Bloodhall Priest', 'Searing Spear', 'Prison Realm', 'Cloudstone Curio', 'Muddle the Mixture', 'Staff of Domination', 'Syr Faren, the Hengehammer', 'Mystifying Maze', 'Chandra''s Pyreling', 'Mist-Cloaked Herald', 'Bonesplitter', 'Imposing Vantasaur', 'Day of Judgment', 'Viscera Seer', 'Chandra, Pyromaster', 'Vivid Marsh', 'Titanoth Rex', 'Dragon Fodder', 'Animate Dead', 'Laquatus''s Champion', 'Bogardan Hellkite', 'Deprive', 'Porcelain Legionnaire', 'Avacyn''s Pilgrim', 'Skymarcher Aspirant', 'First-Sphere Gargantua', 'Condemn', 'Battle Hymn', 'Triplicate Spirits', 'Elvish Visionary', 'Laboratory Maniac', 'Torment of Scarabs', 'Fling', 'Gideon''s Intervention', 'Haktos the Unscarred', 'Dryad Militant', 'Blasphemous Act', 'Arcbound Worker', 'Cursecatcher', 'Invoke the Firemind', 'Fissure Wizard', 'Defiant Strike', 'Squadron Hawk', 'Grapeshot', 'Obsessive Search', 'Mimic Vat', 'Hellrider', 'Rootborn Defenses', 'Tangled Florahedron', 'Dovin''s Veto', 'Twinflame', 'Mnemonic Wall', 'Llanowar Elves', 'Clutch of the Undercity', 'Merrow Reejerey', 'Volcano Hellion', 'Archpriest of Iona', 'Viashino Pyromancer', 'Honor of the Pure', 'Discovery // Dispersal', 'Temple of Malady', 'Mystic Monastery', 'Kamahl''s Druidic Vow', 'Barbarian Ring', 'Transcendent Envoy', 'Izzet Charm', 'Loxodon Smiter', 'Quest for the Nihil Stone', 'Hyena Umbra', 'Frogmite', 'Bronzehide Lion', 'Thornling', 'Umbra Mystic', 'Abzan Charm', 'Wretched Banquet', 'Shalai, Voice of Plenty', 'Dowsing Dagger', 'Mesmeric Fiend', 'Groundskeeper', 'Griffin Aerie', 'Priest of Urabrask', 'Mogg War Marshal', 'Deep Analysis', 'Intangible Virtue', 'Drown in the Loch', 'Truefire Captain', 'Runeflare Trap', 'Kargan Intimidator', 'Liliana''s Caress', 'Vivien''s Arkbow', 'Zur''s Weirding', 'Encroaching Wastes', 'Renata, Called to the Hunt', 'Lochmere Serpent', 'Master of the Feast', 'Bala Ged Recovery', 'Pharika''s Libation', 'Village Messenger', 'Falkenrath Gorger', 'Silence', 'Might of the Masses', 'Metallic Rebuke', 'Tectonic Edge', 'Desecration Demon', 'Quirion Dryad', 'Suture Priest', 'Daxos, Blessed by the Sun', 'Merfolk Sovereign', 'Galvanic Blast', 'Chain Lightning', 'Jeskai Ascendancy', 'Calciform Pools', 'Spiteful Visions', 'Staff of Nin', 'Cartouche of Solidarity', 'Revel in Riches', 'Court Homunculus', 'Sire of Insanity', 'Feed the Swarm', 'Kabira Takedown', 'Falkenrath Aristocrat', 'Mana Flare', 'Assault // Battery'))) AND (TRUE)
GROUP BY
d.id,
d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
HAVING
TRUE
ORDER BY
active_date DESC, d.finish IS NULL, d.finish
```
[]
(slow_query, 72.3, mysql)
Reported on decksite by mysql-perf
Location Hash: b29c1931f05797b8c1fceb71e506a56b639183e5
Labels: decksite
Exceeded slow_query limit (128.6 > 30.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
(
SELECT
`start`.id,
`start`.code,
`start`.start_date AS start_date,
`end`.start_date AS end_date
FROM
season AS `start`
LEFT JOIN
season AS `end` ON `end`.id = `start`.id + 1
) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)
WHERE
(d.id IN (SELECT deck_id FROM deck_card WHERE card IN ('Crumbling Vestige', 'Cliffhaven Kitesail', 'Urza''s Factory', 'Hunted Nightmare', 'Skyclave Cleric', 'Forked Bolt', 'Mystifying Maze', 'Jwari Disruption', 'Field of Ruin', 'Vivid Marsh', 'Vindicate', 'Legion Angel', 'Lochmere Serpent', 'Creeping Chill', 'Shriekhorn', 'Transcendent Master', 'Porcelain Legionnaire', 'Turnabout', 'Earthshaker Khenra', 'First-Sphere Gargantua', 'Golgari Findbroker', 'Jungle Hollow', 'Rugged Highlands', 'Assault // Battery', 'Toil // Trouble', 'Dark Withering', 'Day of Judgment', 'Forbidden Alchemy', 'Flayer Husk', 'Conflagrate', 'Student of Warfare', 'Walk the Aeons', 'Golgari Rot Farm', 'Cruel Bargain', 'Pelakka Predation', 'Smiting Helix', 'Loxodon Smiter', 'Shizo, Death''s Storehouse', 'Jackal Pup', 'Sphinx''s Tutelage', 'Porphyry Nodes', 'Wandering Fumarole', 'Endbringer', 'Desperate Ravings', 'Nimble Trapfinder', 'Skirk Prospector', 'Stone Haven Outfitter', 'Wretched Banquet', 'Sentinel''s Eyes', 'Tymaret, Chosen from Death', 'Wurm''s Tooth', 'Deathless Knight', 'Underworld Connections', 'Mystic Sanctuary', 'Kor Outfitter', 'Mythos of Nethroi', 'Satyr Wayfinder', 'Etched Champion', 'Growth-Chamber Guardian', 'Howling Mine', 'Concerted Defense', 'The Flame of Keld', 'Buried Ruin', 'Mist-Cloaked Herald', 'Geth''s Grimoire', 'Curious Obsession', 'Tyrant''s Choice', 'Displace', 'Deeproot Champion', 'Alirios, Enraptured', 'Krenko''s Command', 'Frantic Search', 'Rune Snag', 'Seeker of the Way', 'Helm of the Host', 'Davriel, Rogue Shadowmage', 'Varolz, the Scar-Striped', 'Frantic Inventory', 'Anax, Hardened in the Forge', 'Hypergenesis', 'Grand Architect', 'Groundskeeper', 'Rakdos Signet', 'Castigate', 'Mire''s Grasp', 'Ebony Owl Netsuke', 'Armadillo Cloak', 'Sarcomancy', 'Drannith Stinger', 'Endless Atlas', 'Ayula''s Influence', 'Nightsky Mimic', 'Smallpox', 'Zektar Shrine Expedition', 'Balustrade Spy', 'Lys Alana Huntmaster', 'Imperious Perfect', 'Merrow Reejerey', 'Cabal Ritual', 'Beckon Apparition', 'Bloodhall Priest', 'Cursecatcher', 'Toolcraft Exemplar', 'Nimbus Maze', 'Priest of Urabrask', 'Bile Blight', 'Lightning Rift', 'Cartouche of Solidarity', 'Dowsing Dagger', 'Stormfist Crusader', 'Abzan Charm', 'Underworld Dreams', 'Yahenni''s Expertise', 'Nomad Outpost', 'Darkblast', 'Tempered Steel', 'Selesnya Charm', 'Angrath''s Rampage', 'Sylvan Scrying', 'Bond of Flourishing', 'Outflank', 'Cloudstone Curio', 'Electrolyze', 'Bronzehide Lion', 'Thornwood Falls', 'Dusk // Dawn', 'Nip Gwyllion', 'Vivid Creek', 'Benalish Marshal', 'Grapeshot', 'Brave the Elements', 'Zur''s Weirding', 'Dread Return', 'Wayfaring Temple', 'Fiend Hunter', 'Oust', 'Masked Admirers', 'Predator''s Gambit', 'Aphemia, the Cacophony', 'Quirion Dryad', 'Grave Scrabbler', 'Boros Garrison', 'Trygon Predator', 'Village Rites', 'Cemetery Reaper', 'Etherium Sculptor', 'Syr Faren, the Hengehammer', 'Mogis''s Marauder', 'Stinkweed Imp', 'Dreamstealer', 'Bygone Bishop', 'Liliana''s Triumph', 'Deep Forest Hermit', 'Disfigure', 'Elves of Deep Shadow', 'The Antiquities War', 'Stuffy Doll', 'Jace Beleren', 'Master of the Pearl Trident', 'Vapor Snag', 'Grim Lavamancer', 'Chain Lightning', 'Pyroclasm', 'Kathari Remnant', 'Charnel Troll', 'Safehold Elite', 'Shalai, Voice of Plenty', 'Invoke the Firemind', 'Crib Swap', 'Chandra''s Spitfire', 'Basking Rootwalla', 'Foreboding Fruit', 'Pieces of the Puzzle', 'Akiri, Fearless Voyager', 'Discovery // Dispersal', 'Varchild''s War-Riders', 'Veteran Adventurer', 'Undead Augur', 'Ritual of Rejuvenation', 'Imaginary Pet', 'Boros Elite', 'Throne of the God-Pharaoh', 'Secluded Steppe', 'Death Cloud', 'Kamahl''s Druidic Vow', 'Advent of the Wurm', 'Scoured Barrens', 'Mind Rake', 'Mystic Gate', 'Apostle''s Blessing', 'Birds of Paradise', 'Kitesail Freebooter', 'Fyndhorn Elves', 'Jeskai Ascendancy', 'Nether Traitor', 'Light of Promise', 'Skull Fracture', 'Kemba, Kha Regent', 'Glissa Sunseeker', 'Marauding Blight-Priest', 'Servo Exhibition', 'Luminarch Ascension', 'Exhaustion', 'Fertile Thicket', 'Sign in Blood', 'Broodmate Dragon', 'Azami, Lady of Scrolls', 'Hypnotic Sprite', 'Yasharn, Implacable Earth', 'Call the Bloodline', 'Sheltering Light', 'Expedite', 'Go for the Throat', 'Pharika''s Spawn', 'Improbable Alliance', 'Kargan Intimidator', 'Stupor', 'Gray Merchant of Asphodel', 'Call of the Conclave', 'Elvish Visionary', 'Temple of Malice', 'Crimson Wisps', 'Nyxathid', 'Selesnya Sanctuary', 'Seasoned Hallowblade', 'Barren Moor', 'Augur of Bolas', 'Goblin Banneret', 'Fireblade Charger', 'Nullmage Shepherd', 'Fiery Temper', 'Tribal Forcemage', 'Goblin Matron', 'Linvala, Shield of Sea Gate', 'Hateful Eidolon', 'Volcano Hellion', 'Dimir Aqueduct', 'Muddle the Mixture', 'Drownyard Temple', 'Copperhorn Scout', 'Lotleth Troll', 'Giant Killer', 'Planar Outburst', 'Nezumi Shortfang', 'Stonehorn Dignitary', 'Rhys the Redeemed', 'Kessig Wolf Run', 'Dismal Backwater', 'Skymarcher Aspirant', 'Dark Prophecy', 'Cling to Dust', 'Omen of the Hunt', 'Tidehollow Sculler', 'Savage Lands', 'Mana Leak', 'Wirewood Hivemaster', 'Nahiri, Storm of Stone', 'Cyclops of Eternal Fury', 'Dark Ritual', 'Quest for the Nihil Stone', 'Decree of Justice', 'Darksteel Citadel', 'Desecrated Tomb', 'Slagstorm', 'Progenitor Mimic', 'Silence', 'Ransack the Lab', 'Judge''s Familiar', 'Umbra Mystic', 'Swiftwater Cliffs', 'Wind-Scarred Crag', 'Fatestitcher', 'Lone Rider', 'Inscription of Ruin', 'Staff of Domination', 'Spirit Mantle', 'War Falcon', 'Splinter', 'Blood Seeker', 'Flaxen Intruder', 'Vampire Lacerator', 'Fight with Fire', 'Kederekt Parasite', 'Flood Plain', 'Fling', 'Fetid Heath', 'Condemn', 'Pathrazer of Ulamog', 'Kjeldoran Outpost', 'Archaeomancer', 'Goreclaw, Terror of Qal Sisma', 'Dovin''s Veto', 'Drannith Healer', 'Dusk Legion Zealot', 'Chief of the Foundry', 'Goblin Dark-Dwellers', 'Genesis', 'Woodland Wanderer', 'Gideon Jura', 'Kor Skyfisher', 'Kazuul''s Fury', 'Universal Automaton', 'Mortarpod', 'Stromkirk Noble', 'Cranial Plating', 'Tranquil Cove', 'Oona''s Prowler', 'Delver of Secrets', 'Torment of Scarabs', 'Emerge Unscathed', 'Lightning Greaves', 'Sejiri Shelter', 'Rampant Growth', 'Evolving Wilds', 'Silvergill Adept', 'Encroaching Wastes', 'Tragic Lesson', 'Opt', 'Obsessive Search', 'Claim the Firstborn', 'Banishing Light', 'Viscera Seer', 'Where Ancients Tread', 'Death Baron', 'Scion of Vitu-Ghazi', 'Sangromancer', 'Merfolk Sovereign', 'Banefire', 'Champion of Wits', 'Cauldron Familiar', 'Carnophage', 'Rakdos Cackler', 'Neutralize', 'Grove of the Guardian', 'Torch Courier', 'Archfiend of Ifnir', 'Beanstalk Giant', 'Fissure Wizard', 'Ethereal Armor', 'Bonesplitter', 'Twinflame', 'Village Messenger', 'Duskwatch Recruiter', 'Blackbloom Rogue', 'Blasphemous Act', 'Hellrider', 'Llanowar Elves', 'Ranger of Eos', 'Glory-Bound Initiate', 'Soul''s Attendant', 'Wildborn Preserver', 'Setessan Training', 'Shinka, the Bloodsoaked Keep', 'Sunken Ruins', 'Thief of Sanity', 'Doomed Traveler', 'Talisman of Conviction', 'Burst Lightning', 'Footfall Crater', 'Swift Justice', 'Stonehewer Giant', 'Dive Down', 'Precinct Captain', 'Guilty Conscience', 'Boros Reckoner', 'Chandra''s Pyreling', 'Sinister Sabotage', 'Summer Bloom', 'Prophetic Prism', 'Vault of Whispers', 'Akroan Skyguard', 'Animist''s Awakening', 'Honor of the Pure', 'Primal Amulet', 'Spoils of Adventure', 'Rootborn Defenses', 'Reap the Past', 'Dimir Charm', 'Ethersworn Canonist', 'Stubborn Denial', 'Squee, Goblin Nabob', 'Kari Zev, Skyship Raider', 'Angel of Glory''s Rise', 'Karametra''s Blessing', 'Ostracize', 'Zada, Hedron Grinder', 'Reanimate', 'Khalni Ambush', 'Tectonic Giant', 'Scavenged Blade', 'Squadron Hawk', 'Vanguard of Brimaz', 'All That Glitters', 'Diregraf Ghoul', 'Call of the Death-Dweller', 'Driven // Despair', 'Liliana''s Caress', 'Forgotten Cave', 'Laquatus''s Champion', 'Tangled Florahedron', 'Gideon''s Intervention', 'Teferi''s Tutelage', 'Ajani Goldmane', 'Suture Priest', 'Imposing Sovereign', 'Orzhov Charm', 'Cavalcade of Calamity', 'Griffin Aerie', 'Alseid of Life''s Bounty', 'Brushfire Elemental', 'Curse of Death''s Hold', 'Lava Dart', 'Liquimetal Coating', 'Ancient Stirrings', 'Khalni Garden', 'Frogmite', 'Goblin Gaveleer', 'Firebolt', 'Sandsteppe Citadel', 'Coralhelm Commander', 'Trespasser''s Curse', 'Lead the Stampede', 'Coiling Oracle', 'Kiora''s Follower', 'Vendetta', 'Kambal, Consul of Allocation', 'Zombie Infestation', 'Esper Charm', 'Wild Mongrel', 'Fire-Lit Thicket', 'Falkenrath Aristocrat', 'Orim''s Chant', 'Scrabbling Claws', 'Dictate of Kruphix', 'Piracy Charm', 'Read the Bones', 'Thrill of Possibility', 'Izzet Boilerworks', 'Tolsimir, Friend to Wolves', 'Boomerang', 'Clackbridge Troll', 'River of Tears', 'Radiant Flames', 'Bant Panorama', 'Chandra, Pyromaster', 'Gigadrowse', 'Dovin, Hand of Control', 'Weatherlight', 'Steel Hellkite', 'Myr Landshaper', 'Trail of Crumbs', 'Heliod''s Pilgrim', 'Spell Pierce', 'Hunted Phantasm', 'Chromatic Star', 'Trade Routes', 'Signal Pest', 'Graven Cairns', 'Vedalken Certarch', 'Captain''s Claws', 'Cursed Scroll', 'Titanoth Rex', 'Charge', 'Pillage', 'Calciform Pools', 'Crumbling Necropolis', 'Mishra''s Factory', 'Nearheath Pilgrim', 'Ayula, Queen Among Bears', 'Brainstorm', 'Spark Spray', 'Pore Over the Pages', 'Lazotep Reaver', 'Tajuru Paragon', 'Noose Constrictor', 'Deep Analysis', 'Mogg War Marshal', 'Temur Ascendancy', 'Igneous Pouncer', 'Azorius Charm', 'Deprive', 'Bad River', 'Duskmantle Guildmage', 'Dryad Militant', 'Bala Ged Recovery', 'Master of Etherium', 'Springleaf Drum', 'Collective Defiance', 'Seaside Citadel', 'Memnarch', 'Laboratory Maniac', 'Syr Konrad, the Grim', 'Rugged Prairie', 'Hymn to Tourach', 'Expedition Map', 'Arboreal Grazer', 'Saproling Burst', 'Tectonic Edge', 'Temple of Malady', 'Desecration Demon', 'Vraska''s Contempt', 'Divest', 'Runeflare Trap', 'Thermo-Alchemist', 'Burning Inquiry', 'Curiosity', 'Grasslands', 'Crackling Drake', 'Vivien''s Arkbow', 'Blossoming Sands', 'Court Homunculus', 'Mimic Vat', 'Navigator''s Compass', 'Reki, the History of Kamigawa', 'Temple of Silence', 'Duress', 'Magus of the Bazaar', 'Artificer''s Assistant', 'Throes of Chaos', 'Justice Strike', 'Ondu Inversion', 'Browbeat', 'Reclamation Sage', 'Cathartic Reunion', 'Reassembling Skeleton', 'Protean Hulk', 'Gruul Turf', 'Spikefield Hazard', 'Defiant Strike', 'Avacyn''s Pilgrim', 'Boros Challenger', 'Go for Blood', 'Setessan Petitioner', 'Haunted Dead', 'Ultimate Price', 'Ruin Crab', 'Grizzly Fate', 'Edge of the Divinity', 'Psychic Strike', 'Temple of Mystery', 'Astral Drift', 'Cut // Ribbons', 'Viashino Pyromancer', 'Unsubstantiate', 'Ajani''s Pridemate', 'Malakir Rebirth', 'Oblivion Ring', 'Bloodfell Caves', 'Daxos, Blessed by the Sun', 'Keep Safe', 'Wooded Bastion', 'Mire Triton', 'Kodama''s Reach', 'Incinerate', 'Arcane Sanctum', 'Arrogant Wurm', 'Mayhem Devil', 'Phylath, World Sculptor', 'Easy Prey', 'Glass of the Guildpact', 'Ayli, Eternal Pilgrim', 'Firedrinker Satyr', 'Base Camp', 'Grafted Wargear', 'Phalanx Leader', 'Arcbound Worker', 'Tradewind Rider', 'Elvish Archdruid', 'Blightning', 'Runed Halo', 'Strategic Planning', 'Chandra''s Phoenix', 'Nihil Spellbomb', 'Kor Cartographer', 'Mistveil Plains', 'Ghitu Encampment', 'Flourishing Fox', 'Golgari Grave-Troll', 'Terramorphic Expanse', 'Sky Skiff', 'Neoform', 'Mystic Monastery', 'Wipe Away', 'Prison Realm', 'Gavony Township', 'Intangible Virtue', 'Barbarian Ring', 'Skirsdag High Priest', 'Tendrils of Agony', 'Evolutionary Leap', 'Hyena Umbra', 'Nim Deathmantle', 'Ivory Tower', 'Phyrexian Dreadnought', 'Primal Command', 'Phoenix of Ash', 'Plow Under', 'Negate', 'Temple of Triumph', 'Artisan of Kozilek', 'Shrieking Affliction', 'Judith, the Scourge Diva', 'Gryff''s Boon', 'Hero of Iroas', 'Garruk Wildspeaker', 'Archpriest of Iona', 'Faerie Vandal', 'Traxos, Scourge of Kroog', 'Weapons Trainer', 'Metallic Rebuke', 'Murderous Redcap', 'Asylum Visitor', 'Frontier Bivouac', 'Animate Dead', 'Llanowar Mentor', 'Buried Alive', 'Treacherous Blessing', 'Dynavolt Tower', 'Endless Horizons', 'Soldier of the Pantheon', 'Ovalchase Daredevil', 'Destroy the Evidence', 'Cloudcrest Lake', 'Gatekeeper of Malakir', 'Idol of Endurance', 'Kataki, War''s Wage', 'Sire of Insanity', 'Dead Weight', 'Welding Jar', 'Flame Jab', 'Rosheen Meanderer', 'Silversmote Ghoul', 'Fevered Visions', 'Dauntless Escort', 'Dragon Fodder', 'Stave Off', 'Phyrexian Tyranny', 'Mesmeric Fiend', 'Sunscour', 'Fanatical Firebrand', 'Heartbeat of Spring', 'Transcendent Envoy', 'Ghostly Flicker', 'Mother Bear', 'Tymaret Calls the Dead', 'Migration Path', 'Drag to the Underworld', 'Divinity of Pride', 'Jace''s Archivist', 'Liliana''s Reaver', 'Blessed Alliance', 'Mnemonic Wall', 'Precursor Golem', 'Sprite Dragon', 'Feed the Swarm', 'Jaddi Offshoot', 'Tombstalker', 'Shock', 'Witch''s Oven', 'Zhalfirin Void', 'Haktos the Unscarred', 'Prophet of Kruphix', 'Lavaclaw Reaches', 'Tranquil Thicket', 'Cultivate', 'Benevolent Bodyguard', 'Mina and Denn, Wildborn', 'Selfless Savior', 'Tomb of Urami', 'Mastermind''s Acquisition', 'Drown in the Loch', 'Bump in the Night', 'Mothdust Changeling', 'Favored Hoplite', 'Renata, Called to the Hunt', 'Valiant Rescuer', 'Vesperlark', 'Howltooth Hollow', 'Illness in the Ranks', 'Omen of the Forge', 'Shelter', 'Thraben Inspector', 'Galvanic Blast', 'Repeal', 'Mana Flare', 'Revitalize', 'Survival Cache', 'Eternal Dragon', 'Blackblade Reforged', 'Mindcrank', 'Agonizing Remorse', 'Magister Sphinx', 'Kiora, Behemoth Beckoner', 'Faith''s Fetters', 'Ghostfire Blade', 'Spiteful Visions', 'Vampire Nighthawk', 'Mystic Archaeologist', 'Gods Willing', 'Sylvan Library', 'Truefire Captain', 'Deftblade Elite', 'Master of the Feast', 'Shredded Sails', 'Kefnet the Mindful', 'Revel in Riches', 'Putrid Imp', 'Knight of New Alara', 'Fleecemane Lion', 'Lantern-Lit Graveyard', 'Marwyn, the Nurturer', 'Witch''s Cottage', 'Man-o''-War', 'Champion of the Flame', 'Orzhov Basilica', 'Goblin Assault', 'Winding Way', 'Staff of Nin', 'Gitaxian Probe', 'Llanowar Visionary', 'Worldgorger Dragon', 'Insolent Neonate', 'Bloodthrone Vampire', 'Ash Zealot', 'Mwonvuli Acid-Moss', 'Magmatic Sinkhole', 'Cloudpost', 'Astral Slide', 'Might of the Masses', 'Searing Spear', 'Urza''s Ruinous Blast', 'Dwynen, Gilt-Leaf Daen', 'Magus of the Candelabra', 'Lodestone Golem', 'Izzet Charm', 'Dwynen''s Elite', 'Ruric Thar, the Unbowed', 'Generator Servant', 'Tajic, Legion''s Edge', 'Akoum Hellhound', 'Ensoul Artifact', 'Helm of the Gods', 'Scepter of Fugue', 'Selvala, Explorer Returned', 'End-Raze Forerunners', 'Ponder', 'Vivid Grove', 'Zenith Flare', 'Psychic Spiral', 'Kabira Takedown', 'Gingerbrute', 'Imposing Vantasaur', 'Fact or Fiction', 'Bogardan Hellkite', 'Healing Hands', 'Hypnotic Specter', 'Falkenrath Gorger', 'Titan''s Strength', 'Approach of the Second Sun', 'Treasure Cruise', 'Thornling', 'Think Twice', 'Lonely Sandbar', 'Battle Hymn', 'Pharika''s Libation', 'Triplicate Spirits', 'Fumigate', 'Orzhov Signet', 'Sylvan Messenger', 'Acidic Slime', 'Renewed Faith', 'Heartless Act', 'Mire''s Toll', 'Elvish Mystic', 'Vivid Meadow', 'Demonic Dread', 'Drana''s Emissary', 'Dream Trawler', 'Legacy Weapon', 'Sparkmage Apprentice', 'Silundi Vision', 'Glimmerpost', 'Bazaar Trademage', 'Alms of the Vein', 'Clutch of the Undercity', 'Ulamog''s Crusher', 'Ornithopter', 'Wistful Thinking', 'Stormblood Berserker', 'Melira, Sylvok Outcast', 'Explore', 'Brineborn Cutthroat'))) AND (TRUE)
GROUP BY
d.id,
d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
HAVING
TRUE
ORDER BY
active_date DESC, d.finish IS NULL, d.finish
```
[]
(slow_query, 128.6, mysql)
Reported on decksite by mysql-perf
Location Hash: b29c1931f05797b8c1fceb71e506a56b639183e5
Labels: decksite
Exceeded slow_query limit (224.6 > 30.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
(
SELECT
`start`.id,
`start`.code,
`start`.start_date AS start_date,
`end`.start_date AS end_date
FROM
season AS `start`
LEFT JOIN
season AS `end` ON `end`.id = `start`.id + 1
) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)
WHERE
(d.id IN (SELECT deck_id FROM deck_card WHERE card IN ('Nip Gwyllion', 'Chromatic Star', 'Boomerang', 'Justice Strike', 'Gruul Turf', 'Azorius Charm', 'Titan''s Strength', 'Ostracize', 'Imposing Vantasaur', 'Witch''s Cottage', 'Ayula, Queen Among Bears', 'Hypergenesis', 'Evolutionary Leap', 'Artisan of Kozilek', 'Growth-Chamber Guardian', 'Treasure Cruise', 'Bloodthrone Vampire', 'Urza''s Ruinous Blast', 'End-Raze Forerunners', 'Drannith Stinger', 'Zombie Infestation', 'Laquatus''s Champion', 'Shrieking Affliction', 'Staff of Nin', 'Clackbridge Troll', 'Viscera Seer', 'Base Camp', 'Fling', 'Vivid Grove', 'Drown in the Loch', 'Daxos, Blessed by the Sun', 'Pharika''s Libation', 'Sire of Insanity', 'Renewed Faith', 'Firedrinker Satyr', 'Think Twice', 'Melira, Sylvok Outcast', 'Planar Outburst', 'Bad River', 'Selesnya Sanctuary', 'Disfigure', 'Thermo-Alchemist', 'Gods Willing', 'Yasharn, Implacable Earth', 'Stormfist Crusader', 'Barren Moor', 'Grove of the Guardian', 'Pathrazer of Ulamog', 'Fleecemane Lion', 'Flourishing Fox', 'Fiend Hunter', 'Mishra''s Factory', 'Etherium Sculptor', 'Knight of New Alara', 'Illness in the Ranks', 'Thornling', 'Prophetic Prism', 'Runeflare Trap', 'Psychic Spiral', 'Radiant Flames', 'Lonely Sandbar', 'Pyroclasm', 'Lantern-Lit Graveyard', 'Ornithopter', 'Safehold Elite', 'Kabira Takedown', 'Dark Withering', 'Ayula''s Influence', 'Survival Cache', 'Abzan Charm', 'Jaddi Offshoot', 'Lightning Rift', 'Oust', 'Mystic Monastery', 'Arrogant Wurm', 'Blightning', 'Nyxathid', 'Jwari Disruption', 'Viashino Pyromancer', 'Talisman of Conviction', 'Gatekeeper of Malakir', 'Progenitor Mimic', 'Mastermind''s Acquisition', 'Grafted Wargear', 'Mogis''s Marauder', 'Triplicate Spirits', 'Electrolyze', 'Shinka, the Bloodsoaked Keep', 'Spoils of Adventure', 'Kazuul''s Fury', 'Porphyry Nodes', 'Sejiri Shelter', 'Avacyn''s Pilgrim', 'Alseid of Life''s Bounty', 'Jungle Hollow', 'Duskwatch Recruiter', 'Karametra''s Blessing', 'Rugged Prairie', 'Deprive', 'Scavenged Blade', 'Tangled Florahedron', 'Judith, the Scourge Diva', 'Shock', 'Heartless Act', 'Repeal', 'Arboreal Grazer', 'Exhaustion', 'Browbeat', 'Defiant Strike', 'Castigate', 'Court Homunculus', 'Varolz, the Scar-Striped', 'Staff of Domination', 'Delver of Secrets', 'Shredded Sails', 'Izzet Charm', 'Battle Hymn', 'Scion of Vitu-Ghazi', 'Azami, Lady of Scrolls', 'Weatherlight', 'Grand Architect', 'Hunted Phantasm', 'Beanstalk Giant', 'River of Tears', 'Hunted Nightmare', 'Keep Safe', 'Cliffhaven Kitesail', 'Angrath''s Rampage', 'Goreclaw, Terror of Qal Sisma', 'Kambal, Consul of Allocation', 'Grizzly Fate', 'Prison Realm', 'Kemba, Kha Regent', 'Migration Path', 'Emerge Unscathed', 'Glimmerpost', 'Mwonvuli Acid-Moss', 'Drana''s Emissary', 'Geth''s Grimoire', 'Eternal Dragon', 'Mayhem Devil', 'Phyrexian Dreadnought', 'Tectonic Giant', 'Tymaret Calls the Dead', 'Dive Down', 'Rootborn Defenses', 'Smallpox', 'Selesnya Charm', 'Mana Flare', 'Strategic Planning', 'Goblin Banneret', 'Evolving Wilds', 'Archaeomancer', 'Boros Challenger', 'Coralhelm Commander', 'Unsubstantiate', 'Stromkirk Noble', 'Tectonic Edge', 'Temur Ascendancy', 'Edge of the Divinity', 'Cavalcade of Calamity', 'Brave the Elements', 'Master of Etherium', 'Garruk Wildspeaker', 'Fight with Fire', 'Hymn to Tourach', 'Desperate Ravings', 'Mythos of Nethroi', 'Grim Lavamancer', 'The Flame of Keld', 'Fevered Visions', 'Lys Alana Huntmaster', 'Trail of Crumbs', 'Encroaching Wastes', 'Swiftwater Cliffs', 'Day of Judgment', 'Silence', 'All That Glitters', 'Footfall Crater', 'Turnabout', 'Wirewood Hivemaster', 'Alirios, Enraptured', 'Secluded Steppe', 'Soul''s Attendant', 'Idol of Endurance', 'Transcendent Master', 'Graven Cairns', 'Expedite', 'Ondu Inversion', 'Igneous Pouncer', 'Champion of Wits', 'Endless Atlas', 'Saproling Burst', 'Squadron Hawk', 'Ethereal Armor', 'Master of the Feast', 'Veteran Adventurer', 'Favored Hoplite', 'Liliana''s Reaver', 'Brainstorm', 'Vampire Nighthawk', 'Foreboding Fruit', 'Worldgorger Dragon', 'Guilty Conscience', 'Reclamation Sage', 'Vesperlark', 'Calciform Pools', 'Gryff''s Boon', 'Shalai, Voice of Plenty', 'Kessig Wolf Run', 'Kargan Intimidator', 'Golgari Grave-Troll', 'Nezumi Shortfang', 'Crimson Wisps', 'Skyclave Cleric', 'Lone Rider', 'Vanguard of Brimaz', 'Phylath, World Sculptor', 'Chandra''s Pyreling', 'Stonehorn Dignitary', 'Lightning Greaves', 'Myr Landshaper', 'Suture Priest', 'Seasoned Hallowblade', 'Temple of Mystery', 'Tragic Lesson', 'Vampire Lacerator', 'Ash Zealot', 'Jace''s Archivist', 'Bloodhall Priest', 'Village Rites', 'Satyr Wayfinder', 'Go for Blood', 'Dream Trawler', 'Fanatical Firebrand', 'Sheltering Light', 'Brineborn Cutthroat', 'Fatestitcher', 'Kataki, War''s Wage', 'Anax, Hardened in the Forge', 'Malakir Rebirth', 'Mystifying Maze', 'Dynavolt Tower', 'Vault of Whispers', 'Spiteful Visions', 'Ajani Goldmane', 'Valiant Rescuer', 'Fumigate', 'Khalni Garden', 'Collective Defiance', 'Zada, Hedron Grinder', 'Hyena Umbra', 'Piracy Charm', 'Psychic Strike', 'Tajuru Paragon', 'Merfolk Sovereign', 'Sinister Sabotage', 'Sphinx''s Tutelage', 'Orim''s Chant', 'Syr Konrad, the Grim', 'Trade Routes', 'Merrow Reejerey', 'Elvish Mystic', 'Rugged Highlands', 'Bloodfell Caves', 'Dusk Legion Zealot', 'Mimic Vat', 'Howling Mine', 'Sunken Ruins', 'Displace', 'Setessan Petitioner', 'Squee, Goblin Nabob', 'Hateful Eidolon', 'Ethersworn Canonist', 'Volcano Hellion', 'Silundi Vision', 'Discovery // Dispersal', 'Chief of the Foundry', 'Tombstalker', 'Heartbeat of Spring', 'Reap the Past', 'Magus of the Bazaar', 'Noose Constrictor', 'Stone Haven Outfitter', 'Champion of the Flame', 'Navigator''s Compass', 'Smiting Helix', 'Where Ancients Tread', 'Mist-Cloaked Herald', 'Crumbling Vestige', 'Primal Command', 'Imposing Sovereign', 'Shelter', 'Imperious Perfect', 'Torch Courier', 'Davriel, Rogue Shadowmage', 'Mother Bear', 'War Falcon', 'Silversmote Ghoul', 'Broodmate Dragon', 'Liquimetal Coating', 'Banishing Light', 'Teferi''s Tutelage', 'Tradewind Rider', 'Obsessive Search', 'Dark Ritual', 'Claim the Firstborn', 'Kari Zev, Skyship Raider', 'Tribal Forcemage', 'Fertile Thicket', 'Desecrated Tomb', 'Brushfire Elemental', 'Llanowar Visionary', 'Laboratory Maniac', 'Vindicate', 'Scepter of Fugue', 'Cut // Ribbons', 'Blood Seeker', 'Muddle the Mixture', 'Bant Panorama', 'Reki, the History of Kamigawa', 'Wistful Thinking', 'Creeping Chill', 'Dowsing Dagger', 'Copperhorn Scout', 'Easy Prey', 'Krenko''s Command', 'Orzhov Charm', 'Bogardan Hellkite', 'Death Cloud', 'Nullmage Shepherd', 'Balustrade Spy', 'Blessed Alliance', 'Expedition Map', 'Faerie Vandal', 'Kodama''s Reach', 'Phyrexian Tyranny', 'Vendetta', 'Mesmeric Fiend', 'Oona''s Prowler', 'Zhalfirin Void', 'Approach of the Second Sun', 'Phalanx Leader', 'Trespasser''s Curse', 'Dimir Charm', 'Astral Slide', 'Cursecatcher', 'Death Baron', 'Rosheen Meanderer', 'First-Sphere Gargantua', 'Rhys the Redeemed', 'Howltooth Hollow', 'Light of Promise', 'Falkenrath Gorger', 'Throne of the God-Pharaoh', 'Soldier of the Pantheon', 'Curious Obsession', 'Helm of the Gods', 'Skull Fracture', 'Drag to the Underworld', 'Selvala, Explorer Returned', 'Falkenrath Aristocrat', 'Tendrils of Agony', 'Driven // Despair', 'Zur''s Weirding', 'Renata, Called to the Hunt', 'Destroy the Evidence', 'Kamahl''s Druidic Vow', 'Zenith Flare', 'Birds of Paradise', 'Witch''s Oven', 'Blossoming Sands', 'Wayfaring Temple', 'Cranial Plating', 'Precursor Golem', 'Kefnet the Mindful', 'Boros Reckoner', 'Fetid Heath', 'Spirit Mantle', 'Deathless Knight', 'Lochmere Serpent', 'Chain Lightning', 'Pelakka Predation', 'Haunted Dead', 'Nahiri, Storm of Stone', 'Sentinel''s Eyes', 'Chandra''s Phoenix', 'Fissure Wizard', 'Incinerate', 'Seaside Citadel', 'Hellrider', 'Etched Champion', 'Artificer''s Assistant', 'Vivien''s Arkbow', 'Marauding Blight-Priest', 'Jeskai Ascendancy', 'Stonehewer Giant', 'Savage Lands', 'Buried Alive', 'Cultivate', 'Jackal Pup', 'Concerted Defense', 'Bronzehide Lion', 'Springleaf Drum', 'Gray Merchant of Asphodel', 'Vraska''s Contempt', 'Bump in the Night', 'Llanowar Elves', 'Aphemia, the Cacophony', 'Haktos the Unscarred', 'Skirsdag High Priest', 'Forgotten Cave', 'Temple of Malice', 'Insolent Neonate', 'Kor Skyfisher', 'Ayli, Eternal Pilgrim', 'Dwynen''s Elite', 'Torment of Scarabs', 'Winding Way', 'Tajic, Legion''s Edge', 'Cursed Scroll', 'Field of Ruin', 'Heliod''s Pilgrim', 'Tranquil Cove', 'Toolcraft Exemplar', 'Helm of the Host', 'Forked Bolt', 'Magmatic Sinkhole', 'Khalni Ambush', 'Vivid Creek', 'Gavony Township', 'Tidehollow Sculler', 'Goblin Dark-Dwellers', 'Akoum Hellhound', 'Wurm''s Tooth', 'Angel of Glory''s Rise', 'Doomed Traveler', 'Alms of the Vein', 'Drownyard Temple', 'Golgari Findbroker', 'Cartouche of Solidarity', 'Mire''s Toll', 'Mina and Denn, Wildborn', 'Frantic Search', 'Ajani''s Pridemate', 'Sprite Dragon', 'Ransack the Lab', 'Cabal Ritual', 'Animate Dead', 'Sky Skiff', 'Endless Horizons', 'Sangromancer', 'Liliana''s Triumph', 'Dryad Militant', 'Omen of the Hunt', 'Ebony Owl Netsuke', 'Kjeldoran Outpost', 'Ruric Thar, the Unbowed', 'Llanowar Mentor', 'Thraben Inspector', 'Endbringer', 'Wild Mongrel', 'Mistveil Plains', 'Skymarcher Aspirant', 'Flood Plain', 'Phoenix of Ash', 'Shriekhorn', 'Ivory Tower', 'Arcbound Worker', 'Walk the Aeons', 'Omen of the Forge', 'Sylvan Scrying', 'Nihil Spellbomb', 'Quirion Dryad', 'Charge', 'Bazaar Trademage', 'Nightsky Mimic', 'Kor Cartographer', 'Cemetery Reaper', 'Mindcrank', 'Toil // Trouble', 'Dread Return', 'Vapor Snag', 'Tomb of Urami', 'Stubborn Denial', 'Summer Bloom', 'Coiling Oracle', 'Elvish Visionary', 'Dragon Fodder', 'Divinity of Pride', 'Scrabbling Claws', 'Cling to Dust', 'Ranger of Eos', 'Stave Off', 'Negate', 'Blasphemous Act', 'Neutralize', 'Chandra, Pyromaster', 'Kathari Remnant', 'Barbarian Ring', 'Goblin Matron', 'Chandra''s Spitfire', 'Mire Triton', 'Reanimate', 'Tyrant''s Choice', 'Wretched Banquet', 'Frontier Bivouac', 'Revel in Riches', 'Kederekt Parasite', 'Rampant Growth', 'Fiery Temper', 'Fact or Fiction', 'Sandsteppe Citadel', 'Might of the Masses', 'Underworld Connections', 'Nim Deathmantle', 'Crackling Drake', 'Primal Amulet', 'Benevolent Bodyguard', 'Sunscour', 'Trygon Predator', 'Legion Angel', 'Fire-Lit Thicket', 'Augur of Bolas', 'Pieces of the Puzzle', 'Stormblood Berserker', 'Cathartic Reunion', 'Vedalken Certarch', 'Silvergill Adept', 'Bala Ged Recovery', 'Clutch of the Undercity', 'Kor Outfitter', 'Sylvan Library', 'Galvanic Blast', 'Thornwood Falls', 'Gideon Jura', 'Bygone Bishop', 'Seeker of the Way', 'Curse of Death''s Hold', 'Skirk Prospector', 'Goblin Assault', 'Thief of Sanity', 'Darkblast', 'Mystic Sanctuary', 'Yahenni''s Expertise', 'Ultimate Price', 'Wipe Away', 'Akroan Skyguard', 'Jace Beleren', 'Precinct Captain', 'Nearheath Pilgrim', 'Archpriest of Iona', 'Searing Spear', 'Luminarch Ascension', 'Masked Admirers', 'Glissa Sunseeker', 'Village Messenger', 'Throes of Chaos', 'Cloudpost', 'Darksteel Citadel', 'Lazotep Reaver', 'Gideon''s Intervention', 'Ovalchase Daredevil', 'Call the Bloodline', 'Grave Scrabbler', 'Groundskeeper', 'Condemn', 'Dusk // Dawn', 'Desecration Demon', 'Orzhov Signet', 'Captain''s Claws', 'Mind Rake', 'Lotleth Troll', 'Frogmite', 'Outflank', 'Spell Pierce', 'Gigadrowse', 'Glory-Bound Initiate', 'Sarcomancy', 'Tempered Steel', 'Priest of Urabrask', 'Vivid Marsh', 'Dark Prophecy', 'Frantic Inventory', 'Ancient Stirrings', 'Dovin''s Veto', 'Kitesail Freebooter', 'Go for the Throat', 'Stinkweed Imp', 'Call of the Death-Dweller', 'Decree of Justice', 'Firebolt', 'Forbidden Alchemy', 'Underworld Dreams', 'Beckon Apparition', 'Shizo, Death''s Storehouse', 'Putrid Imp', 'Buried Ruin', 'Liliana''s Caress', 'Pore Over the Pages', 'Syr Faren, the Hengehammer', 'Explore', 'Stuffy Doll', 'Deftblade Elite', 'Dreamstealer', 'Diregraf Ghoul', 'Temple of Silence', 'Bile Blight', 'Rakdos Signet', 'Dismal Backwater', 'Genesis', 'Temple of Malady', 'Flaxen Intruder', 'Cyclops of Eternal Fury', 'Mana Leak', 'Twinflame', 'Ponder', 'Deeproot Champion', 'Truefire Captain', 'Student of Warfare', 'Dimir Aqueduct', 'Transcendent Envoy', 'Plow Under', 'Prophet of Kruphix', 'Porcelain Legionnaire', 'Deep Forest Hermit', 'Grapeshot', 'Lodestone Golem', 'Stupor', 'Protean Hulk', 'Flayer Husk', 'Invoke the Firemind', 'Blackblade Reforged', 'Judge''s Familiar', 'Nether Traitor', 'Duress', 'Feed the Swarm', 'Cloudstone Curio', 'Nomad Outpost', 'Ulamog''s Crusher', 'Linvala, Shield of Sea Gate', 'Dovin, Hand of Control', 'Temple of Triumph', 'Titanoth Rex', 'Assault // Battery', 'Benalish Marshal', 'Izzet Boilerworks', 'Hypnotic Sprite', 'Crib Swap', 'Honor of the Pure', 'Memnarch', 'Banefire', 'Magus of the Candelabra', 'Bond of Flourishing', 'Ruin Crab', 'Giant Killer', 'Carnophage', 'Wooded Bastion', 'Earthshaker Khenra', 'Cloudcrest Lake', 'Mogg War Marshal', 'Pillage', 'Master of the Pearl Trident', 'Treacherous Blessing', 'Basking Rootwalla', 'Selfless Savior', 'Rakdos Cackler', 'Animist''s Awakening', 'Vivid Meadow', 'Welding Jar', 'Ghostly Flicker', 'Undead Augur', 'Umbra Mystic', 'Advent of the Wurm', 'Thrill of Possibility', 'Asylum Visitor', 'Boros Garrison', 'Divest', 'Fireblade Charger', 'Cauldron Familiar', 'Archfiend of Ifnir', 'Lavaclaw Reaches', 'Goblin Gaveleer', 'Metallic Rebuke', 'Mystic Gate', 'Faith''s Fetters', 'Hero of Iroas', 'Cruel Bargain', 'Akiri, Fearless Voyager', 'Mothdust Changeling', 'Kiora''s Follower', 'Dictate of Kruphix', 'Neoform', 'Healing Hands', 'Sparkmage Apprentice', 'Signal Pest', 'Wildborn Preserver', 'Predator''s Gambit', 'Bonesplitter', 'Read the Bones', 'Ghostfire Blade', 'Magister Sphinx', 'Tolsimir, Friend to Wolves', 'Glass of the Guildpact', 'Tymaret, Chosen from Death', 'Slagstorm', 'Gingerbrute', 'Imaginary Pet', 'Generator Servant', 'Opt', 'Duskmantle Guildmage', 'Scoured Barrens', 'Esper Charm', 'Intangible Virtue', 'Pharika''s Spawn', 'Sylvan Messenger', 'Call of the Conclave', 'Conflagrate', 'The Antiquities War', 'Griffin Aerie', 'Nimble Trapfinder', 'Man-o''-War', 'Crumbling Necropolis', 'Terramorphic Expanse', 'Demonic Dread', 'Flame Jab', 'Arcane Sanctum', 'Dwynen, Gilt-Leaf Daen', 'Elves of Deep Shadow', 'Lava Dart', 'Universal Automaton', 'Legacy Weapon', 'Deep Analysis', 'Mnemonic Wall', 'Lead the Stampede', 'Splinter', 'Gitaxian Probe', 'Golgari Rot Farm', 'Steel Hellkite', 'Burst Lightning', 'Spark Spray', 'Sign in Blood', 'Acidic Slime', 'Burning Inquiry', 'Rune Snag', 'Reassembling Skeleton', 'Orzhov Basilica', 'Mystic Archaeologist', 'Mire''s Grasp', 'Armadillo Cloak', 'Improbable Alliance', 'Fyndhorn Elves', 'Ghitu Encampment', 'Ritual of Rejuvenation', 'Boros Elite', 'Urza''s Factory', 'Revitalize', 'Hypnotic Specter', 'Runed Halo', 'Dead Weight', 'Mortarpod', 'Wind-Scarred Crag', 'Nimbus Maze', 'Oblivion Ring', 'Ensoul Artifact', 'Grasslands', 'Drannith Healer', 'Spikefield Hazard', 'Varchild''s War-Riders', 'Astral Drift', 'Curiosity', 'Servo Exhibition', 'Traxos, Scourge of Kroog', 'Loxodon Smiter', 'Elvish Archdruid', 'Weapons Trainer', 'Charnel Troll', 'Swift Justice', 'Apostle''s Blessing', 'Tranquil Thicket', 'Blackbloom Rogue', 'Dauntless Escort', 'Kiora, Behemoth Beckoner', 'Agonizing Remorse', 'Woodland Wanderer', 'Wandering Fumarole', 'Inscription of Ruin', 'Zektar Shrine Expedition', 'Quest for the Nihil Stone', 'Murderous Redcap', 'Marwyn, the Nurturer', 'Setessan Training'))) AND (TRUE)
GROUP BY
d.id,
d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
HAVING
TRUE
ORDER BY
active_date DESC, d.finish IS NULL, d.finish
```
[]
(slow_query, 224.6, mysql)
Reported on decksite by mysql-perf
Location Hash: b29c1931f05797b8c1fceb71e506a56b639183e5
Labels: decksite
Exceeded slow_query limit (68.9 > 30.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
(
SELECT
`start`.id,
`start`.code,
`start`.start_date AS start_date,
`end`.start_date AS end_date
FROM
season AS `start`
LEFT JOIN
season AS `end` ON `end`.id = `start`.id + 1
) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)
WHERE
(d.id IN (SELECT deck_id FROM deck_card WHERE card IN ('Decree of Justice', 'Seasoned Hallowblade', 'Lightning Rift', 'Silvergill Adept', 'Beckon Apparition', 'Universal Automaton', 'Falkenrath Aristocrat', 'Dark Prophecy', 'Master of the Pearl Trident', 'Secluded Steppe', 'Goblin Matron', 'Nomad Outpost', 'Arcane Sanctum', 'Goblin Dark-Dwellers', 'Merrow Reejerey', 'Sparkmage Apprentice', 'Encroaching Wastes', 'Cathartic Reunion', 'Kor Skyfisher', 'Copperhorn Scout', 'Endless Horizons', 'Quest for the Nihil Stone', 'Tranquil Thicket', 'Mother Bear', 'Akroan Skyguard', 'Lightning Greaves', 'Tymaret Calls the Dead', 'Scoured Barrens', 'Kemba, Kha Regent', 'Fling', 'Keep Safe', 'Planar Outburst', 'Stormblood Berserker', 'Marwyn, the Nurturer', 'Assault // Battery', 'Imperious Perfect', 'Heliod''s Pilgrim', 'Sphinx''s Tutelage', 'Ajani Goldmane', 'Stromkirk Noble', 'Zhalfirin Void', 'Winding Way', 'River of Tears', 'Champion of the Flame', 'Clackbridge Troll', 'Deftblade Elite', 'Bag of Holding', 'Duress', 'Skymarcher Aspirant', 'Flayer Husk', 'Defiant Strike', 'Sylvan Messenger', 'Burst Lightning', 'Predator''s Gambit', 'Pyroclasm', 'Gavony Township', 'Zenith Flare', 'Divinity of Pride', 'Psychic Spiral', 'Blightning', 'Forked Bolt', 'Artificer''s Assistant', 'Read the Bones', 'Thornling', 'Outflank', 'Justice Strike', 'Bant Panorama', 'Hypergenesis', 'Doomed Traveler', 'Judith, the Scourge Diva', 'Sylvan Scrying', 'Selfless Savior', 'Base Camp', 'Soldier of the Pantheon', 'Mystic Archaeologist', 'Piracy Charm', 'Bonesplitter', 'Call the Bloodline', 'Worldgorger Dragon', 'Bronzehide Lion', 'Ivory Tower', 'Faerie Vandal', 'Clutch of the Undercity', 'Yahenni''s Expertise', 'Negate', 'Bala Ged Recovery', 'Truefire Captain', 'Drown in the Loch', 'Primal Amulet', 'Duskmantle Guildmage', 'Skirk Prospector', 'Skull Fracture', 'Tectonic Giant', 'Flaxen Intruder', 'Mist-Cloaked Herald', 'Castigate', 'Alseid of Life''s Bounty', 'Imposing Sovereign', 'Ayli, Eternal Pilgrim', 'Where Ancients Tread', 'Boros Reckoner', 'Ethereal Armor', 'Weapons Trainer', 'Skyclave Cleric', 'Dream Trawler', 'Swift Justice', 'Teferi''s Tutelage', 'Etched Champion', 'Alirios, Enraptured', 'Death Cloud', 'Bogardan Hellkite', 'Bloodthrone Vampire', 'Kargan Intimidator', 'Gatekeeper of Malakir', 'Explore', 'Treacherous Blessing', 'Silence', 'Chain Lightning', 'Gruul Turf', 'Hunted Phantasm', 'Wretched Banquet', 'Thraben Inspector', 'Tectonic Edge', 'Stonehewer Giant', 'Weatherlight', 'Vivien''s Arkbow', 'Runeflare Trap', 'Cloudpost', 'Torch Courier', 'Linvala, Shield of Sea Gate', 'Tranquil Cove', 'Davriel, Rogue Shadowmage', 'Reassembling Skeleton', 'Ghostfire Blade', 'Graven Cairns', 'Battle Hymn', 'Magister Sphinx', 'Renewed Faith', 'Archfiend of Ifnir', 'Triplicate Spirits', 'Kodama''s Reach', 'Kiora''s Follower', 'Ondu Inversion', 'Heartbeat of Spring', 'Mire Triton', 'Mythos of Nethroi', 'Reanimate', 'Shredded Sails', 'Coralhelm Commander', 'Mystic Sanctuary', 'Hypnotic Specter', 'Gitaxian Probe', 'Legacy Weapon', 'Pharika''s Libation', 'Trail of Crumbs', 'Liliana''s Triumph', 'Staff of Domination', 'Barbarian Ring', 'Woodland Wanderer', 'Swiftwater Cliffs', 'Nearheath Pilgrim', 'Titanoth Rex', 'Sire of Insanity', 'Duskwatch Recruiter', 'Legion Angel', 'Coiling Oracle', 'Temple of Malice', 'Vivid Grove', 'Blossoming Sands', 'The Flame of Keld', 'Orzhov Basilica', 'Lava Dart', 'Prophetic Prism', 'Wayfaring Temple', 'Protean Hulk', 'Mystic Monastery', 'Grove of the Guardian', 'Darksteel Citadel', 'Glissa Sunseeker', 'Throne of the God-Pharaoh', 'Carnophage', 'Orzhov Signet', 'Boomerang', 'Favored Hoplite', 'Monastery Siege', 'Dryad Militant', 'Boros Elite', 'Cauldron Familiar', 'Guilty Conscience', 'Deep Forest Hermit', 'Advent of the Wurm', 'Ranger of Eos', 'Murderous Redcap', 'Kjeldoran Outpost', 'Electrolyze', 'Sheltering Light', 'Dimir Aqueduct', 'Shrieking Affliction', 'Goreclaw, Terror of Qal Sisma', 'Turnabout', 'Brushfire Elemental', 'Vampire Lacerator', 'Bad River', 'Incinerate', 'Volcano Hellion', 'Cemetery Reaper', 'Alms of the Vein', 'Bygone Bishop', 'Setessan Petitioner', 'Call of the Death-Dweller', 'Temple of Mystery', 'Fanatical Firebrand', 'Buried Ruin', 'Liliana''s Caress', 'Sprite Dragon', 'Liquimetal Coating', 'Silversmote Ghoul', 'Chandra, Pyromaster', 'Nimble Trapfinder', 'Birds of Paradise', 'Ancient Stirrings', 'Champion of Wits', 'Savage Lands', 'Jackal Pup', 'Treasure Cruise', 'Mayhem Devil', 'Shinka, the Bloodsoaked Keep', 'Mothdust Changeling', 'Grizzly Fate', 'Setessan Training', 'Drag to the Underworld', 'Thermo-Alchemist', 'Intangible Virtue', 'Deeproot Champion', 'Insolent Neonate', 'Vampire Nighthawk', 'Dusk Legion Zealot', 'Emerge Unscathed', 'Dictate of Kruphix', 'Transcendent Envoy', 'Trygon Predator', 'Tradewind Rider', 'Crumbling Necropolis', 'Ethersworn Canonist', 'Frontier Bivouac', 'Tragic Lesson', 'Cling to Dust', 'Radiant Flames', 'Ruric Thar, the Unbowed', 'Lantern-Lit Graveyard', 'Cut // Ribbons', 'Gideon Jura', 'Memnarch', 'Curiosity', 'Asylum Visitor', 'Fire-Lit Thicket', 'Kambal, Consul of Allocation', 'Mishra''s Factory', 'Go for the Throat', 'Urza''s Ruinous Blast', 'Izzet Boilerworks', 'Stonehorn Dignitary', 'Vivid Creek', 'Frogmite', 'Thornwood Falls', 'Ritual of Rejuvenation', 'Sky Skiff', 'Dismal Backwater', 'Hypnotic Sprite', 'Curse of Death''s Hold', 'Servo Exhibition', 'Goblin Banneret', 'Ajani''s Pridemate', 'Glass of the Guildpact', 'Frantic Search', 'Helm of the Host', 'Vraska''s Contempt', 'Jwari Disruption', 'Village Rites', 'Hellrider', 'Improbable Alliance', 'Myr Landshaper', 'Laboratory Maniac', 'Noose Constrictor', 'Lodestone Golem', 'Omen of the Hunt', 'Zektar Shrine Expedition', 'Anax, Hardened in the Forge', 'Reki, the History of Kamigawa', 'Garruk Wildspeaker', 'Abzan Charm', 'Charnel Troll', 'Viscera Seer', 'Rune Snag', 'Akoum Hellhound', 'Reclamation Sage', 'Concerted Defense', 'Selvala, Explorer Returned', 'Groundskeeper', 'Zur''s Weirding', 'Lazotep Reaver', 'Syr Konrad, the Grim', 'Malakir Rebirth', 'Fevered Visions', 'Ornithopter', 'Underworld Dreams', 'Acidic Slime', 'Suture Priest', 'Diregraf Ghoul', 'Fatestitcher', 'Cursed Scroll', 'Phylath, World Sculptor', 'Magus of the Candelabra', 'Knight of New Alara', 'Pillage', 'Syr Faren, the Hengehammer', 'Rootborn Defenses', 'Griffin Aerie', 'Springleaf Drum', 'Fiend Hunter', 'Walk the Aeons', 'Mindcrank', 'Khalni Ambush', 'Sarcomancy', 'Cranial Plating', 'Cartouche of Solidarity', 'Dusk // Dawn', 'Renata, Called to the Hunt', 'Kataki, War''s Wage', 'Glory-Bound Initiate', 'Angrath''s Rampage', 'Spikefield Hazard', 'Condemn', 'Elvish Archdruid', 'Priest of Urabrask', 'Pore Over the Pages', 'Seeker of the Way', 'Scrabbling Claws', 'Kitesail Freebooter', 'Kederekt Parasite', 'Fiery Temper', 'Stubborn Denial', 'Blessed Alliance', 'Metallic Rebuke', 'Blackbloom Rogue', 'Seaside Citadel', 'Spoils of Adventure', 'Shelter', 'Call of the Conclave', 'Deathless Knight', 'Blasphemous Act', 'Slagstorm', 'Cliffhaven Kitesail', 'Hero of Iroas', 'Lead the Stampede', 'Village Messenger', 'Demonic Dread', 'Rakdos Cackler', 'Transcendent Master', 'Destroy the Evidence', 'Archaeomancer', 'Phalanx Leader', 'Unsubstantiate', 'Lys Alana Huntmaster', 'Giant Killer', 'Wandering Fumarole', 'Orzhov Charm', 'Student of Warfare', 'Kefnet the Mindful', 'Easy Prey', 'Chief of the Foundry', 'Viashino Pyromancer', 'Smallpox', 'Lochmere Serpent', 'Captain''s Claws', 'Idol of Endurance', 'Golgari Findbroker', 'Man-o''-War', 'Brineborn Cutthroat', 'Arcbound Worker', 'Lavaclaw Reaches', 'Expedition Map', 'Lone Rider', 'Pathrazer of Ulamog', 'Tyrant''s Choice', 'Wildborn Preserver', 'Deep Analysis', 'Claim the Firstborn', 'Drannith Healer', 'Forgotten Cave', 'Eternal Dragon', 'Gryff''s Boon', 'Khalni Garden', 'Dive Down', 'Mortarpod', 'Cursecatcher', 'Nip Gwyllion', 'Neoform', 'Grand Architect', 'Balustrade Spy', 'Orim''s Chant', 'Inscription of Ruin', 'Edge of the Divinity', 'Temple of Malady', 'Jeskai Ascendancy', 'Tangled Florahedron', 'Dwynen''s Elite', 'Basking Rootwalla', 'Kamahl''s Druidic Vow', 'Vapor Snag', 'Kabira Takedown', 'Plow Under', 'Growth-Chamber Guardian', 'Shizo, Death''s Storehouse', 'Evolving Wilds', 'Boros Garrison', 'Brave the Elements', 'Traxos, Scourge of Kroog', 'Porcelain Legionnaire', 'Vedalken Certarch', 'Loxodon Smiter', 'Dovin, Hand of Control', 'Scion of Vitu-Ghazi', 'Prophet of Kruphix', 'Precinct Captain', 'Azami, Lady of Scrolls', 'Twinflame', 'Darkblast', 'Etherium Sculptor', 'Azorius Charm', 'Sunscour', 'Drownyard Temple', 'Endless Atlas', 'Gigadrowse', 'Brainstorm', 'Nullmage Shepherd', 'Ghostly Flicker', 'Precursor Golem', 'Divest', 'Tempered Steel', 'Thrill of Possibility', 'Grave Scrabbler', 'Phyrexian Tyranny', 'Gingerbrute', 'The Antiquities War', 'Dark Withering', 'Sign in Blood', 'Invoke the Firemind', 'Crib Swap', 'Ponder', 'Magmatic Sinkhole', 'Pelakka Predation', 'Splinter', 'Ulamog''s Crusher', 'Calciform Pools', 'Nahiri, Storm of Stone', 'Browbeat', 'Imposing Vantasaur', 'Rakdos Signet', 'Nyxathid', 'Dragon Fodder', 'Driven // Despair', 'Nihil Spellbomb', 'Aphemia, the Cacophony', 'Rugged Highlands', 'Generator Servant', 'Sejiri Shelter', 'Muddle the Mixture', 'Think Twice', 'Nimbus Maze', 'Llanowar Visionary', 'Exhaustion', 'Cloudstone Curio', 'Mwonvuli Acid-Moss', 'Rampant Growth', 'Bloodfell Caves', 'Izzet Charm', 'Cavalcade of Calamity', 'First-Sphere Gargantua', 'Migration Path', 'Banefire', 'Tajic, Legion''s Edge', 'Omen of the Forge', 'Signal Pest', 'Temple of Silence', 'Burning Inquiry', 'Forbidden Alchemy', 'Drana''s Emissary', 'Mnemonic Wall', 'Illness in the Ranks', 'Discovery // Dispersal', 'Scavenged Blade', 'Ash Zealot', 'Firedrinker Satyr', 'Strategic Planning', 'Blood Seeker', 'Shalai, Voice of Plenty', 'Displace', 'Liliana''s Reaver', 'Ostracize', 'Luminarch Ascension', 'Genesis', 'Astral Slide', 'Dynavolt Tower', 'Stone Haven Outfitter', 'Tolsimir, Friend to Wolves', 'Fissure Wizard', 'Scepter of Fugue', 'Delver of Secrets', 'Deprive', 'Tendrils of Agony', 'Desecrated Tomb', 'Evolutionary Leap', 'Sangromancer', 'Dimir Charm', 'Oust', 'Forbid', 'Drannith Stinger', 'Augur of Bolas', 'Mire''s Toll', 'Mistveil Plains', 'Melira, Sylvok Outcast', 'Nim Deathmantle', 'Dark Ritual', 'Selesnya Charm', 'Vault of Whispers', 'Ayula, Queen Among Bears', 'Crumbling Vestige', 'Heartless Act', 'Temple of Triumph', 'Phoenix of Ash', 'Blackblade Reforged', 'Undead Augur', 'Zada, Hedron Grinder', 'Animate Dead', 'Llanowar Mentor', 'Akiri, Fearless Voyager', 'Ovalchase Daredevil', 'Gods Willing', 'Fight with Fire', 'Mesmeric Fiend', 'Spark Spray', 'Saproling Burst', 'Vivid Marsh', 'Porphyry Nodes', 'Flame Jab', 'Disfigure', 'Igneous Pouncer', 'Wooded Bastion', 'Revitalize', 'Foreboding Fruit', 'Spiteful Visions', 'Opt', 'Stinkweed Imp', 'Benevolent Bodyguard', 'Kor Outfitter', 'Mystic Gate', 'Master of Etherium', 'Crimson Wisps', 'Day of Judgment', 'Ruin Crab', 'Haunted Dead', 'Ghitu Encampment', 'Rhys the Redeemed', 'Elvish Visionary', 'Flourishing Fox', 'Faith''s Fetters', 'Fact or Fiction', 'Obsessive Search', 'Vivid Meadow', 'Quirion Dryad', 'Gideon''s Intervention', 'Daxos, Blessed by the Sun', 'Glimmerpost', 'Kazuul''s Fury', 'Satyr Wayfinder', 'Dead Weight', 'Bloodhall Priest', 'Zombie Infestation', 'Terramorphic Expanse', 'Firebolt', 'Fleecemane Lion', 'Valiant Rescuer', 'Vendetta', 'Pieces of the Puzzle', 'Survival Cache', 'Jungle Hollow', 'Hunted Nightmare', 'Torment of Scarabs', 'Llanowar Elves', 'Trespasser''s Curse', 'Fetid Heath', 'Dreamstealer', 'Kathari Remnant', 'Bazaar Trademage', 'Searing Spear', 'Vanguard of Brimaz', 'Creeping Chill', 'Primal Command', 'Cabal Ritual', 'Nightsky Mimic', 'Wirewood Hivemaster', 'Marauding Blight-Priest', 'Curious Obsession', 'Armadillo Cloak', 'Squee, Goblin Nabob', 'Broodmate Dragon', 'Beanstalk Giant', 'Light of Promise', 'Galvanic Blast', 'Silundi Vision', 'Astral Drift', 'Gray Merchant of Asphodel', 'Elves of Deep Shadow', 'Grasslands', 'Fertile Thicket', 'Laquatus''s Champion', 'Master of the Feast', 'Bile Blight', 'Witch''s Oven', 'Cruel Bargain', 'Tidehollow Sculler', 'Field of Ruin', 'Geth''s Grimoire', 'Cloudcrest Lake', 'Putrid Imp', 'Reap the Past', 'Elvish Mystic', 'Hymn to Tourach', 'Jace Beleren', 'Titan''s Strength', 'Witch''s Cottage', 'Bump in the Night', 'Animist''s Awakening', 'Oblivion Ring', 'Flood Plain', 'Toolcraft Exemplar', 'Psychic Strike', 'Apostle''s Blessing', 'Benalish Marshal', 'Hateful Eidolon', 'Shriekhorn', 'Expedite', 'Stupor', 'Kessig Wolf Run', 'Cyclops of Eternal Fury', 'Runed Halo', 'Tombstalker', 'Krenko''s Command', 'Esper Charm', 'Honor of the Pure', 'Helm of the Gods', 'Shock', 'Goblin Gaveleer', 'Arrogant Wurm', 'Mind Rake', 'Bond of Flourishing', 'Temur Ascendancy', 'Underworld Connections', 'Prison Realm', 'Charge', 'Kari Zev, Skyship Raider', 'Sinister Sabotage', 'Tomb of Urami', 'Tymaret, Chosen from Death', 'Dread Return', 'Selesnya Sanctuary', 'Grim Lavamancer', 'Tajuru Paragon', 'Jaddi Offshoot', 'Mogg War Marshal', 'Fyndhorn Elves', 'Mire''s Grasp', 'Buried Alive', 'Urza''s Factory', 'Veteran Adventurer', 'Phyrexian Dreadnought', 'Court Homunculus', 'Sylvan Library', 'Desperate Ravings', 'Mystifying Maze', 'Stave Off', 'Judge''s Familiar', 'Approach of the Second Sun', 'Pharika''s Spawn', 'Conflagrate', 'Dowsing Dagger', 'Mastermind''s Acquisition', 'Merfolk Sovereign', 'Chandra''s Spitfire', 'Dwynen, Gilt-Leaf Daen', 'Welding Jar', 'Varchild''s War-Riders', 'Golgari Grave-Troll', 'Hyena Umbra', 'Might of the Masses', 'Summer Bloom', 'Ebony Owl Netsuke', 'Repeal', 'Spell Pierce', 'Wistful Thinking', 'Vesperlark', 'Toil // Trouble', 'Go for Blood', 'Soul''s Attendant', 'Progenitor Mimic', 'Magus of the Bazaar', 'Ransack the Lab', 'Revel in Riches', 'Wind-Scarred Crag', 'Fumigate', 'Umbra Mystic', 'Artisan of Kozilek', 'Wild Mongrel', 'Angel of Glory''s Rise', 'Neutralize', 'Collective Defiance', 'Crackling Drake', 'Ayula''s Influence', 'Avacyn''s Pilgrim', 'Safehold Elite', 'Lotleth Troll', 'Varolz, the Scar-Striped', 'Banishing Light', 'Chromatic Star', 'Ultimate Price', 'Archpriest of Iona', 'Agonizing Remorse', 'Wurm''s Tooth', 'Death Baron', 'Dauntless Escort', 'Sentinel''s Eyes', 'Talisman of Conviction', 'Spirit Mantle', 'Boros Challenger', 'Masked Admirers', 'Vindicate', 'Earthshaker Khenra', 'Trade Routes', 'Kiora, Behemoth Beckoner', 'Tribal Forcemage', 'Rosheen Meanderer', 'Mimic Vat', 'Stuffy Doll', 'Throes of Chaos', 'Haktos the Unscarred', 'Grafted Wargear', 'Goblin Assault', 'Nether Traitor', 'Mana Flare', 'Chandra''s Pyreling', 'Imaginary Pet', 'Squadron Hawk', 'Desecration Demon', 'Cultivate', 'Nezumi Shortfang', 'Sandsteppe Citadel', 'Thief of Sanity', 'Frantic Inventory', 'Yasharn, Implacable Earth', 'Smiting Helix', 'End-Raze Forerunners', 'Howltooth Hollow', 'Karametra''s Blessing', 'All That Glitters', 'Lonely Sandbar', 'Oona''s Prowler', 'Feed the Swarm', 'Ensoul Artifact', 'Staff of Nin', 'Golgari Rot Farm', 'Jace''s Archivist', 'Stormfist Crusader', 'War Falcon', 'Mogis''s Marauder', 'Navigator''s Compass', 'Falkenrath Gorger', 'Steel Hellkite', 'Howling Mine', 'Footfall Crater', 'Rugged Prairie', 'Endbringer', 'Barren Moor', 'Mina and Denn, Wildborn', 'Arboreal Grazer', 'Mana Leak', 'Wipe Away', 'Healing Hands', 'Dovin''s Veto', 'Drake Haven', 'Fireblade Charger', 'Sunken Ruins', 'Chandra''s Phoenix', 'Grapeshot', 'Skirsdag High Priest', 'Kor Cartographer'))) AND (TRUE)
GROUP BY
d.id,
d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
HAVING
TRUE
ORDER BY
active_date DESC, d.finish IS NULL, d.finish
```
[]
(slow_query, 68.9, mysql)
Reported on decksite by mysql-perf
Location Hash: b29c1931f05797b8c1fceb71e506a56b639183e5
Labels: decksite
Exceeded slow_query limit (134.7 > 30.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
(
SELECT
`start`.id,
`start`.code,
`start`.start_date AS start_date,
`end`.start_date AS end_date
FROM
season AS `start`
LEFT JOIN
season AS `end` ON `end`.id = `start`.id + 1
) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)
WHERE
(d.id IN (SELECT deck_id FROM deck_card WHERE card IN ('Volcano Hellion', 'Tragic Lesson', 'Heartless Act', 'Vivid Creek', 'Thrill of Possibility', 'Hellrider', 'Mimic Vat', 'Goreclaw, Terror of Qal Sisma', 'Grim Lavamancer', 'Master of Etherium', 'Village Messenger', 'Condemn', 'Genesis', 'Kabira Takedown', 'Crib Swap', 'Nearheath Pilgrim', 'Intangible Virtue', 'Dread Return', 'Mnemonic Wall', 'Kor Outfitter', 'Captain''s Claws', 'Call of the Conclave', 'Revitalize', 'Wurm''s Tooth', 'Transcendent Envoy', 'Arrogant Wurm', 'Firebolt', 'Shrieking Affliction', 'Sangromancer', 'Imposing Vantasaur', 'Diregraf Ghoul', 'Alirios, Enraptured', 'Laquatus''s Champion', 'Acidic Slime', 'Squadron Hawk', 'Grapeshot', 'Flaxen Intruder', 'Wipe Away', 'Village Rites', 'Seasoned Hallowblade', 'Prison Realm', 'Pyroclasm', 'Nim Deathmantle', 'Brineborn Cutthroat', 'Call the Bloodline', 'Opt', 'Searing Spear', 'Sprite Dragon', 'Chief of the Foundry', 'Staff of Domination', 'Negate', 'Defiant Strike', 'Rakdos Cackler', 'Chandra, Pyromaster', 'Haktos the Unscarred', 'Torment of Scarabs', 'Sparkmage Apprentice', 'Jace Beleren', 'Wildborn Preserver', 'Navigator''s Compass', 'Glissa Sunseeker', 'Lone Rider', 'Broodmate Dragon', 'Cultivate', 'Stormfist Crusader', 'Helm of the Gods', 'Sentinel''s Eyes', 'Radiant Flames', 'Imperious Perfect', 'Squee, Goblin Nabob', 'Khalni Ambush', 'Banefire', 'Blackblade Reforged', 'Ensoul Artifact', 'Decree of Justice', 'Stupor', 'Renata, Called to the Hunt', 'Copperhorn Scout', 'Renewed Faith', 'Creeping Chill', 'Stave Off', 'Selvala, Explorer Returned', 'Liquimetal Coating', 'Drake Haven', 'Nimble Trapfinder', 'Archpriest of Iona', 'Pathrazer of Ulamog', 'Cauldron Familiar', 'Viashino Pyromancer', 'Honor of the Pure', 'Planar Outburst', 'Cyclops of Eternal Fury', 'Curious Obsession', 'Arcane Sanctum', 'Temple of Malice', 'Elvish Mystic', 'Heartbeat of Spring', 'Expedition Map', 'Psychic Spiral', 'Generator Servant', 'Blightning', 'Armadillo Cloak', 'Temple of Mystery', 'Signal Pest', 'Chandra''s Pyreling', 'Student of Warfare', 'Precursor Golem', 'Shizo, Death''s Storehouse', 'Merrow Reejerey', 'Fireblade Charger', 'Fumigate', 'Nihil Spellbomb', 'Dovin, Hand of Control', 'Fire-Lit Thicket', 'Cursed Scroll', 'Forbidden Alchemy', 'Witch''s Oven', 'Yasharn, Implacable Earth', 'Lightning Rift', 'Kazuul''s Fury', 'Throne of the God-Pharaoh', 'Birds of Paradise', 'Grasslands', 'Animate Dead', 'Griffin Aerie', 'Calciform Pools', 'Sarkhan, the Dragonspeaker', 'Ghitu Encampment', 'Memnarch', 'Base Camp', 'Ajani''s Pridemate', 'Galvanic Blast', 'Wooded Bastion', 'Duress', 'Soldier of the Pantheon', 'Cling to Dust', 'Fertile Thicket', 'Silence', 'Liliana''s Reaver', 'Mist-Cloaked Herald', 'Banishing Light', 'Idol of Endurance', 'Tajuru Paragon', 'Reki, the History of Kamigawa', 'Silundi Vision', 'Progenitor Mimic', 'Gideon''s Intervention', 'Nomad Outpost', 'Tempered Steel', 'Piracy Charm', 'Karametra''s Blessing', 'Safehold Elite', 'Reap the Past', 'Guilty Conscience', 'Chromatic Star', 'Desperate Ravings', 'Mire''s Grasp', 'Dive Down', 'Legion Angel', 'Dismal Backwater', 'Rugged Highlands', 'Tomb of Urami', 'Mina and Denn, Wildborn', 'Yahenni''s Expertise', 'Spell Pierce', 'Underworld Connections', 'Ethersworn Canonist', 'Golgari Rot Farm', 'Outflank', 'Swiftwater Cliffs', 'Marwyn, the Nurturer', 'Golgari Grave-Troll', 'Read the Bones', 'Dimir Aqueduct', 'Akoum Hellhound', 'Archfiend of Ifnir', 'Umbra Mystic', 'Apostle''s Blessing', 'Winding Way', 'Conflagrate', 'Kjeldoran Outpost', 'Spirit Mantle', 'Urza''s Factory', 'Tranquil Thicket', 'Hunted Nightmare', 'Neutralize', 'Drownyard Temple', 'Woodland Wanderer', 'End-Raze Forerunners', 'Jaddi Offshoot', 'Fetid Heath', 'Kefnet the Mindful', 'Bronzehide Lion', 'Toolcraft Exemplar', 'Faerie Vandal', 'Servo Exhibition', 'Court Homunculus', 'Lonely Sandbar', 'Luminarch Ascension', 'Dwynen, Gilt-Leaf Daen', 'Divest', 'All That Glitters', 'Buried Alive', 'Golgari Findbroker', 'Akiri, Fearless Voyager', 'Smiting Helix', 'Jwari Disruption', 'Arbor Elf', 'Blasphemous Act', 'Quest for the Nihil Stone', 'Vanguard of Brimaz', 'Animist''s Awakening', 'Burning Inquiry', 'Clackbridge Troll', 'Champion of Wits', 'Gray Merchant of Asphodel', 'Migration Path', 'Hyena Umbra', 'Hypnotic Sprite', 'Transcendent Master', 'Oblivion Ring', 'Glass of the Guildpact', 'Drana''s Emissary', 'Grafted Wargear', 'Oona''s Prowler', 'Vivid Grove', 'Lodestone Golem', 'Boros Challenger', 'Wind-Scarred Crag', 'Gitaxian Probe', 'Chain Lightning', 'Cruel Bargain', 'Dragon Fodder', 'Suture Priest', 'Incinerate', 'Ghostly Flicker', 'Mother Bear', 'Selfless Savior', 'Agonizing Remorse', 'Kitesail Freebooter', 'Jace''s Archivist', 'Frontier Bivouac', 'Wistful Thinking', 'Deeproot Champion', 'Gavony Township', 'Truefire Captain', 'Gruul Turf', 'Browbeat', 'Gideon Jura', 'Bala Ged Recovery', 'Inscription of Ruin', 'Magus of the Candelabra', 'Kamahl''s Druidic Vow', 'Kemba, Kha Regent', 'Arcbound Worker', 'Lotleth Troll', 'Orzhov Basilica', 'Glimmerpost', 'Cabal Ritual', 'Springleaf Drum', 'Blessed Alliance', 'Repeal', 'Melira, Sylvok Outcast', 'Khalni Garden', 'Precinct Captain', 'Eternal Dragon', 'Satyr Wayfinder', 'Pore Over the Pages', 'Nimbus Maze', 'Zhalfirin Void', 'Ponder', 'Wretched Banquet', 'Zada, Hedron Grinder', 'Triplicate Spirits', 'Davriel, Rogue Shadowmage', 'Magmatic Sinkhole', 'Stubborn Denial', 'Fevered Visions', 'Ayula, Queen Among Bears', 'Desecration Demon', 'Nullmage Shepherd', 'Bloodthrone Vampire', 'Vivid Meadow', 'Tangled Florahedron', 'Runed Halo', 'Cavalcade of Calamity', 'Cut // Ribbons', 'Trade Routes', 'Vapor Snag', 'Fleecemane Lion', 'Lazotep Reaver', 'Angel of Glory''s Rise', 'Ayli, Eternal Pilgrim', 'Survival Cache', 'Orzhov Signet', 'Deep Analysis', 'Beanstalk Giant', 'Artificer''s Assistant', 'Darkblast', 'Sarcomancy', 'Coiling Oracle', 'Zenith Flare', 'Kessig Wolf Run', 'Dusk // Dawn', 'Aphemia, the Cacophony', 'Veteran Adventurer', 'Viscera Seer', 'Tribal Forcemage', 'River of Tears', 'Frogmite', 'Healing Hands', 'Fact or Fiction', 'Firedrinker Satyr', 'Primal Amulet', 'Endbringer', 'Electrolyze', 'Shriekhorn', 'Vraska''s Contempt', 'Omen of the Forge', 'Goblin Gaveleer', 'Lantern-Lit Graveyard', 'Liliana''s Caress', 'Bile Blight', 'Ondu Inversion', 'Skymarcher Aspirant', 'Urza''s Ruinous Blast', 'Monastery Siege', 'Predator''s Gambit', 'Encroaching Wastes', 'Loxodon Smiter', 'Thornling', 'Kiora, Behemoth Beckoner', 'Fatestitcher', 'Fissure Wizard', 'Sylvan Messenger', 'Boros Reckoner', 'Skull Fracture', 'Mythos of Nethroi', 'Dictate of Kruphix', 'Phylath, World Sculptor', 'Gryff''s Boon', 'Foreboding Fruit', 'Esper Charm', 'Drannith Healer', 'Call of the Death-Dweller', 'Sire of Insanity', 'Tajic, Legion''s Edge', 'Brainstorm', 'Doomed Traveler', 'Wirewood Hivemaster', 'Haunted Dead', 'Insolent Neonate', 'Carnophage', 'Shelter', 'Masked Admirers', 'Thornwood Falls', 'Jackal Pup', 'Battle Hymn', 'Astral Drift', 'Chandra''s Phoenix', 'Goblin Dark-Dwellers', 'Dark Prophecy', 'Fiend Hunter', 'Phoenix of Ash', 'Curiosity', 'Goblin Assault', 'Swift Justice', 'Trygon Predator', 'Titan''s Strength', 'Stinkweed Imp', 'Ultimate Price', 'Gods Willing', 'Tidehollow Sculler', 'Blossoming Sands', 'Summer Bloom', 'Izzet Charm', 'Prophet of Kruphix', 'Varchild''s War-Riders', 'Strategic Planning', 'Sejiri Shelter', 'Benalish Marshal', 'Dark Ritual', 'Crumbling Necropolis', 'Blood Seeker', 'Mana Flare', 'Gingerbrute', 'Etched Champion', 'Displace', 'Wild Mongrel', 'Nezumi Shortfang', 'Claim the Firstborn', 'Charge', 'Azami, Lady of Scrolls', 'Mystic Monastery', 'Fling', 'Forbid', 'Muddle the Mixture', 'Dowsing Dagger', 'Universal Automaton', 'Deathless Knight', 'Vampire Lacerator', 'Stromkirk Noble', 'Temple of Malady', 'Vampire Nighthawk', 'Advent of the Wurm', 'Kederekt Parasite', 'Ulamog''s Crusher', 'Teferi''s Tutelage', 'Cathartic Reunion', 'Putrid Imp', 'Footfall Crater', 'Walk the Aeons', 'Shock', 'Driven // Despair', 'Falkenrath Gorger', 'Noose Constrictor', 'Llanowar Visionary', 'Lavaclaw Reaches', 'Tradewind Rider', 'Desecrated Tomb', 'Abzan Charm', 'Ash Zealot', 'Demonic Dread', 'Falkenrath Aristocrat', 'Champion of the Flame', 'Weapons Trainer', 'Titanoth Rex', 'Dusk Legion Zealot', 'Mortarpod', 'Hunted Phantasm', 'Phyrexian Tyranny', 'Stone Haven Outfitter', 'Judith, the Scourge Diva', 'Syr Faren, the Hengehammer', 'Welding Jar', 'Benevolent Bodyguard', 'Hateful Eidolon', 'Marauding Blight-Priest', 'Etherium Sculptor', 'Shredded Sails', 'Treacherous Blessing', 'Rugged Prairie', 'Ethereal Armor', 'Grizzly Fate', 'Pieces of the Puzzle', 'Burst Lightning', 'First-Sphere Gargantua', 'Chandra''s Spitfire', 'Splinter', 'Turnabout', 'Prophetic Prism', 'Kor Cartographer', 'Concerted Defense', 'Thraben Inspector', 'Bad River', 'Tranquil Cove', 'Azorius Charm', 'Linvala, Shield of Sea Gate', 'Lightning Greaves', 'Skirk Prospector', 'Laboratory Maniac', 'Cursecatcher', 'Duskwatch Recruiter', 'Mistveil Plains', 'Dream Trawler', 'Brave the Elements', 'Imaginary Pet', 'Mothdust Changeling', 'Bond of Flourishing', 'Divinity of Pride', 'Setessan Petitioner', 'Exhaustion', 'Boros Garrison', 'Phyrexian Dreadnought', 'Scoured Barrens', 'Soul''s Attendant', 'Magister Sphinx', 'Kargan Intimidator', 'Master of the Feast', 'Worldgorger Dragon', 'Knight of New Alara', 'Jeskai Ascendancy', 'Frantic Search', 'Bloodfell Caves', 'Undead Augur', 'Neoform', 'Plow Under', 'Day of Judgment', 'Where Ancients Tread', 'Boros Elite', 'Charnel Troll', 'Field of Ruin', 'Disfigure', 'Unsubstantiate', 'Tectonic Edge', 'Crimson Wisps', 'Cloudstone Curio', 'Sunscour', 'Wayfaring Temple', 'Collective Defiance', 'Delver of Secrets', 'Scepter of Fugue', 'Mindcrank', 'Discovery // Dispersal', 'Ghostfire Blade', 'Dauntless Escort', 'Temur Ascendancy', 'Earthshaker Khenra', 'Seaside Citadel', 'Metallic Rebuke', 'Howling Mine', 'Dead Weight', 'Brushfire Elemental', 'Faith''s Fetters', 'Rakdos Signet', 'Sylvan Library', 'Grave Scrabbler', 'Orim''s Chant', 'Pharika''s Spawn', 'Obsessive Search', 'Ajani Goldmane', 'Kambal, Consul of Allocation', 'Kathari Remnant', 'Cranial Plating', 'Porphyry Nodes', 'Cloudcrest Lake', 'Arboreal Grazer', 'Mystic Sanctuary', 'Ivory Tower', 'Master of the Pearl Trident', 'Talisman of Conviction', 'Magus of the Bazaar', 'Groundskeeper', 'Revel in Riches', 'Mystic Archaeologist', 'Lys Alana Huntmaster', 'Murderous Redcap', 'Heliod''s Pilgrim', 'Shinka, the Bloodsoaked Keep', 'Merfolk Sovereign', 'Pillage', 'Mayhem Devil', 'Coralhelm Commander', 'Kiora''s Follower', 'Kataki, War''s Wage', 'Reanimate', 'Quirion Dryad', 'Cemetery Reaper', 'Terramorphic Expanse', 'Orzhov Charm', 'Stonehewer Giant', 'Improbable Alliance', 'Kodama''s Reach', 'Ritual of Rejuvenation', 'Scrabbling Claws', 'Sylvan Scrying', 'Trail of Crumbs', 'Fiery Temper', 'Zektar Shrine Expedition', 'Artisan of Kozilek', 'Protean Hulk', 'Temple of Triumph', 'Nahiri, Storm of Stone', 'Ransack the Lab', 'Curse of Death''s Hold', 'Hypergenesis', 'Mystifying Maze', 'Bazaar Trademage', 'Scion of Vitu-Ghazi', 'Castigate', 'Geth''s Grimoire', 'Nightsky Mimic', 'Dimir Charm', 'Torch Courier', 'Rootborn Defenses', 'Steel Hellkite', 'Boomerang', 'Beckon Apparition', 'Mogis''s Marauder', 'Elvish Visionary', 'Imposing Sovereign', 'Man-o''-War', 'Spoils of Adventure', 'Secluded Steppe', 'Mogg War Marshal', 'Explore', 'Lead the Stampede', 'Ranger of Eos', 'Phalanx Leader', 'Justice Strike', 'Nip Gwyllion', 'Nether Traitor', 'Setessan Training', 'Valiant Rescuer', 'Rampant Growth', 'Giant Killer', 'Deprive', 'Fanatical Firebrand', 'Skirsdag High Priest', 'Archaeomancer', 'Underworld Dreams', 'Rosheen Meanderer', 'Ruric Thar, the Unbowed', 'Avacyn''s Pilgrim', 'Gatekeeper of Malakir', 'Twinflame', 'Alms of the Vein', 'Ornithopter', 'Garruk Wildspeaker', 'Deftblade Elite', 'Mastermind''s Acquisition', 'Thermo-Alchemist', 'Bant Panorama', 'Grand Architect', 'Evolving Wilds', 'Kari Zev, Skyship Raider', 'Basking Rootwalla', 'Porcelain Legionnaire', 'Vivien''s Arkbow', 'Scavenged Blade', 'Angrath''s Rampage', 'Malakir Rebirth', 'Goblin Matron', 'Oust', 'Nyxathid', 'Tyrant''s Choice', 'Flourishing Fox', 'Trespasser''s Curse', 'Growth-Chamber Guardian', 'Toil // Trouble', 'Tymaret Calls the Dead', 'Approach of the Second Sun', 'Jungle Hollow', 'Hypnotic Specter', 'Stonehorn Dignitary', 'Think Twice', 'Cliffhaven Kitesail', 'Ostracize', 'Drag to the Underworld', 'Augur of Bolas', 'Llanowar Mentor', 'Fight with Fire', 'Elves of Deep Shadow', 'Dynavolt Tower', 'Keep Safe', 'Feed the Swarm', 'Buried Ruin', 'Favored Hoplite', 'Omen of the Hunt', 'Dark Withering', 'Death Cloud', 'Fyndhorn Elves', 'Barren Moor', 'Dreamstealer', 'Dwynen''s Elite', 'Hymn to Tourach', 'Igneous Pouncer', 'Daxos, Blessed by the Sun', 'Sign in Blood', 'Llanowar Elves', 'Bloodhall Priest', 'Sheltering Light', 'Forgotten Cave', 'Myr Landshaper', 'Wandering Fumarole', 'Ruin Crab', 'Temple of Silence', 'Mana Leak', 'Saproling Burst', 'Endless Horizons', 'Kor Skyfisher', 'Easy Prey', 'Smallpox', 'Psychic Strike', 'Tendrils of Agony', 'Illness in the Ranks', 'Pharika''s Libation', 'The Antiquities War', 'Alseid of Life''s Bounty', 'Liliana''s Triumph', 'Mishra''s Factory', 'Izzet Boilerworks', 'Helm of the Host', 'Lava Dart', 'Mwonvuli Acid-Moss', 'Barbarian Ring', 'Vivid Marsh', 'War Falcon', 'Selesnya Sanctuary', 'Ovalchase Daredevil', 'Flood Plain', 'Asylum Visitor', 'Balustrade Spy', 'Legacy Weapon', 'Weatherlight', 'Evolutionary Leap', 'Thief of Sanity', 'Destroy the Evidence', 'Drannith Stinger', 'Glory-Bound Initiate', 'Silvergill Adept', 'Staff of Nin', 'Go for Blood', 'Bygone Bishop', 'Grove of the Guardian', 'Skyclave Cleric', 'The Flame of Keld', 'Savage Lands', 'Lochmere Serpent', 'Tectonic Giant', 'Varolz, the Scar-Striped', 'Zombie Infestation', 'Frantic Inventory', 'Silversmote Ghoul', 'Mire Triton', 'Tymaret, Chosen from Death', 'Cloudpost', 'Assault // Battery', 'Spiteful Visions', 'Dryad Militant', 'Cartouche of Solidarity', 'Tombstalker', 'Sunken Ruins', 'Forked Bolt', 'Drown in the Loch', 'Ayula''s Influence', 'Mystic Gate', 'Syr Konrad, the Grim', 'Vault of Whispers', 'Reassembling Skeleton', 'Vendetta', 'Judge''s Familiar', 'Traxos, Scourge of Kroog', 'Graven Cairns', 'Go for the Throat', 'Stuffy Doll', 'Bogardan Hellkite', 'Light of Promise', 'Seeker of the Way', 'Primal Command', 'Akroan Skyguard', 'Throes of Chaos', 'Runeflare Trap', 'Spikefield Hazard', 'Edge of the Divinity', 'Goblin Banneret', 'Reclamation Sage', 'Rhys the Redeemed', 'Elvish Archdruid', 'Priest of Urabrask', 'Darksteel Citadel', 'Pelakka Predation', 'Selesnya Charm', 'Gigadrowse', 'Flame Jab', 'Shalai, Voice of Plenty', 'Treasure Cruise', 'Astral Slide', 'Ebony Owl Netsuke', 'Endless Atlas', 'Mind Rake', 'Hero of Iroas', 'Bump in the Night', 'Spark Spray', 'Crumbling Vestige', 'Bag of Holding', 'Tolsimir, Friend to Wolves', 'Zur''s Weirding', 'Anax, Hardened in the Forge', 'Crackling Drake', 'Krenko''s Command', 'Vedalken Certarch', 'Mesmeric Fiend', 'Duskmantle Guildmage', 'Expedite', 'Sandsteppe Citadel', 'Vindicate', 'Invoke the Firemind', 'Vesperlark', 'Blackbloom Rogue', 'Ancient Stirrings', 'Witch''s Cottage', 'Stormblood Berserker', 'Flayer Husk', 'Sphinx''s Tutelage', 'Dovin''s Veto', 'Sky Skiff', 'Might of the Masses', 'Sinister Sabotage', 'Bonesplitter', 'Mire''s Toll', 'Death Baron', 'Rune Snag', 'Emerge Unscathed', 'Clutch of the Undercity', 'Deep Forest Hermit', 'Slagstorm', 'Howltooth Hollow'))) AND (TRUE)
GROUP BY
d.id,
d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
HAVING
TRUE
ORDER BY
active_date DESC, d.finish IS NULL, d.finish
```
[]
(slow_query, 134.7, mysql)
Reported on decksite by mysql-perf
Location Hash: b29c1931f05797b8c1fceb71e506a56b639183e5
Labels: decksite
Exceeded slow_query limit (309.7 > 30.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
(
SELECT
`start`.id,
`start`.code,
`start`.start_date AS start_date,
`end`.start_date AS end_date
FROM
season AS `start`
LEFT JOIN
season AS `end` ON `end`.id = `start`.id + 1
) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)
WHERE
(d.id IN (SELECT deck_id FROM deck_card WHERE card IN ('Precursor Golem', 'Volcano Hellion', 'Khalni Garden', 'Mire''s Grasp', 'Mishra''s Factory', 'Kefnet the Mindful', 'Ojutai''s Command', 'Orzhov Basilica', 'Sejiri Shelter', 'Asylum Visitor', 'Twinflame', 'Helm of the Host', 'Think Twice', 'Improbable Alliance', 'Nimbus Maze', 'Wurm''s Tooth', 'Forgotten Cave', 'Squadron Hawk', 'Heliod''s Pilgrim', 'Blackblade Reforged', 'Rugged Prairie', 'Mortarpod', 'Turnabout', 'Boros Challenger', 'Jace Beleren', 'Read the Bones', 'Bala Ged Recovery', 'Cloudpost', 'Mesmeric Fiend', 'Kiora''s Follower', 'Judge''s Familiar', 'Wooded Bastion', 'Haktos the Unscarred', 'Fleecemane Lion', 'Burst Lightning', 'Ghostfire Blade', 'Unsubstantiate', 'Driven // Despair', 'Stonehorn Dignitary', 'Zada, Hedron Grinder', 'Syr Faren, the Hengehammer', 'Ritual of Rejuvenation', 'Acidic Slime', 'Charnel Troll', 'Tradewind Rider', 'Cauldron Familiar', 'Feed the Swarm', 'Geth''s Grimoire', 'Mystic Archaeologist', 'Bant Panorama', 'Pharika''s Spawn', 'Heartbeat of Spring', 'Gavony Township', 'Suture Priest', 'Bond of Flourishing', 'Wandering Fumarole', 'Base Camp', 'Pharika''s Libation', 'Dream Trawler', 'Lonely Sandbar', 'Ruin Crab', 'Ayli, Eternal Pilgrim', 'Seaside Citadel', 'Carnophage', 'Tidehollow Sculler', 'Davriel, Rogue Shadowmage', 'Illness in the Ranks', 'Genesis', 'Reap the Past', 'Witch''s Oven', 'Ethersworn Canonist', 'Orzhov Signet', 'Undead Augur', 'Hypnotic Specter', 'Neoform', 'Endless Atlas', 'Crumbling Necropolis', 'Wild Mongrel', 'Akiri, Fearless Voyager', 'Falkenrath Gorger', 'Stubborn Denial', 'Grafted Wargear', 'Flaxen Intruder', 'Kor Outfitter', 'Forbidden Friendship', 'Universal Automaton', 'Curse of Death''s Hold', 'Reassembling Skeleton', 'Call the Bloodline', 'Ultimate Price', 'Goblin Assault', 'Archpriest of Iona', 'Putrid Imp', 'Nimble Trapfinder', 'Light of Promise', 'Stonehewer Giant', 'Banishing Light', 'Mystic Sanctuary', 'Crib Swap', 'Silundi Vision', 'Crackling Drake', 'Lone Rider', 'Tranquil Cove', 'Giant Killer', 'Pillage', 'Frantic Search', 'Beanstalk Giant', 'Duress', 'Faith''s Fetters', 'Memnarch', 'Scavenged Blade', 'Selesnya Charm', 'Pyroclasm', 'Tragic Lesson', 'Liliana''s Reaver', 'Oblivion Ring', 'Gideon Jura', 'Liliana''s Triumph', 'Survival Cache', 'Nomad Outpost', 'Sentinel''s Eyes', 'Graven Cairns', 'Jeskai Ascendancy', 'Revel in Riches', 'Kitesail Freebooter', 'Gitaxian Probe', 'Gingerbrute', 'Ebony Owl Netsuke', 'Bonesplitter', 'Encroaching Wastes', 'Izzet Boilerworks', 'Blossoming Sands', 'Wayfaring Temple', 'Setessan Training', 'Izzet Charm', 'Truefire Captain', 'Call of the Conclave', 'Azorius Charm', 'Jungle Hollow', 'Kari Zev, Skyship Raider', 'Orim''s Chant', 'Dismal Backwater', 'Jaddi Offshoot', 'Bump in the Night', 'Nim Deathmantle', 'Krenko''s Command', 'Lavaclaw Reaches', 'Omen of the Hunt', 'Lazotep Reaver', 'Deep Analysis', 'Marauding Blight-Priest', 'Nihil Spellbomb', 'Trygon Predator', 'Fight with Fire', 'Faerie Vandal', 'Dimir Charm', 'Deprive', 'Fireblade Charger', 'Neutralize', 'Electrolyze', 'Renata, Called to the Hunt', 'Hunted Nightmare', 'Mystifying Maze', 'Logic Knot', 'Arrogant Wurm', 'Temple of Malady', 'Advent of the Wurm', 'Ajani Goldmane', 'Mina and Denn, Wildborn', 'Slagstorm', 'Cloudstone Curio', 'Dragon Fodder', 'Temple of Mystery', 'Hunted Phantasm', 'Swiftwater Cliffs', 'Browbeat', 'Weapons Trainer', 'Grapeshot', 'Divest', 'Alirios, Enraptured', 'Conclave Tribunal', 'Beckon Apparition', 'Ayula, Queen Among Bears', 'Agonizing Remorse', 'Lochmere Serpent', 'Thornwood Falls', 'All That Glitters', 'Sky Skiff', 'Talisman of Conviction', 'Kederekt Parasite', 'Zur''s Weirding', 'Endless Horizons', 'Forbid', 'Howling Mine', 'Shizo, Death''s Storehouse', 'Setessan Petitioner', 'Boros Reckoner', 'Sarcomancy', 'Vraska''s Contempt', 'Vivid Grove', 'Dark Prophecy', 'Mythos of Nethroi', 'Blightning', 'Vampire Lacerator', 'Teferi''s Tutelage', 'Titan''s Strength', 'Nearheath Pilgrim', 'Sunscour', 'Triplicate Spirits', 'Mnemonic Wall', 'Nightsky Mimic', 'Burning Inquiry', 'Prophet of Kruphix', 'Liliana''s Caress', 'Arcane Sanctum', 'Fact or Fiction', 'Cranial Plating', 'Buried Ruin', 'Liquimetal Coating', 'Chandra, Pyromaster', 'Vivid Meadow', 'Castigate', 'Healing Hands', 'Dark Ritual', 'Tyrant''s Choice', 'Karametra''s Blessing', 'Tomb of Urami', 'Linvala, Shield of Sea Gate', 'Bygone Bishop', 'Dimir Aqueduct', 'Treasure Cruise', 'Vesperlark', 'Weatherlight', 'Drown in the Loch', 'Legion Angel', 'Thrill of Possibility', 'Runeflare Trap', 'Dusk // Dawn', 'Boomerang', 'Eternal Dragon', 'Zombie Infestation', 'Ayula''s Influence', 'Brushfire Elemental', 'Abzan Charm', 'Stormfist Crusader', 'Emerge Unscathed', 'Stone Haven Outfitter', 'Throne of the God-Pharaoh', 'Gideon''s Intervention', 'Phoenix of Ash', 'Urza''s Factory', 'Vault of Whispers', 'Temple of Triumph', 'Vivid Creek', 'Cling to Dust', 'Ghostly Flicker', 'Concerted Defense', 'Invoke the Firemind', 'Justice Strike', 'Fiend Hunter', 'Opt', 'Benevolent Bodyguard', 'Delver of Secrets', 'Silence', 'Cliffhaven Kitesail', 'Gigadrowse', 'Wistful Thinking', 'Crimson Wisps', 'Temple of Silence', 'Myr Landshaper', 'Day of Judgment', 'Soul''s Attendant', 'Coiling Oracle', 'Navigator''s Compass', 'Mystic Monastery', 'Psychic Strike', 'Satyr Wayfinder', 'Gruul Turf', 'Tangled Florahedron', 'Gatekeeper of Malakir', 'Llanowar Elves', 'Piracy Charm', 'Forked Bolt', 'Ivory Tower', 'Outflank', 'Captain''s Claws', 'Alms of the Vein', 'Luminarch Ascension', 'Rootborn Defenses', 'Augur of Bolas', 'Frantic Inventory', 'Thornling', 'Desecration Demon', 'Steel Hellkite', 'Vapor Snag', 'Revitalize', 'Stuffy Doll', 'Scoured Barrens', 'Runed Halo', 'Go for the Throat', 'Sinister Sabotage', 'Bloodhall Priest', 'Tectonic Giant', 'Forbidden Alchemy', 'Tranquil Thicket', 'Galvanic Blast', 'Artificer''s Assistant', 'Rugged Highlands', 'Progenitor Mimic', 'Glass of the Guildpact', 'Walk the Aeons', 'Staff of Nin', 'Man-o''-War', 'Fumigate', 'Splinter', 'Varchild''s War-Riders', 'Cursed Scroll', 'Mana Leak', 'Transcendent Envoy', 'Welding Jar', 'Glissa Sunseeker', 'Llanowar Visionary', 'Prophetic Prism', 'Psychic Spiral', 'Curious Obsession', 'Nether Traitor', 'Sarkhan, the Dragonspeaker', 'Desecrated Tomb', 'Noose Constrictor', 'Kodama''s Reach', 'Kemba, Kha Regent', 'Kazuul''s Fury', 'Dictate of Kruphix', 'Skyclave Cleric', 'Easy Prey', 'Goblin Banneret', 'Midnight Haunting', 'Phyrexian Tyranny', 'Predator''s Gambit', 'Edge of the Divinity', 'Blood Seeker', 'Mystic Gate', 'Blackbloom Rogue', 'Hateful Eidolon', 'Veteran Adventurer', 'Frontier Bivouac', 'Spoils of Adventure', 'Syr Konrad, the Grim', 'Calciform Pools', 'Brineborn Cutthroat', 'Cemetery Reaper', 'Pore Over the Pages', 'Jace''s Archivist', 'Glory-Bound Initiate', 'Mana Flare', 'Nahiri, Storm of Stone', 'Desperate Ravings', 'Aphemia, the Cacophony', 'Cartouche of Solidarity', 'Trade Routes', 'Etched Champion', 'Ponder', 'Ranger of Eos', 'Mire Triton', 'Guilty Conscience', 'Condemn', 'Might of the Masses', 'Esper Charm', 'Toil // Trouble', 'Fire-Lit Thicket', 'Deep Forest Hermit', 'Arcbound Worker', 'Sprout Swarm', 'Planar Outburst', 'Blasphemous Act', 'Scrabbling Claws', 'Call of the Death-Dweller', 'Grasslands', 'Flood Plain', 'Migration Path', 'Birds of Paradise', 'Temple of Malice', 'Lodestone Golem', 'Golgari Findbroker', 'Sign in Blood', 'Glimmerpost', 'Smallpox', 'Mistveil Plains', 'Quirion Dryad', 'Flayer Husk', 'Grave Scrabbler', 'Duskwatch Recruiter', 'Dowsing Dagger', 'Primal Amulet', 'Frogmite', 'Mimic Vat', 'Selfless Savior', 'Cursecatcher', 'Groundskeeper', 'Lotleth Troll', 'Phylath, World Sculptor', 'Alseid of Life''s Bounty', 'Goblin Dark-Dwellers', 'Archaeomancer', 'Rhys the Redeemed', 'Laboratory Maniac', 'Champion of the Flame', 'Golgari Rot Farm', 'Akoum Hellhound', 'Clutch of the Undercity', 'Spikefield Hazard', 'River of Tears', 'Springleaf Drum', 'Terramorphic Expanse', 'Staff of Domination', 'Nip Gwyllion', 'Cultivate', 'Diregraf Ghoul', 'Goblin Gaveleer', 'Skirk Prospector', 'Keep Safe', 'Master of Etherium', 'Magmatic Sinkhole', 'Sphinx''s Tutelage', 'Spell Pierce', 'Zektar Shrine Expedition', 'Tajuru Paragon', 'Ondu Inversion', 'Daxos, Blessed by the Sun', 'Lightning Greaves', 'Fevered Visions', 'Disfigure', 'Secluded Steppe', 'Sprite Dragon', 'Dead Weight', 'Heartless Act', 'Winding Way', 'Dynavolt Tower', 'Orzhov Charm', 'Evolving Wilds', 'Brainstorm', 'Exhaustion', 'Scion of Vitu-Ghazi', 'Rakdos Signet', 'Ornithopter', 'Stoke the Flames', 'Precinct Captain', 'Yahenni''s Expertise', 'Mwonvuli Acid-Moss', 'Goreclaw, Terror of Qal Sisma', 'Malakir Rebirth', 'Blessed Alliance', 'Sylvan Library', 'Prison Realm', 'Death Baron', 'Ovalchase Daredevil', 'Wind-Scarred Crag', 'Lead the Stampede', 'Sunken Ruins', 'Grove of the Guardian', 'Fiery Temper', 'Plow Under', 'Hordeling Outburst', 'Zhalfirin Void', 'Explore', 'Dovin''s Veto', 'Tajic, Legion''s Edge', 'Summer Bloom', 'Seasoned Hallowblade', 'Masked Admirers', 'Divinity of Pride', 'Crumbling Vestige', 'Approach of the Second Sun', 'Goblin Matron', 'Field of Ruin', 'Trespasser''s Curse', 'Doomed Traveler', 'Fetid Heath', 'Hyena Umbra', 'Bad River', 'Vindicate', 'Kambal, Consul of Allocation', 'Grizzly Fate', 'Drana''s Emissary', 'Griffin Aerie', 'Deeproot Champion', 'Rune Snag', 'Spirit Mantle', 'Smiting Helix', 'Mothdust Changeling', 'Tectonic Edge', 'Vendetta', 'Spiteful Visions', 'Displace', 'Banefire', 'Wipe Away', 'Kabira Takedown', 'Vedalken Certarch', 'Grand Architect', 'Signal Pest', 'Dreamstealer', 'Clackbridge Troll', 'Cut // Ribbons', 'Mother Bear', 'Firebolt', 'Renewed Faith', 'Etherium Sculptor', 'Sandsteppe Citadel', 'Intangible Virtue', 'Battle Hymn', 'Helm of the Gods', 'Dark Withering', 'Champion of Wits', 'Tombstalker', 'Expedite', 'Garruk Wildspeaker', 'Ajani''s Pridemate', 'Evolutionary Leap', 'Decree of Justice', 'Mogg War Marshal', 'Angrath''s Rampage', 'Shalai, Voice of Plenty', 'Hymn to Tourach', 'Ensoul Artifact', 'Chain Lightning', 'Mogis''s Marauder', 'Basking Rootwalla', 'Darksteel Citadel', 'Vivid Marsh'))) AND (TRUE)
GROUP BY
d.id,
d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
HAVING
TRUE
ORDER BY
active_date DESC, d.finish IS NULL, d.finish
```
[]
(slow_query, 309.7, mysql)
Reported on decksite by mysql-perf
Location Hash: b29c1931f05797b8c1fceb71e506a56b639183e5
Labels: decksite
Exceeded slow_query limit (840.4 > 30.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
(
SELECT
`start`.id,
`start`.code,
`start`.start_date AS start_date,
`end`.start_date AS end_date
FROM
season AS `start`
LEFT JOIN
season AS `end` ON `end`.id = `start`.id + 1
) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)
WHERE
(d.id IN (SELECT deck_id FROM deck_card WHERE card IN ('Bygone Bishop', 'Syr Faren, the Hengehammer', 'Spell Pierce', 'Beanstalk Giant', 'Gingerbrute', 'Vendetta', 'Scoured Barrens', 'Divinity of Pride', 'Brainstorm', 'Omen of the Hunt', 'Kor Outfitter', 'Frontier Bivouac', 'Kodama''s Reach', 'Thornling', 'Lonely Sandbar', 'Reap the Past', 'Stormfist Crusader', 'Runed Halo', 'Mesmeric Fiend', 'Desecrated Tomb', 'Arlinn Kord', 'Master of Etherium', 'Ebony Owl Netsuke', 'Mythos of Nethroi', 'Archpriest of Iona', 'Flayer Husk', 'Frogmite', 'Volcano Hellion', 'Zektar Shrine Expedition', 'Chief of the Foundry', 'Tranquil Thicket', 'Huatli, the Sun''s Heart', 'Vivid Creek', 'Artificer''s Assistant', 'Orzhov Basilica', 'Spoils of Adventure', 'Abzan Beastmaster', 'Blood Seeker', 'Gideon Jura', 'Smiting Helix', 'Boros Reckoner', 'Champion of the Flame', 'Silence', 'Reki, the History of Kamigawa', 'Blackbloom Rogue', 'Call the Bloodline', 'Mother Bear', 'Treefolk Umbra', 'Throne of the God-Pharaoh', 'Selesnya Sanctuary', 'Ayli, Eternal Pilgrim', 'Ojutai''s Command', 'Blasphemous Act', 'Sign in Blood', 'Rootborn Defenses', 'Jace''s Archivist', 'Neutralize', 'Ayula, Queen Among Bears', 'Feed the Swarm', 'Survival Cache', 'Cultivate', 'Izzet Boilerworks', 'Aphemia, the Cacophony', 'Expedite', 'Light of Promise', 'Dusk // Dawn', 'Prison Realm', 'Carnophage', 'Transcendent Envoy', 'Cartouche of Solidarity', 'Linvala, Shield of Sea Gate', 'Castigate', 'Staff of Domination', 'Kefnet the Mindful', 'Sejiri Shelter', 'Precursor Golem', 'Decree of Justice', 'Heartbeat of Spring', 'Glory-Bound Initiate', 'Call of the Death-Dweller', 'Dragon Fodder', 'Springleaf Drum', 'Illness in the Ranks', 'Cemetery Reaper', 'Crumbling Necropolis', 'Myr Enforcer', 'Hypnotic Specter', 'Zur''s Weirding', 'Planar Outburst', 'Goblin Banneret', 'Galvanic Blast', 'Etherium Sculptor', 'Liquimetal Coating', 'Divest', 'Metallic Rebuke', 'Hordeling Outburst', 'Haktos the Unscarred', 'Agonizing Remorse', 'Skyclave Cleric', 'Cursed Scroll', 'Stuffy Doll', 'Rhys the Redeemed', 'Stonehewer Giant', 'Silundi Vision', 'Weapons Trainer', 'Call of the Conclave', 'Tyrant''s Choice', 'Ovalchase Daredevil', 'Sinister Sabotage', 'Nightsky Mimic', 'River of Tears', 'Skinshifter', 'Mimic Vat', 'Dream Trawler', 'Plow Under', 'Man-o''-War', 'Lodestone Golem', 'Cloudstone Curio', 'Mire Triton', 'Edge of the Divinity', 'Battle Hymn', 'Asylum Visitor', 'Treefolk Harbinger', 'Goblin Gaveleer', 'Vedalken Certarch', 'Wayfaring Temple', 'Legion Angel', 'Justice Strike', 'Mogis''s Marauder', 'Satyr Wayfinder', 'Bad River', 'Faith''s Fetters', 'Khalni Garden', 'Cut // Ribbons', 'Deep Forest Hermit', 'Wind-Scarred Crag', 'Lightning Greaves', 'Griffin Aerie', 'Crimson Wisps', 'Dowsing Dagger', 'Shizo, Death''s Storehouse', 'Trespasser''s Curse', 'Pyroclasm', 'Sprout Swarm', 'Revel in Riches', 'Laboratory Maniac', 'Frantic Inventory', 'Dictate of Kruphix', 'Wooded Bastion', 'Crib Swap', 'Fiend Hunter', 'Howling Mine', 'Tragic Lesson', 'Crumbling Vestige', 'Sylvan Library', 'Welding Jar', 'Kiora''s Follower', 'Sandsteppe Citadel', 'Mire''s Grasp', 'Veteran Adventurer', 'Stubborn Denial', 'Titan''s Strength', 'Grapeshot', 'Curious Obsession', 'Helm of the Host', 'Vindicate', 'Rune Snag', 'Mishra''s Factory', 'Scrabbling Claws', 'Groundskeeper', 'Setessan Training', 'Desperate Ravings', 'Nahiri, Storm of Stone', 'Ajani Goldmane', 'Shalai, Voice of Plenty', 'Lead the Stampede', 'Stonehorn Dignitary', 'Ensoul Artifact', 'Tectonic Giant', 'Goblin Assault', 'Deep Analysis', 'Ponder', 'Spiteful Visions', 'Rugged Highlands', 'Fiery Temper', 'Endless Atlas', 'Healing Hands', 'Ivory Tower', 'Etched Champion', 'Spikefield Hazard', 'Mana Flare', 'Go for the Throat', 'Urza''s Ruinous Blast', 'Abzan Charm', 'Grizzly Fate', 'Twinflame', 'Banefire', 'Darksteel Citadel', 'Outflank', 'Duress', 'Approach of the Second Sun', 'Weatherlight', 'Genesis', 'Progenitor Mimic', 'Mogg War Marshal', 'Vapor Snag', 'Azorius Charm', 'Hunted Phantasm', 'Bond of Flourishing', 'Benevolent Bodyguard', 'Ghostly Flicker', 'Nim Deathmantle', 'Karametra''s Blessing', 'Winding Way', 'Piracy Charm', 'Temple of Malice', 'Syr Konrad, the Grim', 'Fevered Visions', 'Rugged Prairie', 'Dreamstealer', 'Flaxen Intruder', 'Guilty Conscience', 'Fleecemane Lion', 'Turnabout', 'Banishing Light', 'Sky Skiff', 'Doomed Traveler', 'Explore', 'Cursecatcher', 'Witch''s Oven', 'The Antiquities War', 'Tajuru Paragon', 'Cauldron Familiar', 'Splinter', 'Teferi''s Tutelage', 'Nimbus Maze', 'Stone Haven Outfitter', 'Renata, Called to the Hunt', 'Liliana''s Reaver', 'Sarcomancy', 'Alseid of Life''s Bounty', 'Gitaxian Probe', 'Precinct Captain', 'Field of Ruin', 'Dark Withering', 'Mwonvuli Acid-Moss', 'Vivid Marsh', 'Tidehollow Sculler', 'Emerge Unscathed', 'Immolating Souleater', 'Garruk Wildspeaker', 'Augur of Bolas', 'Prophetic Prism', 'Conclave Tribunal', 'Memnarch', 'Golgari Rot Farm', 'Tajic, Legion''s Edge', 'Electrolyze', 'Signal Pest', 'Read the Bones', 'Phoenix of Ash', 'Bonesplitter', 'Ayula''s Influence', 'Phyrexian Tyranny', 'Calciform Pools', 'Vivien''s Arkbow', 'Blightning', 'Deeproot Champion', 'Dark Ritual', 'Mystic Archaeologist', 'Izzet Charm', 'Birds of Paradise', 'Bloodhall Priest', 'Mystic Monastery', 'Vivid Meadow', 'Psychic Spiral', 'Orim''s Chant', 'Noose Constrictor', 'Hateful Eidolon', 'Cliffhaven Kitesail', 'Death Baron', 'Bant Panorama', 'Dynavolt Tower', 'Selvala, Explorer Returned', 'Flood Plain', 'Evolutionary Leap', 'Soul''s Attendant', 'Clutch of the Undercity', 'Migration Path', 'Cranial Plating', 'Kitesail Freebooter', 'Zombie Infestation', 'Pharika''s Spawn', 'Sunken Ruins', 'Psychic Strike', 'Vesperlark', 'Urza''s Factory', 'Zhalfirin Void', 'Geth''s Grimoire', 'Mortarpod', 'Dromoka, the Eternal', 'Skirk Prospector', 'Dismal Backwater', 'Spirit Mantle', 'Gatekeeper of Malakir', 'Temple of Mystery', 'Zada, Hedron Grinder', 'Crackling Drake', 'Evolving Wilds', 'Jeskai Ascendancy', 'Dovin''s Veto', 'Lazotep Reaver', 'Setessan Petitioner', 'Endless Horizons', 'Burst Lightning', 'Kederekt Parasite', 'Predator''s Gambit', 'Gideon''s Intervention', 'Kabira Takedown', 'Thornwood Falls', 'Sphinx''s Tutelage', 'Smallpox', 'Tranquil Cove', 'Suture Priest', 'Swiftwater Cliffs', 'Nether Traitor', 'Kiora, Behemoth Beckoner', 'Day of Judgment', 'Prophet of Kruphix', 'Gruul Turf', 'Dosan the Falling Leaf', 'Jungle Shrine', 'Ruin Crab', 'Ethersworn Canonist', 'Lochmere Serpent', 'Jaddi Offshoot', 'Wild Mongrel', 'Champion of Wits', 'Sunscour', 'Seasoned Hallowblade', 'Yahenni''s Expertise', 'Davriel, Rogue Shadowmage', 'Nimble Trapfinder', 'Blossoming Sands', 'Krenko''s Command', 'Invoke the Firemind', 'Brave the Sands', 'Hunted Nightmare', 'Rosheen Meanderer', 'Firebolt', 'Falkenrath Gorger', 'Opt', 'Selfless Savior', 'Mistveil Plains', 'Brineborn Cutthroat', 'Mnemonic Wall', 'Thrill of Possibility', 'Mystic Gate', 'Neoform', 'Cling to Dust', 'Putrid Imp', 'Dead Weight', 'Ruric Thar, the Unbowed', 'Toil // Trouble', 'Boros Challenger', 'Hyena Umbra', 'Glass of the Guildpact', 'Sarkhan, the Dragonspeaker', 'Kemba, Kha Regent', 'Ondu Inversion', 'Bala Ged Recovery', 'Quirion Dryad', 'Pore Over the Pages', 'Esper Charm', 'Charnel Troll', 'Forbidden Alchemy', 'Temple of Triumph', 'Sprite Dragon', 'Acidic Slime', 'Gigadrowse', 'Nomad Outpost', 'Fact or Fiction', 'Undead Augur', 'Blessed Alliance', 'Drana''s Emissary', 'Sentinel''s Eyes', 'Indomitable Ancients', 'Mothdust Changeling', 'Mana Leak', 'Vampire Lacerator', 'Masked Admirers', 'Condemn', 'Pharika''s Libation', 'Drown in the Loch', 'Diregraf Ghoul', 'Arcbound Worker', 'Llanowar Elves', 'Talisman of Conviction', 'Angelic Gift', 'Duskwatch Recruiter', 'Logic Knot', 'Kari Zev, Skyship Raider', 'Grand Architect', 'Glissa Sunseeker', 'Displace', 'Nihil Spellbomb', 'Arcane Sanctum', 'Forked Bolt', 'Ultimate Price', 'Wipe Away', 'Think Twice', 'Lotleth Troll', 'Giant Killer', 'Arboreal Grazer', 'Goblin Dark-Dwellers', 'Lavaclaw Reaches', 'Tradewind Rider', 'Phylath, World Sculptor', 'Mystifying Maze', 'Archaeomancer', 'Orzhov Signet', 'Advent of the Wurm', 'Tombstalker', 'Navigator''s Compass', 'Judge''s Familiar', 'Buried Ruin', 'Truefire Captain', 'Magmatic Sinkhole', 'Heliod''s Pilgrim', 'Tangled Florahedron', 'Fight with Fire', 'Revitalize', 'Oblivion Ring', 'Boros Garrison', 'Grafted Wargear', 'Vraska''s Contempt', 'Universal Automaton', 'Forbidden Friendship', 'Heartless Act', 'Improbable Alliance', 'Secluded Steppe', 'Kambal, Consul of Allocation', 'Trygon Predator', 'Wurm''s Tooth', 'Helm of the Gods', 'Burning Inquiry', 'Coiling Oracle', 'Fire-Lit Thicket', 'Gavony Township', 'Treasure Cruise', 'Fetid Heath', 'Goblin Matron', 'Mystic Sanctuary', 'Midnight Haunting', 'Might of the Masses', 'Jace Beleren', 'Marauding Blight-Priest', 'Slagstorm', 'Eternal Dragon', 'Encroaching Wastes', 'Terramorphic Expanse', 'Disfigure', 'Tolsimir, Friend to Wolves', 'Cloudpost', 'Graven Cairns', 'Walk the Aeons', 'Alms of the Vein', 'Llanowar Visionary', 'Deprive', 'Temple of Silence', 'Desecration Demon', 'Primal Amulet', 'Unsubstantiate', 'Forgotten Cave', 'Goreclaw, Terror of Qal Sisma', 'Dimir Charm', 'Grave Scrabbler', 'Temple of Malady', 'Nearheath Pilgrim', 'Kamahl''s Druidic Vow', 'Rakdos Signet', 'Curse of Death''s Hold', 'Chandra, Pyromaster', 'Chain Lightning', 'Liliana''s Triumph', 'Seaside Citadel', 'Grove of the Guardian', 'Base Camp', 'Ajani''s Pridemate', 'Daxos, Blessed by the Sun', 'Liliana''s Caress', 'Varchild''s War-Riders', 'Jungle Hollow', 'Scavenged Blade', 'Triplicate Spirits', 'Frantic Search', 'Easy Prey', 'Concerted Defense', 'Squadron Hawk', 'Akiri, Fearless Voyager', 'Trade Routes', 'Akoum Hellhound', 'Forbid', 'Intangible Virtue', 'Lone Rider', 'Angrath''s Rampage', 'Kazuul''s Fury', 'Ornithopter', 'Mina and Denn, Wildborn', 'Delver of Secrets', 'Ranger of Eos', 'Scion of Vitu-Ghazi', 'Malakir Rebirth', 'Stoke the Flames', 'Vault of Whispers', 'Boomerang', 'Vivid Grove', 'Fumigate', 'Captain''s Claws', 'Selesnya Charm', 'Ghostfire Blade', 'Beckon Apparition', 'Steel Hellkite', 'Wistful Thinking', 'Dovin, Hand of Control', 'Tomb of Urami', 'Golgari Findbroker', 'Brushfire Elemental', 'Orzhov Charm', 'Browbeat', 'Wandering Fumarole', 'Runeflare Trap', 'Pillage', 'Dimir Aqueduct', 'Exhaustion', 'Grasslands', 'Summer Bloom', 'Staff of Nin', 'Tectonic Edge', 'Faerie Vandal', 'Nip Gwyllion', 'Myr Landshaper', 'Clackbridge Troll', 'Reassembling Skeleton', 'Renewed Faith', 'Blackblade Reforged', 'Basking Rootwalla', 'Driven // Despair', 'Glimmerpost', 'Hymn to Tourach', 'Bump in the Night', 'Alirios, Enraptured', 'Ritual of Rejuvenation', 'Keep Safe', 'All That Glitters', 'Arrogant Wurm', 'Dark Prophecy', 'Fireblade Charger', 'Luminarch Ascension'))) AND (TRUE)
GROUP BY
d.id,
d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
HAVING
TRUE
ORDER BY
active_date DESC, d.finish IS NULL, d.finish
```
[]
(slow_query, 840.4, mysql)
Reported on decksite by mysql-perf
Location Hash: b29c1931f05797b8c1fceb71e506a56b639183e5
Labels: decksite
Exceeded slow_query limit (63.3 > 30.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
(
SELECT
`start`.id,
`start`.code,
`start`.start_date AS start_date,
`end`.start_date AS end_date
FROM
season AS `start`
LEFT JOIN
season AS `end` ON `end`.id = `start`.id + 1
) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)
WHERE
(d.id IN (SELECT deck_id FROM deck_card WHERE card IN ('Marauding Blight-Priest', 'Explore', 'Archaeomancer', 'Jeskai Ascendancy', 'Fevered Visions', 'Bonesplitter', 'Orim''s Chant', 'Shalai, Voice of Plenty', 'Gatekeeper of Malakir', 'Mythos of Nethroi', 'Aphemia, the Cacophony', 'Worldgorger Dragon', 'Endless Horizons', 'Summer Bloom', 'Browbeat', 'Ondu Inversion', 'Phylath, World Sculptor', 'Emerge Unscathed', 'Deranged Hermit', 'Cathartic Reunion', 'Ajani''s Pridemate', 'Primal Amulet', 'Mother Bear', 'Selvala, Explorer Returned', 'Tajic, Legion''s Edge', 'Walk the Aeons', 'Spirit Mantle', 'Akoum Hellhound', 'Pharika''s Libation', 'Guilty Conscience', 'Trespasser''s Curse', 'Plow Under', 'Shizo, Death''s Storehouse', 'Crackling Drake', 'Wurm''s Tooth', 'Kodama''s Reach', 'Dragon Fodder', 'Day of Judgment', 'Jaddi Offshoot', 'Skyclave Cleric', 'Nihil Spellbomb', 'Syr Konrad, the Grim', 'Wind-Scarred Crag', 'Rugged Highlands', 'Darksteel Citadel', 'Helm of the Gods', 'Witch''s Oven', 'Goblin Gaveleer', 'Izzet Boilerworks', 'Decree of Justice', 'Evolutionary Leap', 'Faerie Vandal', 'Battle Hymn', 'Calciform Pools', 'Sarcomancy', 'Boros Garrison', 'Graven Cairns', 'Tomb of Urami', 'Genesis', 'Linvala, Shield of Sea Gate', 'Temple of Malady', 'Judge''s Familiar', 'Bump in the Night', 'Kazuul''s Fury', 'Invoke the Firemind', 'Sinister Sabotage', 'Magmatic Sinkhole', 'Angrath''s Rampage', 'Fire-Lit Thicket', 'Vault of Whispers', 'Illness in the Ranks', 'Trygon Predator', 'Orzhov Signet', 'Doomed Traveler', 'Ransack the Lab', 'Suture Priest', 'Mistveil Plains', 'Wipe Away', 'Rugged Prairie', 'Forbidden Alchemy', 'Precinct Captain', 'Brushfire Elemental', 'Hypnotic Specter', 'Piracy Charm', 'Predator''s Gambit', 'Tolsimir, Friend to Wolves', 'Duskwatch Recruiter', 'Sign in Blood', 'Triplicate Spirits', 'Oblivion Ring', 'Captain''s Claws', 'Vesperlark', 'Helm of the Host', 'Phoenix of Ash', 'Tranquil Thicket', 'Treefolk Harbinger', 'Fact or Fiction', 'Haktos the Unscarred', 'Tyrant''s Choice', 'Dromoka, the Eternal', 'Diregraf Ghoul', 'Glory-Bound Initiate', 'Base Camp', 'Neoform', 'Brave the Sands', 'Curse of Death''s Hold', 'Desecration Demon', 'Selesnya Sanctuary', 'Asylum Visitor', 'Precursor Golem', 'Delver of Secrets', 'Lazotep Reaver', 'Selesnya Charm', 'Mwonvuli Acid-Moss', 'Ultimate Price', 'Seaside Citadel', 'Grasslands', 'Ghostly Flicker', 'Reap the Past', 'Fight with Fire', 'Grapeshot', 'Terramorphic Expanse', 'Liquimetal Coating', 'Psychic Strike', 'Divinity of Pride', 'Welding Jar', 'Etherium Sculptor', 'Improbable Alliance', 'Vivid Creek', 'Zur''s Weirding', 'Ghostfire Blade', 'Alseid of Life''s Bounty', 'Sire of Insanity', 'Ovalchase Daredevil', 'Arrogant Wurm', 'Sentinel''s Eyes', 'Cloudpost', 'Bloodhall Priest', 'Concerted Defense', 'Psychic Spiral', 'Nahiri, Storm of Stone', 'Omen of the Hunt', 'Setessan Petitioner', 'Crumbling Vestige', 'Slagstorm', 'Kiora''s Follower', 'Hyena Umbra', 'Alms of the Vein', 'Boros Challenger', 'Kor Outfitter', 'Ayula''s Influence', 'Tragic Lesson', 'Blasphemous Act', 'Secluded Steppe', 'Zektar Shrine Expedition', 'Toil // Trouble', 'Universal Automaton', 'Grafted Wargear', 'Veteran Adventurer', 'Stone Haven Outfitter', 'Angelic Gift', 'Vendetta', 'Akiri, Fearless Voyager', 'Prophet of Kruphix', 'Dark Ritual', 'Stoke the Flames', 'Undead Augur', 'Yahenni''s Expertise', 'Blightning', 'Mortarpod', 'Stuffy Doll', 'Cranial Plating', 'Talisman of Conviction', 'Ritual of Rejuvenation', 'Sandsteppe Citadel', 'Curious Obsession', 'Dictate of Kruphix', 'Opt', 'Deeproot Champion', 'Splinter', 'Titan''s Strength', 'Rune Snag', 'Smiting Helix', 'Goblin Banneret', 'Grand Architect', 'Lone Rider', 'Dusk // Dawn', 'Esper Charm', 'Vraska''s Contempt', 'Tidehollow Sculler', 'Frontier Bivouac', 'Dark Prophecy', 'Mina and Denn, Wildborn', 'Ruin Crab', 'Staff of Domination', 'Llanowar Visionary', 'Ensoul Artifact', 'Heliod''s Pilgrim', 'Treasure Cruise', 'Stormfist Crusader', 'Karametra''s Blessing', 'Deprive', 'Survival Cache', 'Hunted Phantasm', 'Skirk Prospector', 'Wooded Bastion', 'Myr Landshaper', 'Feed the Swarm', 'Noose Constrictor', 'Tombstalker', 'Goblin Matron', 'Sky Skiff', 'Teferi''s Tutelage', 'Coiling Oracle', 'Forgotten Cave', 'Banefire', 'Condemn', 'Crumbling Necropolis', 'Brainstorm', 'Glissa Sunseeker', 'Varchild''s War-Riders', 'Faith''s Fetters', 'Temple of Silence', 'Fiery Temper', 'Goblin Assault', 'Thrill of Possibility', 'Liliana''s Reaver', 'Displace', 'Nimbus Maze', 'Legion Angel', 'Azorius Charm', 'Bad River', 'Treefolk Umbra', 'Go for the Throat', 'Rootborn Defenses', 'Read the Bones', 'Sejiri Shelter', 'Elvish Visionary', 'Rhys the Redeemed', 'Call of the Death-Dweller', 'Hordeling Outburst', 'Grave Scrabbler', 'Malakir Rebirth', 'Drana''s Emissary', 'Vivid Marsh', 'Mystic Sanctuary', 'Carnophage', 'Mire''s Toll', 'Soul''s Attendant', 'Falkenrath Gorger', 'Divest', 'Benevolent Bodyguard', 'Justice Strike', 'Smallpox', 'Master of Etherium', 'Jungle Hollow', 'Banishing Light', 'Zada, Hedron Grinder', 'Mystic Monastery', 'Arlinn Kord', 'Duress', 'Vindicate', 'Davriel, Rogue Shadowmage', 'Blood Seeker', 'Approach of the Second Sun', 'Rakdos Signet', 'Renewed Faith', 'Cauldron Familiar', 'Gigadrowse', 'Weatherlight', 'Sylvan Library', 'Groundskeeper', 'Midnight Haunting', 'Giant Killer', 'Lochmere Serpent', 'Vivid Meadow', 'Reassembling Skeleton', 'Flaxen Intruder', 'Blackbloom Rogue', 'Liliana''s Triumph', 'Conclave Tribunal', 'Krenko''s Command', 'Mesmeric Fiend', 'Seasoned Hallowblade', 'Dosan the Falling Leaf', 'Ulamog''s Crusher', 'Evolving Wilds', 'Flayer Husk', 'Bala Ged Recovery', 'Grove of the Guardian', 'Lonely Sandbar', 'Hunted Nightmare', 'Goblin Dark-Dwellers', 'Grizzly Fate', 'Shriekhorn', 'Vampire Lacerator', 'Omen of the Forge', 'Artisan of Kozilek', 'Gitaxian Probe', 'Ornithopter', 'Outflank', 'Boros Reckoner', 'Mire Triton', 'Dream Trawler', 'Progenitor Mimic', 'Zhalfirin Void', 'Séance', 'Might of the Masses', 'Bond of Flourishing', 'Call the Bloodline', 'Blackblade Reforged', 'Crimson Wisps', 'Planar Outburst', 'Twinflame', 'Champion of Wits', 'Howling Mine', 'Kederekt Parasite', 'Rosheen Meanderer', 'Mnemonic Wall', 'Jungle Shrine', 'Pyroclasm', 'Expedite', 'Fleecemane Lion', 'Gavony Township', 'Revitalize', 'Dismal Backwater', 'Dark Withering', 'Blossoming Sands', 'Metallic Rebuke', 'Cursed Scroll', 'Ranger of Eos', 'Kari Zev, Skyship Raider', 'Reanimate', 'Satyr Wayfinder', 'Jace Beleren', 'Sunken Ruins', 'Burst Lightning', 'Hateful Eidolon', 'Charnel Troll', 'Indomitable Ancients', 'Tangled Florahedron', 'Spiteful Visions', 'Nomad Outpost', 'Exhaustion', 'Sarkhan, the Dragonspeaker', 'Ethersworn Canonist', 'Nether Traitor', 'Izzet Charm', 'Dovin, Hand of Control', 'Pharika''s Spawn', 'Death Baron', 'Wayfaring Temple', 'Urza''s Ruinous Blast', 'Kiora, Behemoth Beckoner', 'Dovin''s Veto', 'Stonehorn Dignitary', 'Khalni Garden', 'Dowsing Dagger', 'Vedalken Certarch', 'Runed Halo', 'Castigate', 'Fetid Heath', 'Mana Flare', 'Spikefield Hazard', 'Kambal, Consul of Allocation', 'Mothdust Changeling', 'Endless Atlas', 'Scion of Vitu-Ghazi', 'Steel Hellkite', 'Clutch of the Undercity', 'Reki, the History of Kamigawa', 'Mimic Vat', 'Navigator''s Compass', 'Squadron Hawk', 'Lightning Greaves', 'The Antiquities War', 'Firebolt', 'Dimir Charm', 'Artificer''s Assistant', 'Tectonic Edge', 'Kamahl''s Druidic Vow', 'Archpriest of Iona', 'Goreclaw, Terror of Qal Sisma', 'Sphinx''s Tutelage', 'Clackbridge Troll', 'Griffin Aerie', 'Silence', 'Dynavolt Tower', 'Grim Lavamancer', 'Myr Enforcer', 'Glass of the Guildpact', 'Prison Realm', 'Truefire Captain', 'Desecrated Tomb', 'Burning Inquiry', 'Advent of the Wurm', 'Frantic Inventory', 'Call of the Conclave', 'Chain Lightning', 'Eternal Dragon', 'Easy Prey', 'Piranha Marsh', 'Dimir Aqueduct', 'Fireblade Charger', 'Boomerang', 'Intangible Virtue', 'Mystic Gate', 'Tormenting Voice', 'Gideon Jura', 'Nip Gwyllion', 'Mogg War Marshal', 'All That Glitters', 'Beckon Apparition', 'Urza''s Factory', 'Setessan Training', 'Unsubstantiate', 'Skinshifter', 'Temple of Mystery', 'Lodestone Golem', 'Mogis''s Marauder', 'Staff of Nin', 'Mana Leak', 'Edge of the Divinity', 'Huatli, the Sun''s Heart', 'Neutralize', 'Gruul Turf', 'Bygone Bishop', 'Stonehewer Giant', 'Chief of the Foundry', 'Cling to Dust', 'Heartless Act', 'Demigod of Revenge', 'Cultivate', 'Tectonic Giant', 'Syr Faren, the Hengehammer', 'Masked Admirers', 'Migration Path', 'Healing Hands', 'Deep Analysis', 'Cursecatcher', 'Crib Swap', 'Forbid', 'Garruk Wildspeaker', 'River of Tears', 'Glimmerpost', 'Nearheath Pilgrim', 'Immolating Souleater', 'Zombie Infestation', 'Champion of the Flame', 'Lotleth Troll', 'Nightsky Mimic', 'Field of Ruin', 'Pore Over the Pages', 'Desperate Ravings', 'Kemba, Kha Regent', 'Silundi Vision', 'Stubborn Denial', 'Revel in Riches', 'Selfless Savior', 'Pillage', 'Throne of the God-Pharaoh', 'Animate Dead', 'Abzan Beastmaster', 'Lavaclaw Reaches', 'Sunscour', 'Liliana''s Caress', 'Arcbound Worker', 'Ajani Goldmane', 'Birds of Paradise', 'Basking Rootwalla', 'Renata, Called to the Hunt', 'Wandering Fumarole', 'Tradewind Rider', 'Orzhov Charm', 'Scavenged Blade', 'Spoils of Adventure', 'Agonizing Remorse', 'Ayli, Eternal Pilgrim', 'Dreamstealer', 'Ivory Tower', 'Signal Pest', 'Ruric Thar, the Unbowed', 'Springleaf Drum', 'Golgari Findbroker', 'Driven // Despair', 'Golgari Rot Farm', 'Abzan Charm', 'Putrid Imp', 'Acidic Slime', 'Frantic Search', 'Mystic Archaeologist', 'Augur of Bolas', 'Temple of Malice', 'Cemetery Reaper', 'Jace''s Archivist', 'Runeflare Trap', 'Cliffhaven Kitesail', 'Temple of Triumph', 'Laboratory Maniac', 'Dead Weight', 'Beanstalk Giant', 'Frogmite', 'Swiftwater Cliffs', 'Trade Routes', 'Cut // Ribbons', 'Alirios, Enraptured', 'Transcendent Envoy', 'Sprout Swarm', 'Scoured Barrens', 'Vivid Grove', 'Man-o''-War', 'Ebony Owl Netsuke', 'Keep Safe', 'Forbidden Friendship', 'Weapons Trainer', 'Mishra''s Factory', 'Turnabout', 'Etched Champion', 'Brineborn Cutthroat', 'Blessed Alliance', 'Scrabbling Claws', 'Encroaching Wastes', 'Tranquil Cove', 'Kitesail Freebooter', 'Nimble Trapfinder', 'Winding Way', 'Cartouche of Solidarity', 'Ojutai''s Command', 'Prophetic Prism', 'Flood Plain', 'Arcane Sanctum', 'Avacyn''s Pilgrim', 'Electrolyze', 'Geth''s Grimoire', 'Vivien''s Arkbow', 'Fumigate', 'Commune with the Gods', 'Tajuru Paragon', 'Fiend Hunter', 'Cloudstone Curio', 'Ayula, Queen Among Bears', 'Galvanic Blast', 'Forked Bolt', 'Think Twice', 'Chandra, Pyromaster', 'Memnarch', 'Mystifying Maze', 'Quirion Dryad', 'Kabira Takedown', 'Light of Promise', 'Vapor Snag', 'Gingerbrute', 'Luminarch Ascension', 'Spell Pierce', 'Phyrexian Tyranny', 'Pathrazer of Ulamog', 'Wistful Thinking', 'Bant Panorama', 'Thornling', 'Disfigure', 'Llanowar Elves', 'Heartbeat of Spring', 'Wild Mongrel', 'Mire''s Grasp', 'Buried Ruin', 'Lead the Stampede', 'Gideon''s Intervention', 'Orzhov Basilica', 'Arboreal Grazer', 'Daxos, Blessed by the Sun', 'Ponder', 'Hymn to Tourach', 'Thornwood Falls', 'Nim Deathmantle', 'Kefnet the Mindful', 'Deep Forest Hermit', 'Sprite Dragon', 'Drown in the Loch', 'Logic Knot', 'Volcano Hellion'))) AND (TRUE)
GROUP BY
d.id,
d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
HAVING
TRUE
ORDER BY
active_date DESC, d.finish IS NULL, d.finish
```
[]
(slow_query, 63.3, mysql)
Reported on decksite by mysql-perf
Location Hash: b29c1931f05797b8c1fceb71e506a56b639183e5
Labels: decksite
Exceeded slow_query limit (198.2 > 30.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
(
SELECT
`start`.id,
`start`.code,
`start`.start_date AS start_date,
`end`.start_date AS end_date
FROM
season AS `start`
LEFT JOIN
season AS `end` ON `end`.id = `start`.id + 1
) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)
WHERE
(d.id IN (SELECT deck_id FROM deck_card WHERE card IN ('Scoured Barrens', 'Tectonic Edge', 'Angelic Gift', 'Castigate', 'Wurm''s Tooth', 'Gigadrowse', 'Hymn to Tourach', 'Tectonic Giant', 'Beanstalk Giant', 'Yahenni''s Expertise', 'Sunken Ruins', 'Omen of the Forge', 'Planar Outburst', 'Vivid Meadow', 'Rugged Prairie', 'Golgari Rot Farm', 'Vesperlark', 'Neoform', 'Sprite Dragon', 'Phoenix of Ash', 'Crackling Drake', 'Crumbling Necropolis', 'Pathrazer of Ulamog', 'Forked Bolt', 'Liliana''s Caress', 'Myr Enforcer', 'Chandra, Pyromaster', 'Omen of the Hunt', 'Izzet Charm', 'Silence', 'Conclave Tribunal', 'Encroaching Wastes', 'Emerge Unscathed', 'Orzhov Charm', 'Grove of the Guardian', 'Ornithopter', 'All That Glitters', 'Sunscour', 'Stonehewer Giant', 'Alms of the Vein', 'Helm of the Host', 'Grim Lavamancer', 'Vendetta', 'Mogis''s Marauder', 'Ranger of Eos', 'Satyr Wayfinder', 'Shizo, Death''s Storehouse', 'Midnight Haunting', 'Rootborn Defenses', 'Artisan of Kozilek', 'Pharika''s Libation', 'Advent of the Wurm', 'Ivory Tower', 'Precursor Golem', 'Selesnya Sanctuary', 'Lonely Sandbar', 'Brainstorm', 'Delver of Secrets', 'Ayula''s Influence', 'Plow Under', 'Cranial Plating', 'Séance', 'Revitalize', 'Pore Over the Pages', 'Base Camp', 'Cloudstone Curio', 'Grapeshot', 'Tragic Lesson', 'Abzan Charm', 'Duress', 'Shalai, Voice of Plenty', 'Frogmite', 'Might of the Masses', 'Mother Bear', 'Walk the Aeons', 'Prison Realm', 'Brave the Sands', 'Shriekhorn', 'Revel in Riches', 'Goreclaw, Terror of Qal Sisma', 'Blightning', 'Aphemia, the Cacophony', 'Squadron Hawk', 'Bond of Flourishing', 'Dragon Fodder', 'Terramorphic Expanse', 'Dosan the Falling Leaf', 'Curse of Death''s Hold', 'Thornwood Falls', 'Psychic Strike', 'Kambal, Consul of Allocation', 'Ultimate Price', 'Captain''s Claws', 'Easy Prey', 'Curious Obsession', 'Kefnet the Mindful', 'Wayfaring Temple', 'Glass of the Guildpact', 'Rhys the Redeemed', 'Judge''s Familiar', 'Orim''s Chant', 'Cemetery Reaper', 'Ruin Crab', 'Mire''s Toll', 'Varchild''s War-Riders', 'Mortarpod', 'Spoils of Adventure', 'Crimson Wisps', 'Basking Rootwalla', 'River of Tears', 'Bonesplitter', 'Go for the Throat', 'Hunted Phantasm', 'Approach of the Second Sun', 'Doomed Traveler', 'Daxos, Blessed by the Sun', 'Ondu Inversion', 'Battle Hymn', 'Heartbeat of Spring', 'Graven Cairns', 'Day of Judgment', 'Tormenting Voice', 'Signal Pest', 'Turnabout', 'Giant Killer', 'Dark Withering', 'Abzan Beastmaster', 'Lochmere Serpent', 'Drown in the Loch', 'Migration Path', 'Dead Weight', 'Galvanic Blast', 'Dreamstealer', 'Temple of Malice', 'Cloudpost', 'Darksteel Citadel', 'Progenitor Mimic', 'Nihil Spellbomb', 'Arrogant Wurm', 'Kabira Takedown', 'Scavenged Blade', 'Sarcomancy', 'Cauldron Familiar', 'Davriel, Rogue Shadowmage', 'Desecrated Tomb', 'Kederekt Parasite', 'Divest', 'Kari Zev, Skyship Raider', 'Cultivate', 'Kiora, Behemoth Beckoner', 'Steel Hellkite', 'Tradewind Rider', 'Rune Snag', 'Putrid Imp', 'Ajani Goldmane', 'Champion of Wits', 'Chief of the Foundry', 'Fire-Lit Thicket', 'Cursecatcher', 'Sign in Blood', 'Liquimetal Coating', 'Tidehollow Sculler', 'Artificer''s Assistant', 'Gavony Township', 'Goblin Matron', 'Skirk Prospector', 'Duskwatch Recruiter', 'Exhaustion', 'Chain Lightning', 'Beckon Apparition', 'Metallic Rebuke', 'Temple of Triumph', 'Diregraf Ghoul', 'Dimir Aqueduct', 'Sarkhan, the Dragonspeaker', 'Field of Ruin', 'Weatherlight', 'Treefolk Umbra', 'Dynavolt Tower', 'Sandsteppe Citadel', 'Spiteful Visions', 'Hateful Eidolon', 'Fiery Temper', 'Grand Architect', 'Endless Atlas', 'Hypnotic Specter', 'Fact or Fiction', 'Welding Jar', 'Veteran Adventurer', 'Liliana''s Reaver', 'Glissa Sunseeker', 'Ovalchase Daredevil', 'Survival Cache', 'Fevered Visions', 'Rosheen Meanderer', 'Nimbus Maze', 'Buried Ruin', 'Sejiri Shelter', 'Illness in the Ranks', 'Cursed Scroll', 'Vapor Snag', 'Renewed Faith', 'Twinflame', 'Dismal Backwater', 'Fireblade Charger', 'Forbid', 'Winding Way', 'Silundi Vision', 'Helm of the Gods', 'Vedalken Certarch', 'Masked Admirers', 'Genesis', 'Grafted Wargear', 'Augur of Bolas', 'Gruul Turf', 'Treasure Cruise', 'Zhalfirin Void', 'Ayula, Queen Among Bears', 'Pyroclasm', 'Ghostly Flicker', 'Healing Hands', 'Vampire Lacerator', 'Oblivion Ring', 'Marauding Blight-Priest', 'Nomad Outpost', 'Wipe Away', 'Kor Outfitter', 'Electrolyze', 'Trygon Predator', 'Call of the Conclave', 'Blood Seeker', 'Scion of Vitu-Ghazi', 'Tangled Florahedron', 'Trespasser''s Curse', 'Mesmeric Fiend', 'Cathartic Reunion', 'Boomerang', 'Slagstorm', 'Huatli, the Sun''s Heart', 'Lone Rider', 'Staff of Domination', 'Stuffy Doll', 'Geth''s Grimoire', 'Tajuru Paragon', 'Piranha Marsh', 'Forgotten Cave', 'Sire of Insanity', 'Piracy Charm', 'Kemba, Kha Regent', 'Syr Faren, the Hengehammer', 'The Antiquities War', 'Lazotep Reaver', 'Evolving Wilds', 'Boros Challenger', 'Endless Horizons', 'Memnarch', 'Dream Trawler', 'Alirios, Enraptured', 'Lightning Greaves', 'Grizzly Fate', 'Intangible Virtue', 'Jace''s Archivist', 'Krenko''s Command', 'Flayer Husk', 'Selvala, Explorer Returned', 'Psychic Spiral', 'Reki, the History of Kamigawa', 'Man-o''-War', 'Vivid Grove', 'Nearheath Pilgrim', 'Mystic Monastery', 'Wandering Fumarole', 'Stormfist Crusader', 'Tolsimir, Friend to Wolves', 'Ayli, Eternal Pilgrim', 'Gideon Jura', 'Brushfire Elemental', 'Mistveil Plains', 'Nahiri, Storm of Stone', 'Mogg War Marshal', 'Rakdos Signet', 'Thornling', 'Archaeomancer', 'Brineborn Cutthroat', 'Vraska''s Contempt', 'Ebony Owl Netsuke', 'Renata, Called to the Hunt', 'Gingerbrute', 'Goblin Gaveleer', 'Mire''s Grasp', 'Dowsing Dagger', 'Faerie Vandal', 'Faith''s Fetters', 'Azorius Charm', 'Volcano Hellion', 'Mana Leak', 'Myr Landshaper', 'Condemn', 'Carnophage', 'Elvish Visionary', 'Precinct Captain', 'Malakir Rebirth', 'Khalni Garden', 'Driven // Despair', 'Tranquil Cove', 'Zada, Hedron Grinder', 'Guilty Conscience', 'Temple of Silence', 'Arlinn Kord', 'Smallpox', 'Lead the Stampede', 'Etherium Sculptor', 'Tyrant''s Choice', 'Kiora''s Follower', 'Predator''s Gambit', 'Titan''s Strength', 'Bygone Bishop', 'Garruk Wildspeaker', 'Ruric Thar, the Unbowed', 'Jace Beleren', 'Concerted Defense', 'Deep Forest Hermit', 'Gitaxian Probe', 'Bala Ged Recovery', 'Prophet of Kruphix', 'Universal Automaton', 'Mina and Denn, Wildborn', 'Liliana''s Triumph', 'Kamahl''s Druidic Vow', 'Burst Lightning', 'Unsubstantiate', 'Blossoming Sands', 'Vault of Whispers', 'Vivid Creek', 'Dovin''s Veto', 'Howling Mine', 'Mire Triton', 'Keep Safe', 'Setessan Petitioner', 'Haktos the Unscarred', 'Selfless Savior', 'Nim Deathmantle', 'Swiftwater Cliffs', 'Zombie Infestation', 'Heliod''s Pilgrim', 'Nether Traitor', 'Spikefield Hazard', 'Stone Haven Outfitter', 'Kodama''s Reach', 'Champion of the Flame', 'Mwonvuli Acid-Moss', 'Smiting Helix', 'Mothdust Changeling', 'Deprive', 'Legion Angel', 'Agonizing Remorse', 'Seaside Citadel', 'Teferi''s Tutelage', 'Divinity of Pride', 'Phyrexian Tyranny', 'Toil // Trouble', 'Ajani''s Pridemate', 'Call the Bloodline', 'Suture Priest', 'Sphinx''s Tutelage', 'Glory-Bound Initiate', 'Scrabbling Claws', 'Transcendent Envoy', 'Sylvan Library', 'Disfigure', 'Mythos of Nethroi', 'Staff of Nin', 'Stoke the Flames', 'Treefolk Harbinger', 'Coiling Oracle', 'Asylum Visitor', 'Indomitable Ancients', 'Springleaf Drum', 'Cling to Dust', 'Read the Bones', 'Ransack the Lab', 'Crib Swap', 'Jungle Hollow', 'Pillage', 'Ponder', 'Improbable Alliance', 'Tranquil Thicket', 'Arcane Sanctum', 'Urza''s Ruinous Blast', 'Quirion Dryad', 'Temple of Mystery', 'Bloodhall Priest', 'Ritual of Rejuvenation', 'Wild Mongrel', 'Tajic, Legion''s Edge', 'Blackblade Reforged', 'Neutralize', 'Reanimate', 'Weapons Trainer', 'Birds of Paradise', 'Eternal Dragon', 'Cliffhaven Kitesail', 'Evolutionary Leap', 'Temple of Malady', 'Logic Knot', 'Mystic Sanctuary', 'Commune with the Gods', 'Truefire Captain', 'Fetid Heath', 'Vivid Marsh', 'Grave Scrabbler', 'Mystifying Maze', 'Goblin Assault', 'Edge of the Divinity', 'Witch''s Oven', 'Zektar Shrine Expedition', 'Drana''s Emissary', 'Call of the Death-Dweller', 'Laboratory Maniac', 'Skyclave Cleric', 'Dark Ritual', 'Opt', 'Karametra''s Blessing', 'Sinister Sabotage', 'Bad River', 'Magmatic Sinkhole', 'Prophetic Prism', 'Runed Halo', 'Banefire', 'Selesnya Charm', 'Lotleth Troll', 'Jaddi Offshoot', 'Rugged Highlands', 'Llanowar Elves', 'Pharika''s Spawn', 'Blessed Alliance', 'Desperate Ravings', 'Kitesail Freebooter', 'Cut // Ribbons', 'Sentinel''s Eyes', 'Displace', 'Kazuul''s Fury', 'Expedite', 'Tomb of Urami', 'Boros Garrison', 'Calciform Pools', 'Izzet Boilerworks', 'Mystic Archaeologist', 'Setessan Training', 'Demigod of Revenge', 'Explore', 'Ulamog''s Crusher', 'Trade Routes', 'Fight with Fire', 'Frantic Search', 'Flaxen Intruder', 'Ojutai''s Command', 'Jungle Shrine', 'Frantic Inventory', 'Talisman of Conviction', 'Ethersworn Canonist', 'Urza''s Factory', 'Boros Reckoner', 'Throne of the God-Pharaoh', 'Animate Dead', 'Forbidden Friendship', 'Wistful Thinking', 'Goblin Banneret', 'Browbeat', 'Arcbound Worker', 'Syr Konrad, the Grim', 'Luminarch Ascension', 'Nimble Trapfinder', 'Banishing Light', 'Gatekeeper of Malakir', 'Feed the Swarm', 'Bump in the Night', 'Benevolent Bodyguard', 'Worldgorger Dragon', 'Charnel Troll', 'Cartouche of Solidarity', 'Thrill of Possibility', 'Goblin Dark-Dwellers', 'Sprout Swarm', 'Splinter', 'Noose Constrictor', 'Angrath''s Rampage', 'Falkenrath Gorger', 'Fumigate', 'Nip Gwyllion', 'Acidic Slime', 'Stubborn Denial', 'Vivien''s Arkbow', 'Jeskai Ascendancy', 'Decree of Justice', 'Secluded Steppe', 'Lavaclaw Reaches', 'Golgari Findbroker', 'Undead Augur', 'Mnemonic Wall', 'Blasphemous Act', 'Hyena Umbra', 'Akoum Hellhound', 'Dovin, Hand of Control', 'Summer Bloom', 'Archpriest of Iona', 'Reassembling Skeleton', 'Avacyn''s Pilgrim', 'Mishra''s Factory', 'Forbidden Alchemy', 'Griffin Aerie', 'Nightsky Mimic', 'Desecration Demon', 'Llanowar Visionary', 'Glimmerpost', 'Groundskeeper', 'Reap the Past', 'Stonehorn Dignitary', 'Blackbloom Rogue', 'Orzhov Signet', 'Frontier Bivouac', 'Zur''s Weirding', 'Bant Panorama', 'Heartless Act', 'Burning Inquiry', 'Phylath, World Sculptor', 'Flood Plain', 'Gideon''s Intervention', 'Wind-Scarred Crag', 'Dromoka, the Eternal', 'Light of Promise', 'Arboreal Grazer', 'Clackbridge Troll', 'Linvala, Shield of Sea Gate', 'Soul''s Attendant', 'Grasslands', 'Mana Flare', 'Dark Prophecy', 'Dimir Charm', 'Spell Pierce', 'Lodestone Golem', 'Seasoned Hallowblade', 'Etched Champion', 'Fleecemane Lion', 'Deep Analysis', 'Outflank', 'Deeproot Champion', 'Deranged Hermit', 'Ensoul Artifact', 'Esper Charm', 'Fiend Hunter', 'Runeflare Trap', 'Firebolt', 'Wooded Bastion', 'Akiri, Fearless Voyager', 'Hunted Nightmare', 'Immolating Souleater', 'Master of Etherium', 'Sky Skiff', 'Death Baron', 'Tombstalker', 'Dusk // Dawn', 'Vindicate', 'Spirit Mantle', 'Justice Strike', 'Invoke the Firemind', 'Primal Amulet', 'Navigator''s Compass', 'Orzhov Basilica', 'Think Twice', 'Alseid of Life''s Bounty', 'Clutch of the Undercity', 'Triplicate Spirits', 'Skinshifter', 'Ghostfire Blade', 'Mimic Vat', 'Mystic Gate', 'Dictate of Kruphix', 'Crumbling Vestige', 'Hordeling Outburst'))) AND (TRUE)
GROUP BY
d.id,
d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
HAVING
TRUE
ORDER BY
active_date DESC, d.finish IS NULL, d.finish
```
[]
(slow_query, 198.2, mysql)
Reported on decksite by mysql-perf
Location Hash: b29c1931f05797b8c1fceb71e506a56b639183e5
Labels: decksite
Exceeded slow_query limit (99.0 > 30.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
(
SELECT
`start`.id,
`start`.code,
`start`.start_date AS start_date,
`end`.start_date AS end_date
FROM
season AS `start`
LEFT JOIN
season AS `end` ON `end`.id = `start`.id + 1
) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)
WHERE
(d.id IN (SELECT deck_id FROM deck_card WHERE card IN ('Eternal Dragon', 'Goblin Assault', 'Treasure Cruise', 'Bloodhall Priest', 'Wooded Bastion', 'Summer Bloom', 'Cauldron Familiar', 'Avacyn''s Pilgrim', 'Tidehollow Sculler', 'Ruin Crab', 'Commune with the Gods', 'The Antiquities War', 'Boros Reckoner', 'Nimbus Maze', 'Spellbook', 'Exhaustion', 'Cloudstone Curio', 'Keep Safe', 'Soul''s Attendant', 'Putrid Imp', 'Navigator''s Compass', 'Forbid', 'Falkenrath Gorger', 'Mogis''s Marauder', 'Call the Bloodline', 'Pathrazer of Ulamog', 'Skinshifter', 'Cranial Plating', 'Mimic Vat', 'Walk the Aeons', 'Artisan of Kozilek', 'Vindicate', 'Turnabout', 'Kambal, Consul of Allocation', 'Rhys the Redeemed', 'Cut // Ribbons', 'Asylum Visitor', 'Boomerang', 'Crumbling Necropolis', 'Goblin Dark-Dwellers', 'Tombstalker', 'Liliana''s Caress', 'Sprite Dragon', 'Legion Angel', 'Zada, Hedron Grinder', 'Sign in Blood', 'Grave Scrabbler', 'Glissa Sunseeker', 'Brave the Sands', 'Dovin''s Veto', 'Dosan the Falling Leaf', 'Fetid Heath', 'Tormenting Voice', 'Kor Outfitter', 'Doomed Traveler', 'Outflank', 'Hateful Eidolon', 'Predator''s Gambit', 'Hymn to Tourach', 'Nearheath Pilgrim', 'Kemba, Kha Regent', 'Diregraf Ghoul', 'Lazotep Reaver', 'Encroaching Wastes', 'Universal Automaton', 'Myr Enforcer', 'Tomb of Urami', 'Light of Promise', 'Fiend Hunter', 'Ghostly Flicker', 'Winding Way', 'Mana Flare', 'Emerge Unscathed', 'Llanowar Visionary', 'Lochmere Serpent', 'Sire of Insanity', 'Cling to Dust', 'Squadron Hawk', 'Blood Seeker', 'Endless Atlas', 'Vedalken Certarch', 'Everflowing Chalice', 'Lodestone Golem', 'Dragon Fodder', 'Orzhov Signet', 'Omen of the Hunt', 'Titan''s Strength', 'Edge of the Divinity', 'Ojutai''s Command', 'Varchild''s War-Riders', 'Vesperlark', 'Volcano Hellion', 'Arlinn Kord', 'Mother Bear', 'Feed the Swarm', 'Progenitor Mimic', 'Survival Cache', 'Stonehorn Dignitary', 'Might of the Masses', 'Day of Judgment', 'Dismal Backwater', 'Blossoming Sands', 'Arrogant Wurm', 'Truefire Captain', 'Helm of the Gods', 'Basking Rootwalla', 'Prophetic Prism', 'Gavony Township', 'Gingerbrute', 'Shalai, Voice of Plenty', 'Forbidden Friendship', 'Cliffhaven Kitesail', 'Champion of the Flame', 'Spoils of Adventure', 'Ajani Goldmane', 'Heartbeat of Spring', 'Kodama''s Reach', 'Howling Mine', 'Darksteel Citadel', 'Marauding Blight-Priest', 'Witch''s Oven', 'Etched Champion', 'Azorius Charm', 'Mire''s Grasp', 'Read the Bones', 'Fevered Visions', 'Death Baron', 'Curse of Death''s Hold', 'Psychic Strike', 'Steel Hellkite', 'Nim Deathmantle', 'Scion of Vitu-Ghazi', 'Piracy Charm', 'Throne of the God-Pharaoh', 'Talisman of Conviction', 'Crumbling Vestige', 'Psychic Spiral', 'Boros Challenger', 'Revel in Riches', 'Lavaclaw Reaches', 'Healing Hands', 'Charnel Troll', 'Zektar Shrine Expedition', 'Kederekt Parasite', 'Browbeat', 'Mystic Sanctuary', 'Selesnya Charm', 'Zhalfirin Void', 'Linvala, Shield of Sea Gate', 'Staff of Nin', 'Lonely Sandbar', 'Krenko''s Command', 'Rakdos Signet', 'Suture Priest', 'Faerie Vandal', 'Beanstalk Giant', 'Firebolt', 'Springleaf Drum', 'Twinflame', 'Precursor Golem', 'Tectonic Edge', 'Fireblade Charger', 'Goblin Matron', 'Logic Knot', 'Treefolk Umbra', 'Blackblade Reforged', 'Weatherlight', 'Base Camp', 'Gruul Turf', 'Lightning Greaves', 'Guilty Conscience', 'Ritual of Rejuvenation', 'Think Twice', 'Séance', 'Kitesail Freebooter', 'Curious Obsession', 'Arcbound Worker', 'Archaeomancer', 'Fire-Lit Thicket', 'Padeem, Consul of Innovation', 'Ajani''s Pridemate', 'Reanimate', 'Puca''s Mischief', 'Gigadrowse', 'Indomitable Ancients', 'Ornithopter', 'Archpriest of Iona', 'Reap the Past', 'Vapor Snag', 'Runed Halo', 'Decree of Justice', 'Frantic Search', 'Prison Realm', 'Frogmite', 'Stuffy Doll', 'Bant Panorama', 'Wayfaring Temple', 'Fleecemane Lion', 'Selvala, Explorer Returned', 'Bala Ged Recovery', 'Kabira Takedown', 'Spikefield Hazard', 'Master of Etherium', 'Gideon Jura', 'Sarcomancy', 'Golgari Rot Farm', 'Ulamog''s Crusher', 'Satyr Wayfinder', 'Mystic Monastery', 'Secluded Steppe', 'Call of the Death-Dweller', 'Call of the Conclave', 'Etherium Sculptor', 'Tradewind Rider', 'Wandering Fumarole', 'Shriekhorn', 'Ruric Thar, the Unbowed', 'Signal Pest', 'Dictate of Kruphix', 'Nihil Spellbomb', 'Deep Analysis', 'Electrolyze', 'Izzet Boilerworks', 'Helm of the Host', 'Displace', 'Thornwood Falls', 'Scavenged Blade', 'Illness in the Ranks', 'Splinter', 'Duskwatch Recruiter', 'Skyclave Cleric', 'Ayula, Queen Among Bears', 'Izzet Charm', 'Ransack the Lab', 'Kefnet the Mindful', 'Alms of the Vein', 'Chandra, Pyromaster', 'Advent of the Wurm', 'Pyroclasm', 'Mwonvuli Acid-Moss', 'Setessan Training', 'Swiftwater Cliffs', 'Pillage', 'Seaside Citadel', 'Huatli, the Sun''s Heart', 'Pore Over the Pages', 'Geth''s Grimoire', 'Fight with Fire', 'Somber Hoverguard', 'Seasoned Hallowblade', 'Goreclaw, Terror of Qal Sisma', 'Dark Ritual', 'Carnophage', 'Sunscour', 'Neoform', 'Nimble Trapfinder', 'Griffin Aerie', 'Augur of Bolas', 'Banefire', 'Vivid Creek', 'Sky Skiff', 'Demigod of Revenge', 'Desecrated Tomb', 'Mina and Denn, Wildborn', 'Blessed Alliance', 'Bygone Bishop', 'Kazuul''s Fury', 'Lead the Stampede', 'Sentinel''s Eyes', 'Pharika''s Libation', 'Mystic Gate', 'Staff of Domination', 'Renewed Faith', 'Phylath, World Sculptor', 'Glimmerpost', 'Liliana''s Triumph', 'Grasslands', 'Alseid of Life''s Bounty', 'Galvanic Blast', 'Dead Weight', 'Bump in the Night', 'Khalni Garden', 'Trygon Predator', 'Battle Hymn', 'Approach of the Second Sun', 'Nightsky Mimic', 'Runeflare Trap', 'Mothdust Changeling', 'Noose Constrictor', 'Vivid Meadow', 'Smallpox', 'Vault of Whispers', 'Invoke the Firemind', 'Go for the Throat', 'Sinister Sabotage', 'Prophet of Kruphix', 'Mana Leak', 'Hordeling Outburst', 'Unsubstantiate', 'Tranquil Thicket', 'Veteran Adventurer', 'Forgotten Cave', 'Daxos, Blessed by the Sun', 'Man-o''-War', 'Rootborn Defenses', 'Reki, the History of Kamigawa', 'Cathartic Reunion', 'Orzhov Basilica', 'Arboreal Grazer', 'Orzhov Charm', 'Captain''s Claws', 'Bad River', 'Akoum Hellhound', 'One with the Machine', 'Selesnya Sanctuary', 'Birds of Paradise', 'Dark Withering', 'Davriel, Rogue Shadowmage', 'Mire Triton', 'Kiora''s Follower', 'Gatekeeper of Malakir', 'Terramorphic Expanse', 'Frantic Inventory', 'Urza''s Factory', 'Animate Dead', 'Sphinx''s Tutelage', 'Judge''s Familiar', 'Quirion Dryad', 'Drown in the Loch', 'Welding Jar', 'Akiri, Fearless Voyager', 'Evolving Wilds', 'Yahenni''s Expertise', 'Syr Konrad, the Grim', 'Kari Zev, Skyship Raider', 'Mishra''s Factory', 'Duress', 'Golgari Findbroker', 'Trespasser''s Curse', 'Cursecatcher', 'Tajuru Paragon', 'Stormfist Crusader', 'Grove of the Guardian', 'Acidic Slime', 'Wipe Away', 'Renata, Called to the Hunt', 'Shizo, Death''s Storehouse', 'Tranquil Cove', 'Phyrexian Tyranny', 'Vendetta', 'Crib Swap', 'Zombie Infestation', 'Temple of Malice', 'Omen of the Forge', 'Graven Cairns', 'Oblivion Ring', 'Worldgorger Dragon', 'Tangled Florahedron', 'Cursed Scroll', 'Midnight Haunting', 'Lotleth Troll', 'Luminarch Ascension', 'Stonehewer Giant', 'Esper Charm', 'Wistful Thinking', 'Dream Trawler', 'Mystic Archaeologist', 'Mortarpod', 'Ivory Tower', 'Beckon Apparition', 'Deep Forest Hermit', 'Endless Horizons', 'Ponder', 'Tajic, Legion''s Edge', 'Dimir Charm', 'Blasphemous Act', 'Smiting Helix', 'Mire''s Toll', 'Haktos the Unscarred', 'Tectonic Giant', 'Cemetery Reaper', 'Deranged Hermit', 'Elvish Visionary', 'Ondu Inversion', 'Grafted Wargear', 'Clackbridge Troll', 'Burst Lightning', 'Crimson Wisps', 'Hunted Nightmare', 'Jeskai Ascendancy', 'Nahiri, Storm of Stone', 'Glory-Bound Initiate', 'Sejiri Shelter', 'Toil // Trouble', 'Spirit Mantle', 'Delver of Secrets', 'Spell Pierce', 'Syr Faren, the Hengehammer', 'Setessan Petitioner', 'Bond of Flourishing', 'Temple of Mystery', 'Kiora, Behemoth Beckoner', 'Selfless Savior', 'Phoenix of Ash', 'Malakir Rebirth', 'Glass of the Guildpact', 'Memnarch', 'Fiery Temper', 'Grim Lavamancer', 'Brainstorm', 'Explore', 'Hyena Umbra', 'Clutch of the Undercity', 'Teferi''s Tutelage', 'All That Glitters', 'Scoured Barrens', 'Artificer''s Assistant', 'Genesis', 'Treefolk Harbinger', 'Temple of Malady', 'Mogg War Marshal', 'Cultivate', 'Fumigate', 'Mesmeric Fiend', 'Concerted Defense', 'Abzan Beastmaster', 'Goblin Gaveleer', 'Condemn', 'Trade Routes', 'Goblin Banneret', 'Champion of Wits', 'Spiteful Visions', 'Grizzly Fate', 'Transcendent Envoy', 'Llanowar Elves', 'Jungle Shrine', 'Hunted Phantasm', 'Flayer Husk', 'Dark Prophecy', 'River of Tears', 'Reassembling Skeleton', 'Laboratory Maniac', 'Alirios, Enraptured', 'Vivien''s Arkbow', 'Heartless Act', 'Garruk Wildspeaker', 'Ovalchase Daredevil', 'Karametra''s Blessing', 'Undead Augur', 'Fact or Fiction', 'Rune Snag', 'Faith''s Fetters', 'Tolsimir, Friend to Wolves', 'Thrill of Possibility', 'Boros Garrison', 'Sarkhan, the Dragonspeaker', 'Wurm''s Tooth', 'Brineborn Cutthroat', 'Stone Haven Outfitter', 'Nip Gwyllion', 'Justice Strike', 'Mystifying Maze', 'Stubborn Denial', 'Brushfire Elemental', 'Coiling Oracle', 'Magmatic Sinkhole', 'Jaddi Offshoot', 'Sunken Ruins', 'Divest', 'Neutralize', 'Tragic Lesson', 'Immolating Souleater', 'Planar Outburst', 'Masked Admirers', 'Easy Prey', 'Frontier Bivouac', 'Calciform Pools', 'Driven // Despair', 'Liquimetal Coating', 'Wild Mongrel', 'Jungle Hollow', 'Dowsing Dagger', 'Deeproot Champion', 'Flaxen Intruder', 'Improbable Alliance', 'Mistveil Plains', 'Giant Killer', 'Ayula''s Influence', 'Wind-Scarred Crag', 'Triplicate Spirits', 'Liliana''s Reaver', 'Banishing Light', 'Aphemia, the Cacophony', 'Ultimate Price', 'Weapons Trainer', 'Stoke the Flames', 'Benevolent Bodyguard', 'Cloudpost', 'Crackling Drake', 'Slagstorm', 'Blackbloom Rogue', 'Dromoka, the Eternal', 'Rush of Knowledge', 'Precinct Captain', 'Grapeshot', 'Flood Plain', 'Vraska''s Contempt', 'Vampire Lacerator', 'Groundskeeper', 'Dreamstealer', 'Zur''s Weirding', 'Blightning', 'Chain Lightning', 'Lone Rider', 'Dynavolt Tower', 'Vivid Marsh', 'Arcane Sanctum', 'Rugged Highlands', 'Buried Ruin', 'Ensoul Artifact', 'Bonesplitter', 'Scrabbling Claws', 'Urza''s Ruinous Blast', 'Nether Traitor', 'Hypnotic Specter', 'Rugged Prairie', 'Cartouche of Solidarity', 'Castigate', 'Primal Amulet', 'Gideon''s Intervention', 'Revitalize', 'Gitaxian Probe', 'Metallic Rebuke', 'Kamahl''s Druidic Vow', 'Migration Path', 'Sandsteppe Citadel', 'Pharika''s Spawn', 'Silundi Vision', 'Field of Ruin', 'Piranha Marsh', 'Ghostfire Blade', 'Mnemonic Wall', 'Sylvan Library', 'Vivid Grove', 'Desperate Ravings', 'Jace''s Archivist', 'Desecration Demon', 'Expedite', 'Orim''s Chant', 'Grand Architect', 'Evolutionary Leap', 'Heliod''s Pilgrim', 'Silence', 'Nomad Outpost', 'Skirk Prospector', 'Myr Landshaper', 'Mythos of Nethroi', 'Ranger of Eos', 'Angelic Gift', 'Conclave Tribunal', 'Intangible Virtue', 'Agonizing Remorse', 'Dusk // Dawn', 'Forbidden Alchemy', 'Opt', 'Burning Inquiry', 'Plow Under', 'Divinity of Pride', 'Dimir Aqueduct', 'Disfigure', 'Angrath''s Rampage', 'Ayli, Eternal Pilgrim', 'Ebony Owl Netsuke', 'Chief of the Foundry', 'Deprive', 'Drana''s Emissary', 'Ethersworn Canonist', 'Temple of Silence', 'Rosheen Meanderer', 'Abzan Charm', 'Dovin, Hand of Control', 'Temple of Triumph', 'Sprout Swarm', 'Jace Beleren', 'Forked Bolt', 'Tyrant''s Choice', 'Thornling'))) AND (TRUE)
GROUP BY
d.id,
d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
HAVING
TRUE
ORDER BY
active_date DESC, d.finish IS NULL, d.finish
```
[]
(slow_query, 99.0, mysql)
Reported on decksite by mysql-perf
Location Hash: b29c1931f05797b8c1fceb71e506a56b639183e5
Labels: decksite
Exceeded slow_query limit (184.7 > 30.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
(
SELECT
`start`.id,
`start`.code,
`start`.start_date AS start_date,
`end`.start_date AS end_date
FROM
season AS `start`
LEFT JOIN
season AS `end` ON `end`.id = `start`.id + 1
) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)
WHERE
(d.id IN (SELECT deck_id FROM deck_card WHERE card IN ('Bonesplitter', 'Mana Leak', 'Ritual of Rejuvenation', 'Putrid Imp', 'Puca''s Mischief', 'Alms of the Vein', 'Forbidden Alchemy', 'Gideon Jura', 'Approach of the Second Sun', 'Read the Bones', 'Kitesail Freebooter', 'Swiftwater Cliffs', 'Malakir Rebirth', 'Desperate Ravings', 'Vivid Grove', 'Howling Mine', 'Spoils of Adventure', 'Improbable Alliance', 'Burning Inquiry', 'Divinity of Pride', 'Clutch of the Undercity', 'Grasslands', 'Sprite Dragon', 'Hunted Nightmare', 'Mortarpod', 'Divest', 'Gatekeeper of Malakir', 'Unsubstantiate', 'Slagstorm', 'Liliana''s Reaver', 'Lazotep Reaver', 'Vendetta', 'Sprout Swarm', 'Ojutai''s Command', 'Artificer''s Assistant', 'Sandsteppe Citadel', 'Mwonvuli Acid-Moss', 'Sinister Sabotage', 'Driven // Despair', 'Marauding Blight-Priest', 'Heartless Act', 'Agonizing Remorse', 'Zada, Hedron Grinder', 'Llanowar Visionary', 'Kodama''s Reach', 'Battle Hymn', 'Mesmeric Fiend', 'Orzhov Charm', 'Jace''s Archivist', 'Volcano Hellion', 'Renata, Called to the Hunt', 'Vraska''s Contempt', 'Fling', 'Master of Etherium', 'Midnight Haunting', 'Deep Analysis', 'Hyena Umbra', 'Summer Bloom', 'Jeskai Ascendancy', 'Primal Amulet', 'Vivid Creek', 'Geth''s Grimoire', 'Dictate of Kruphix', 'Worldgorger Dragon', 'Arlinn Kord', 'Selesnya Sanctuary', 'Skirk Prospector', 'Graven Cairns', 'Castigate', 'Vault of Whispers', 'Terramorphic Expanse', 'Grapeshot', 'Renewed Faith', 'Champion of the Flame', 'Commune with the Gods', 'Temple of Malady', 'Deranged Hermit', 'Reanimate', 'Reassembling Skeleton', 'Skinshifter', 'Ajani Goldmane', 'Nip Gwyllion', 'Khalni Garden', 'Gruul Turf', 'Tomb of Urami', 'Sunken Ruins', 'Ayula, Queen Among Bears', 'Kabira Takedown', 'Brave the Sands', 'Think Twice', 'Wurm''s Tooth', 'Tormenting Voice', 'Bond of Flourishing', 'Pillage', 'Chain Lightning', 'Guilty Conscience', 'Darksteel Citadel', 'Mire''s Grasp', 'Go for the Throat', 'Goreclaw, Terror of Qal Sisma', 'River of Tears', 'Tranquil Thicket', 'Rakdos Signet', 'Burst Lightning', 'Dreamstealer', 'Cut // Ribbons', 'Ethersworn Canonist', 'Desecration Demon', 'Reap the Past', 'Mystic Monastery', 'Captain''s Claws', 'Spell Pierce', 'Sunscour', 'Benevolent Bodyguard', 'Mystifying Maze', 'Dimir Aqueduct', 'Gigadrowse', 'Ghostly Flicker', 'Vivien''s Arkbow', 'Ponder', 'Splinter', 'Boros Reckoner', 'Dosan the Falling Leaf', 'Azorius Charm', 'Clackbridge Troll', 'Temple of Malice', 'Wipe Away', 'Llanowar Elves', 'Boomerang', 'Arcbound Worker', 'Groundskeeper', 'Dark Prophecy', 'Revel in Riches', 'Tajuru Paragon', 'Gingerbrute', 'Lonely Sandbar', 'Urza''s Factory', 'Indomitable Ancients', 'Kederekt Parasite', 'Aphemia, the Cacophony', 'Arcane Sanctum', 'Sky Skiff', 'Liliana''s Caress', 'Orim''s Chant', 'Lone Rider', 'Stormfist Crusader', 'Tombstalker', 'Squadron Hawk', 'Luminarch Ascension', 'Dark Ritual', 'Spiteful Visions', 'Prophetic Prism', 'Cling to Dust', 'Hateful Eidolon', 'Hypnotic Specter', 'Brainstorm', 'Beckon Apparition', 'Yahenni''s Expertise', 'Dusk // Dawn', 'Smallpox', 'Etherium Sculptor', 'Crib Swap', 'Bloodhall Priest', 'Tajic, Legion''s Edge', 'Shalai, Voice of Plenty', 'Reki, the History of Kamigawa', 'Mogg War Marshal', 'Ondu Inversion', 'Basking Rootwalla', 'Avacyn''s Pilgrim', 'Ornithopter', 'Staff of Domination', 'Golgari Rot Farm', 'Duress', 'Faerie Vandal', 'Kambal, Consul of Allocation', 'Hunted Phantasm', 'Grand Architect', 'Forbidden Friendship', 'Healing Hands', 'Boros Challenger', 'Winding Way', 'Falkenrath Gorger', 'Goblin Matron', 'Liquimetal Coating', 'Ensoul Artifact', 'Mire''s Toll', 'Tolsimir, Friend to Wolves', 'Gideon''s Intervention', 'Sylvan Library', 'Grave Scrabbler', 'Seaside Citadel', 'Masked Admirers', 'Ruin Crab', 'Revitalize', 'Ransack the Lab', 'Walk the Aeons', 'Forked Bolt', 'Mythos of Nethroi', 'Rosheen Meanderer', 'Truefire Captain', 'Karametra''s Blessing', 'Phyrexian Tyranny', 'Heartbeat of Spring', 'Ayli, Eternal Pilgrim', 'Cultivate', 'Nahiri, Storm of Stone', 'Akoum Hellhound', 'Treefolk Harbinger', 'Champion of Wits', 'Universal Automaton', 'Varchild''s War-Riders', 'Scoured Barrens', 'Elvish Visionary', 'Boros Garrison', 'All That Glitters', 'Call of the Conclave', 'Setessan Petitioner', 'Witch''s Oven', 'Easy Prey', 'Lodestone Golem', 'Mother Bear', 'Lightning Greaves', 'Wooded Bastion', 'Chandra, Pyromaster', 'Immolating Souleater', 'Jaddi Offshoot', 'Galvanic Blast', 'Tectonic Edge', 'Mothdust Changeling', 'Seasoned Hallowblade', 'Judge''s Familiar', 'Delver of Secrets', 'Orzhov Basilica', 'Advent of the Wurm', 'Nim Deathmantle', 'Birds of Paradise', 'Mnemonic Wall', 'Nearheath Pilgrim', 'Fiery Temper', 'Fiend Hunter', 'Expedite', 'Magmatic Sinkhole', 'Dark Withering', 'Wild Mongrel', 'Kamahl''s Druidic Vow', 'Tradewind Rider', 'Fight with Fire', 'Arboreal Grazer', 'Evolving Wilds', 'Forgotten Cave', 'Rugged Highlands', 'Vivid Marsh', 'Veteran Adventurer', 'Helm of the Gods', 'Séance', 'Talisman of Conviction', 'Twinflame', 'Navigator''s Compass', 'Encroaching Wastes', 'Phoenix of Ash', 'Browbeat', 'Grove of the Guardian', 'Lochmere Serpent', 'Mimic Vat', 'Firebolt', 'Endless Horizons', 'Fumigate', 'Explore', 'Fleecemane Lion', 'Flaxen Intruder', 'Sarcomancy', 'Cliffhaven Kitesail', 'Zhalfirin Void', 'Goblin Gaveleer', 'Skyclave Cleric', 'Zur''s Weirding', 'Temple of Triumph', 'Runeflare Trap', 'Glissa Sunseeker', 'Krenko''s Command', 'Blackbloom Rogue', 'Feed the Swarm', 'Dismal Backwater', 'Temple of Silence', 'Blackblade Reforged', 'Cloudpost', 'Jungle Hollow', 'Banishing Light', 'Edge of the Divinity', 'Triplicate Spirits', 'Cursed Scroll', 'Dynavolt Tower', 'Golgari Findbroker', 'Archaeomancer', 'Evolutionary Leap', 'Jungle Shrine', 'Mystic Archaeologist', 'Transcendent Envoy', 'Mystic Sanctuary', 'Dovin, Hand of Control', 'Psychic Spiral', 'Kiora''s Follower', 'Zombie Infestation', 'Carnophage', 'Cranial Plating', 'Deep Forest Hermit', 'Mire Triton', 'Deprive', 'Kiora, Behemoth Beckoner', 'Wistful Thinking', 'Tragic Lesson', 'Conclave Tribunal', 'Jace Beleren', 'Staff of Nin', 'Day of Judgment', 'Drown in the Loch', 'Ranger of Eos', 'Esper Charm', 'Suture Priest', 'Brushfire Elemental', 'Nimbus Maze', 'Dream Trawler', 'Genesis', 'Bant Panorama', 'Nimble Trapfinder', 'Weatherlight', 'Crumbling Vestige', 'Dragon Fodder', 'Signal Pest', 'Death Baron', 'Dromoka, the Eternal', 'Rhys the Redeemed', 'Metallic Rebuke', 'Vindicate', 'Goblin Dark-Dwellers', 'Izzet Boilerworks', 'Rune Snag', 'Mistveil Plains', 'Ebony Owl Netsuke', 'Akiri, Fearless Voyager', 'Animate Dead', 'Sentinel''s Eyes', 'Scion of Vitu-Ghazi', 'Decree of Justice', 'Artisan of Kozilek', 'Everflowing Chalice', 'Throne of the God-Pharaoh', 'Flood Plain', 'Mishra''s Factory', 'Blightning', 'Progenitor Mimic', 'Syr Faren, the Hengehammer', 'Temple of Mystery', 'Giant Killer', 'Frantic Inventory', 'Scavenged Blade', 'Somber Hoverguard', 'Blood Seeker', 'Vampire Lacerator', 'Welding Jar', 'Spirit Mantle', 'Treefolk Umbra', 'Field of Ruin', 'Titan''s Strength', 'Alirios, Enraptured', 'Myr Landshaper', 'Syr Konrad, the Grim', 'Crackling Drake', 'Displace', 'Selesnya Charm', 'Ulamog''s Crusher', 'Selfless Savior', 'The Antiquities War', 'Nomad Outpost', 'Grim Lavamancer', 'Izzet Charm', 'Silence', 'Call of the Death-Dweller', 'Dowsing Dagger', 'Memnarch', 'Piracy Charm', 'Secluded Steppe', 'Nihil Spellbomb', 'Neutralize', 'Cathartic Reunion', 'Ghostfire Blade', 'Steel Hellkite', 'Cursecatcher', 'Tectonic Giant', 'Sejiri Shelter', 'Neoform', 'Rugged Prairie', 'Man-o''-War', 'Abzan Charm', 'Frogmite', 'Wandering Fumarole', 'Psychic Strike', 'Doomed Traveler', 'Haktos the Unscarred', 'Sarkhan, the Dragonspeaker', 'Sign in Blood', 'Thornling', 'Planar Outburst', 'Bad River', 'Tangled Florahedron', 'Justice Strike', 'Rootborn Defenses', 'Ivory Tower', 'Deeproot Champion', 'Bala Ged Recovery', 'One with the Machine', 'Thrill of Possibility', 'Fireblade Charger', 'Weapons Trainer', 'Opt', 'Zektar Shrine Expedition', 'Abzan Beastmaster', 'Helm of the Host', 'Crimson Wisps', 'Oblivion Ring', 'Endless Atlas', 'Angrath''s Rampage', 'Mina and Denn, Wildborn', 'Ultimate Price', 'Bygone Bishop', 'Blasphemous Act', 'Prison Realm', 'Forbid', 'Pharika''s Libation', 'Dead Weight', 'Tyrant''s Choice', 'Vapor Snag', 'Buried Ruin', 'Rush of Knowledge', 'Glass of the Guildpact', 'Tranquil Cove', 'Pathrazer of Ulamog', 'Liliana''s Triumph', 'Mogis''s Marauder', 'Banefire', 'Silundi Vision', 'Orzhov Signet', 'Nether Traitor', 'Gitaxian Probe', 'Desecrated Tomb', 'Teferi''s Tutelage', 'Cloudstone Curio', 'Dovin''s Veto', 'Huatli, the Sun''s Heart', 'Exhaustion', 'Electrolyze', 'Arrogant Wurm', 'Legion Angel', 'Archpriest of Iona', 'Cartouche of Solidarity', 'Asylum Visitor', 'Sphinx''s Tutelage', 'Ovalchase Daredevil', 'Precinct Captain', 'Heliod''s Pilgrim', 'Disfigure', 'Wind-Scarred Crag', 'Satyr Wayfinder', 'Vivid Meadow', 'Toil // Trouble', 'Scrabbling Claws', 'Outflank', 'Fire-Lit Thicket', 'Plow Under', 'Turnabout', 'Stoke the Flames', 'Angelic Gift', 'Frantic Search', 'Treasure Cruise', 'Trade Routes', 'Migration Path', 'Undead Augur', 'Cauldron Familiar', 'Kazuul''s Fury', 'Predator''s Gambit', 'Logic Knot', 'Phylath, World Sculptor', 'Urza''s Ruinous Blast', 'Acidic Slime', 'Smiting Helix', 'Shizo, Death''s Storehouse', 'Eternal Dragon', 'Spikefield Hazard', 'Might of the Masses', 'Precursor Golem', 'Sire of Insanity', 'Lavaclaw Reaches', 'Runed Halo', 'Blossoming Sands', 'Mystic Gate', 'Stubborn Denial', 'Fetid Heath', 'Garruk Wildspeaker', 'Setessan Training', 'Omen of the Forge', 'Gavony Township', 'Wayfaring Temple', 'Kari Zev, Skyship Raider', 'Alseid of Life''s Bounty', 'Stone Haven Outfitter', 'Glory-Bound Initiate', 'Demigod of Revenge', 'Thornwood Falls', 'Vedalken Certarch', 'Drana''s Emissary', 'Faith''s Fetters', 'Nightsky Mimic', 'Stonehewer Giant', 'Invoke the Firemind', 'Frontier Bivouac', 'Daxos, Blessed by the Sun', 'Ruric Thar, the Unbowed', 'Omen of the Hunt', 'Kemba, Kha Regent', 'Base Camp', 'Pharika''s Spawn', 'Stonehorn Dignitary', 'Keep Safe', 'Goblin Assault', 'Linvala, Shield of Sea Gate', 'Illness in the Ranks', 'Survival Cache', 'Stuffy Doll', 'Ajani''s Pridemate', 'Coiling Oracle', 'Davriel, Rogue Shadowmage', 'Mana Flare', 'Prophet of Kruphix', 'Crumbling Necropolis', 'Flayer Husk', 'Fevered Visions', 'Condemn', 'Light of Promise', 'Selvala, Explorer Returned', 'Diregraf Ghoul', 'Hordeling Outburst', 'Quirion Dryad', 'Calciform Pools', 'Fact or Fiction', 'Duskwatch Recruiter', 'Glimmerpost', 'Kor Outfitter', 'Lead the Stampede', 'Emerge Unscathed', 'Etched Champion', 'Blessed Alliance', 'Noose Constrictor', 'Spellbook', 'Dimir Charm', 'Trespasser''s Curse', 'Goblin Banneret', 'Call the Bloodline', 'Intangible Virtue', 'Trygon Predator', 'Beanstalk Giant', 'Curious Obsession', 'Piranha Marsh', 'Pyroclasm', 'Pore Over the Pages', 'Shriekhorn', 'Concerted Defense', 'Cemetery Reaper', 'Padeem, Consul of Innovation', 'Ayula''s Influence', 'Griffin Aerie', 'Grizzly Fate', 'Lotleth Troll', 'Grafted Wargear', 'Augur of Bolas', 'Chief of the Foundry', 'Laboratory Maniac', 'Hymn to Tourach', 'Springleaf Drum', 'Kefnet the Mindful', 'Brineborn Cutthroat', 'Curse of Death''s Hold', 'Charnel Troll', 'Tidehollow Sculler', 'Vesperlark', 'Myr Enforcer', 'Bump in the Night', 'Soul''s Attendant'))) AND (TRUE)
GROUP BY
d.id,
d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
HAVING
TRUE
ORDER BY
active_date DESC, d.finish IS NULL, d.finish
```
[]
(slow_query, 184.7, mysql)
Reported on decksite by mysql-perf
Location Hash: b29c1931f05797b8c1fceb71e506a56b639183e5
Labels: decksite
Exceeded slow_query limit (61.8 > 30.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
(
SELECT
`start`.id,
`start`.code,
`start`.start_date AS start_date,
`end`.start_date AS end_date
FROM
season AS `start`
LEFT JOIN
season AS `end` ON `end`.id = `start`.id + 1
) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)
WHERE
(d.id IN (SELECT deck_id FROM deck_card WHERE card IN ('Heartless Act', 'Flaxen Intruder', 'Unsubstantiate', 'Weapons Trainer', 'Wild Mongrel', 'Phyrexian Tyranny', 'Sylvan Library', 'Fling', 'Beanstalk Giant', 'Base Camp', 'Vault of Whispers', 'Ultimate Price', 'Tolsimir, Friend to Wolves', 'Abzan Beastmaster', 'Forked Bolt', 'Pore Over the Pages', 'Prison Realm', 'Temple of Malice', 'Coiling Oracle', 'Rugged Highlands', 'Hyena Umbra', 'Birds of Paradise', 'Fiend Hunter', 'Wandering Fumarole', 'Exhaustion', 'Encroaching Wastes', 'Chandra, Pyromaster', 'Ebony Owl Netsuke', 'Secluded Steppe', 'Go for the Throat', 'Wooded Bastion', 'Vendetta', 'Keep Safe', 'Fire-Lit Thicket', 'Prophetic Prism', 'Jungle Shrine', 'Triplicate Spirits', 'Eternal Dragon', 'Lone Rider', 'Heliod''s Pilgrim', 'Setessan Petitioner', 'Ritual of Rejuvenation', 'Staff of Nin', 'Veteran Adventurer', 'Invoke the Firemind', 'Pharika''s Libation', 'Cultivate', 'Scrabbling Claws', 'Read the Bones', 'Hordeling Outburst', 'Izzet Boilerworks', 'Glimmerpost', 'Asylum Visitor', 'Universal Automaton', 'Vivien''s Arkbow', 'Day of Judgment', 'Selvala, Explorer Returned', 'Vivid Creek', 'Padeem, Consul of Innovation', 'Desperate Ravings', 'Wipe Away', 'Truefire Captain', 'Bump in the Night', 'Fight with Fire', 'Reassembling Skeleton', 'Syr Faren, the Hengehammer', 'Kamahl''s Druidic Vow', 'Zektar Shrine Expedition', 'Soul''s Attendant', 'Goblin Gaveleer', 'Survival Cache', 'Disfigure', 'Chain Lightning', 'Captain''s Claws', 'Tyrant''s Choice', 'Blessed Alliance', 'Mishra''s Factory', 'Dusk // Dawn', 'Illness in the Ranks', 'Etherium Sculptor', 'Tombstalker', 'Daxos, Blessed by the Sun', 'Charnel Troll', 'Genesis', 'Artificer''s Assistant', 'Expedite', 'Augur of Bolas', 'Izzet Charm', 'Divinity of Pride', 'Runed Halo', 'Approach of the Second Sun', 'Safehold Elite', 'Urza''s Ruinous Blast', 'Giant Killer', 'Primal Amulet', 'Desecration Demon', 'Alseid of Life''s Bounty', 'Gideon Jura', 'Trygon Predator', 'Blossoming Sands', 'Ulamog''s Crusher', 'Vivid Grove', 'Zhalfirin Void', 'Death Baron', 'Psychic Spiral', 'Burning Inquiry', 'Dryad Militant', 'Demigod of Revenge', 'Ethersworn Canonist', 'Light of Promise', 'Predator''s Gambit', 'Howling Mine', 'Grove of the Guardian', 'Beckon Apparition', 'Lazotep Reaver', 'Mana Flare', 'Rugged Prairie', 'Khalni Garden', 'Ayula, Queen Among Bears', 'Brainstorm', 'Grapeshot', 'Intangible Virtue', 'Transcendent Envoy', 'Dromoka, the Eternal', 'Cloudpost', 'Liquimetal Coating', 'Nahiri, Storm of Stone', 'Arboreal Grazer', 'Dovin, Hand of Control', 'Marauding Blight-Priest', 'Spikefield Hazard', 'Revitalize', 'Skinshifter', 'Archaeomancer', 'Temple of Silence', 'Wind-Scarred Crag', 'Squadron Hawk', 'Kambal, Consul of Allocation', 'Grave Scrabbler', 'Geth''s Grimoire', 'Endless Horizons', 'Mana Leak', 'Stubborn Denial', 'Concerted Defense', 'Goblin Assault', 'Nether Traitor', 'Silundi Vision', 'Grasslands', 'Banefire', 'Jungle Hollow', 'Advent of the Wurm', 'Liliana''s Triumph', 'Loxodon Smiter', 'Burst Lightning', 'Call the Bloodline', 'Tranquil Thicket', 'Sandsteppe Citadel', 'Dreamstealer', 'Mystic Sanctuary', 'Setessan Training', 'Sunscour', 'Champion of Wits', 'Blackblade Reforged', 'Dream Trawler', 'Everflowing Chalice', 'Tidehollow Sculler', 'Goblin Banneret', 'Ghostly Flicker', 'Knight of New Alara', 'Opt', 'Mystic Gate', 'Angelic Gift', 'Sire of Insanity', 'Ruric Thar, the Unbowed', 'Zombie Infestation', 'Lotleth Troll', 'Lonely Sandbar', 'Scoured Barrens', 'Cling to Dust', 'Laboratory Maniac', 'Electrolyze', 'Falkenrath Gorger', 'Yasharn, Implacable Earth', 'Calciform Pools', 'Armadillo Cloak', 'Psychic Strike', 'Displace', 'Noose Constrictor', 'Artisan of Kozilek', 'Rootborn Defenses', 'Champion of the Flame', 'Nearheath Pilgrim', 'Migration Path', 'Pharika''s Spawn', 'Neoform', 'Cartouche of Solidarity', 'Deranged Hermit', 'Spellbook', 'Tormenting Voice', 'Weatherlight', 'Azorius Charm', 'Ghostfire Blade', 'Deep Forest Hermit', 'Selfless Savior', 'Splinter', 'Smallpox', 'Battle Hymn', 'Feed the Swarm', 'Buried Ruin', 'Sentinel''s Eyes', 'Thornling', 'Selesnya Sanctuary', 'Nightsky Mimic', 'Yahenni''s Expertise', 'Golgari Rot Farm', 'Decree of Justice', 'Animate Dead', 'Chief of the Foundry', 'Glass of the Guildpact', 'Ruin Crab', 'Omen of the Hunt', 'Crumbling Vestige', 'Sinister Sabotage', 'Reki, the History of Kamigawa', 'Titan''s Strength', 'Boomerang', 'Lavaclaw Reaches', 'Divest', 'Putrid Imp', 'Ovalchase Daredevil', 'Llanowar Visionary', 'Alms of the Vein', 'Dragon Fodder', 'Bant Panorama', 'Bloodhall Priest', 'Gatekeeper of Malakir', 'Mythos of Nethroi', 'Llanowar Elves', 'Tectonic Giant', 'Vampire Lacerator', 'Improbable Alliance', 'Shriekhorn', 'Grand Architect', 'Kodama''s Reach', 'Conclave Tribunal', 'Faerie Vandal', 'Arcbound Worker', 'Fevered Visions', 'Stone Haven Outfitter', 'Cauldron Familiar', 'Driven // Despair', 'Desecrated Tomb', 'Curse of Death''s Hold', 'Bala Ged Recovery', 'Cemetery Reaper', 'Dismal Backwater', 'Hunted Nightmare', 'Cursecatcher', 'Vraska''s Contempt', 'Dark Prophecy', 'Cloudstone Curio', 'Varchild''s War-Riders', 'Deeproot Champion', 'Precursor Golem', 'Teferi''s Tutelage', 'Hunted Phantasm', 'Boros Garrison', 'Treasure Cruise', 'Pillage', 'Crackling Drake', 'Myr Landshaper', 'Garruk Wildspeaker', 'Call of the Death-Dweller', 'Sphinx''s Tutelage', 'Glory-Bound Initiate', 'Angrath''s Rampage', 'Grafted Wargear', 'Mesmeric Fiend', 'Galvanic Blast', 'Kari Zev, Skyship Raider', 'Nimble Trapfinder', 'Reap the Past', 'Terramorphic Expanse', 'Mistveil Plains', 'Tectonic Edge', 'Legion Angel', 'Basking Rootwalla', 'Bad River', 'Lochmere Serpent', 'Linvala, Shield of Sea Gate', 'Mystic Monastery', 'Boros Reckoner', 'Trespasser''s Curse', 'Rune Snag', 'Skirk Prospector', 'Akiri, Fearless Voyager', 'Bond of Flourishing', 'Frantic Search', 'Heartbeat of Spring', 'Darksteel Citadel', 'Mother Bear', 'Winding Way', 'Mortarpod', 'Piranha Marsh', 'Dimir Aqueduct', 'Mothdust Changeling', 'Kazuul''s Fury', 'Flayer Husk', 'Tajic, Legion''s Edge', 'Thrill of Possibility', 'Fiery Temper', 'Treefolk Umbra', 'Blackbloom Rogue', 'Navigator''s Compass', 'Shalai, Voice of Plenty', 'Justice Strike', 'Magmatic Sinkhole', 'Sign in Blood', 'One with the Machine', 'Vedalken Certarch', 'Liliana''s Reaver', 'Goblin Dark-Dwellers', 'Scion of Vitu-Ghazi', 'Mnemonic Wall', 'Cut // Ribbons', 'Brave the Sands', 'Sarkhan, the Dragonspeaker', 'Curious Obsession', 'Trade Routes', 'Nimbus Maze', 'Treefolk Harbinger', 'Kor Outfitter', 'Fumigate', 'Akoum Hellhound', 'Stuffy Doll', 'Kiora''s Follower', 'Tragic Lesson', 'Rhys the Redeemed', 'Graven Cairns', 'Suture Priest', 'Wurm''s Tooth', 'Ransack the Lab', 'Griffin Aerie', 'Etched Champion', 'Vapor Snag', 'Undead Augur', 'Progenitor Mimic', 'Kitesail Freebooter', 'Groundskeeper', 'Sunken Ruins', 'Gitaxian Probe', 'Midnight Haunting', 'Might of the Masses', 'Dark Ritual', 'Forbidden Alchemy', 'Séance', 'Sejiri Shelter', 'Sprite Dragon', 'Wayfaring Temple', 'Temple of Mystery', 'Emerge Unscathed', 'Doomed Traveler', 'Gruul Turf', 'Man-o''-War', 'Cliffhaven Kitesail', 'Karametra''s Blessing', 'Arlinn Kord', 'Mina and Denn, Wildborn', 'Esper Charm', 'Tangled Florahedron', 'Browbeat', 'Commune with the Gods', 'Kabira Takedown', 'Bronzehide Lion', 'Luminarch Ascension', 'Call of the Conclave', 'Malakir Rebirth', 'Gingerbrute', 'Vivid Marsh', 'Ayli, Eternal Pilgrim', 'Mogg War Marshal', 'Forbidden Friendship', 'Huatli, the Sun''s Heart', 'Liliana''s Caress', 'Hateful Eidolon', 'Seasoned Hallowblade', 'Ajani Goldmane', 'Easy Prey', 'Frogmite', 'Brushfire Elemental', 'Phoenix of Ash', 'Lead the Stampede', 'Golgari Findbroker', 'Forgotten Cave', 'Judge''s Familiar', 'Field of Ruin', 'Omen of the Forge', 'Fireblade Charger', 'Vindicate', 'Bygone Bishop', 'Endless Atlas', 'Firebolt', 'Cranial Plating', 'Walk the Aeons', 'Dowsing Dagger', 'Goblin Matron', 'Ponder', 'Toil // Trouble', 'Orim''s Chant', 'Condemn', 'Pyroclasm', 'Turnabout', 'Mystifying Maze', 'Immolating Souleater', 'Indomitable Ancients', 'Spell Pierce', 'Lodestone Golem', 'Prophet of Kruphix', 'Edge of the Divinity', 'Forbid', 'Frantic Inventory', 'Gigadrowse', 'Grizzly Fate', 'Temple of Triumph', 'Ornithopter', 'Dictate of Kruphix', 'Dead Weight', 'Vesperlark', 'Diregraf Ghoul', 'Swiftwater Cliffs', 'Spirit Mantle', 'Evolving Wilds', 'Silence', 'Springleaf Drum', 'Blood Seeker', 'Avacyn''s Pilgrim', 'Arcane Sanctum', 'Jaddi Offshoot', 'Welding Jar', 'Dauntless Escort', 'Metallic Rebuke', 'Kederekt Parasite', 'Scavenged Blade', 'Orzhov Charm', 'Ensoul Artifact', 'Tajuru Paragon', 'Dovin''s Veto', 'Sprout Swarm', 'Haktos the Unscarred', 'Duress', 'Renewed Faith', 'Drana''s Emissary', 'Mimic Vat', 'Selesnya Charm', 'Lightning Greaves', 'Spoils of Adventure', 'Blasphemous Act', 'Outflank', 'Vivid Meadow', 'Skyclave Cleric', 'Reanimate', 'Neutralize', 'Brineborn Cutthroat', 'Castigate', 'Mwonvuli Acid-Moss', 'Twinflame', 'Temple of Malady', 'Rush of Knowledge', 'Master of Etherium', 'Runeflare Trap', 'Masked Admirers', 'Helm of the Gods', 'Faith''s Fetters', 'Slagstorm', 'Urza''s Factory', 'Zur''s Weirding', 'Revel in Riches', 'Helm of the Host', 'Pathrazer of Ulamog', 'Kefnet the Mindful', 'Gavony Township', 'Sarcomancy', 'Clackbridge Troll', 'Fleecemane Lion', 'Evolutionary Leap', 'Blightning', 'Banishing Light', 'Worldgorger Dragon', 'Tomb of Urami', 'Witch''s Oven', 'Summer Bloom', 'Ranger of Eos', 'Deep Analysis', 'Tranquil Cove', 'Nihil Spellbomb', 'Stormfist Crusader', 'Ojutai''s Command', 'Renata, Called to the Hunt', 'Frontier Bivouac', 'Wistful Thinking', 'Deprive', 'Staff of Domination', 'Mogis''s Marauder', 'Memnarch', 'Stonehorn Dignitary', 'Explore', 'Steel Hellkite', 'Kemba, Kha Regent', 'Crumbling Necropolis', 'Clutch of the Undercity', 'Dimir Charm', 'Zada, Hedron Grinder', 'Guilty Conscience', 'Mire''s Grasp', 'Stonehewer Giant', 'Hypnotic Specter', 'Glissa Sunseeker', 'Aphemia, the Cacophony', 'Spiteful Visions', 'Healing Hands', 'Shizo, Death''s Storehouse', 'Myr Enforcer', 'Bonesplitter', 'Precinct Captain', 'Orzhov Basilica', 'Logic Knot', 'Alirios, Enraptured', 'Stoke the Flames', 'Plow Under', 'Planar Outburst', 'Cathartic Reunion', 'Satyr Wayfinder', 'Signal Pest', 'Ayula''s Influence', 'Crib Swap', 'Krenko''s Command', 'Somber Hoverguard', 'Syr Konrad, the Grim', 'Quirion Dryad', 'Acidic Slime', 'Arrogant Wurm', 'Puca''s Mischief', 'Nip Gwyllion', 'Orzhov Signet', 'Elvish Visionary', 'Seaside Citadel', 'Piracy Charm', 'Hymn to Tourach', 'Agonizing Remorse', 'Tradewind Rider', 'Nomad Outpost', 'Ondu Inversion', 'Mire Triton', 'Fetid Heath', 'Dosan the Falling Leaf', 'Sky Skiff', 'Jace Beleren', 'Archpriest of Iona', 'Nim Deathmantle', 'Thornwood Falls', 'Jeskai Ascendancy', 'Rosheen Meanderer', 'Mire''s Toll', 'Phylath, World Sculptor', 'Mystic Archaeologist', 'Cursed Scroll', 'Carnophage', 'Smiting Helix', 'Volcano Hellion', 'Dynavolt Tower', 'Kiora, Behemoth Beckoner', 'Talisman of Conviction', 'Duskwatch Recruiter', 'Gideon''s Intervention', 'Flood Plain', 'Fact or Fiction', 'Think Twice', 'Jace''s Archivist', 'Benevolent Bodyguard', 'All That Glitters', 'Crimson Wisps', 'Boros Challenger', 'Abzan Charm', 'Ivory Tower', 'River of Tears', 'Drown in the Loch', 'Oblivion Ring', 'Throne of the God-Pharaoh', 'The Antiquities War', 'Delver of Secrets', 'Ajani''s Pridemate', 'Rakdos Signet', 'Goreclaw, Terror of Qal Sisma', 'Grim Lavamancer', 'Davriel, Rogue Shadowmage', 'Dark Withering'))) AND (TRUE)
GROUP BY
d.id,
d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
HAVING
TRUE
ORDER BY
active_date DESC, d.finish IS NULL, d.finish
```
[]
(slow_query, 61.8, mysql)
Reported on decksite by mysql-perf
Location Hash: b29c1931f05797b8c1fceb71e506a56b639183e5
Labels: decksite
Exceeded slow_query limit (44.1 > 30.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
(
SELECT
`start`.id,
`start`.code,
`start`.start_date AS start_date,
`end`.start_date AS end_date
FROM
season AS `start`
LEFT JOIN
season AS `end` ON `end`.id = `start`.id + 1
) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)
WHERE
(d.id IN (SELECT deck_id FROM deck_card WHERE card IN ('Go for the Throat', 'Decree of Justice', 'Terramorphic Expanse', 'Etched Champion', 'Lodestone Golem', 'Field of Ruin', 'Tolsimir, Friend to Wolves', 'All That Glitters', 'Driven // Despair', 'Chain Lightning', 'Khalni Garden', 'Duress', 'Thrill of Possibility', 'Karametra''s Blessing', 'Castigate', 'Genesis', 'Vedalken Certarch', 'Ghostfire Blade', 'Ivory Tower', 'Sejiri Shelter', 'Displace', 'Pyromancer Ascension', 'Zada, Hedron Grinder', 'Advent of the Wurm', 'Syr Konrad, the Grim', 'Winding Way', 'Varolz, the Scar-Striped', 'Gruul Turf', 'Augur of Bolas', 'Spikefield Hazard', 'Brineborn Cutthroat', 'Mother Bear', 'Tragic Lesson', 'Dryad Militant', 'Hunted Nightmare', 'Demigod of Revenge', 'Vivid Marsh', 'Cauldron Familiar', 'Stonehewer Giant', 'Rugged Prairie', 'Ritual of Rejuvenation', 'Battle Hymn', 'Blackbloom Rogue', 'Prophet of Kruphix', 'Grim Lavamancer', 'Call of the Conclave', 'Welding Jar', 'Swiftwater Cliffs', 'Nip Gwyllion', 'Ayula, Queen Among Bears', 'Drana''s Emissary', 'Talisman of Conviction', 'Bump in the Night', 'Kamahl''s Druidic Vow', 'Prison Realm', 'Benevolent Bodyguard', 'Mana Leak', 'Worldgorger Dragon', 'Metallic Rebuke', 'Fetid Heath', 'Avacyn''s Pilgrim', 'Mystic Sanctuary', 'Zhalfirin Void', 'Walk the Aeons', 'Archpriest of Iona', 'Hunted Phantasm', 'Oblivion Ring', 'Captain''s Claws', 'Grove of the Guardian', 'Might of the Masses', 'Kitesail Freebooter', 'Galvanic Blast', 'Forked Bolt', 'Selesnya Sanctuary', 'Lead the Stampede', 'Satyr Wayfinder', 'Stonehorn Dignitary', 'Bloodthrone Vampire', 'Phyrexian Tyranny', 'Dauntless Escort', 'Pharika''s Libation', 'Ayula''s Influence', 'Gitaxian Probe', 'Nahiri, Storm of Stone', 'Soul''s Attendant', 'Delver of Secrets', 'Revitalize', 'Ensoul Artifact', 'Abzan Beastmaster', 'Bant Panorama', 'Call the Bloodline', 'Hypnotic Specter', 'Expedite', 'Gavony Township', 'Wurm''s Tooth', 'Conclave Tribunal', 'Deep Analysis', 'Artisan of Kozilek', 'Vivien''s Arkbow', 'Emerge Unscathed', 'Fumigate', 'Guilty Conscience', 'Cling to Dust', 'Ojutai''s Command', 'Llanowar Elves', 'Kodama''s Reach', 'Heartbeat of Spring', 'Rhys the Redeemed', 'Tidehollow Sculler', 'Scrabbling Claws', 'Tajic, Legion''s Edge', 'Marauding Blight-Priest', 'Aphemia, the Cacophony', 'Intangible Virtue', 'Steel Hellkite', 'Ornithopter', 'Dromoka, the Eternal', 'Sphinx''s Tutelage', 'Falkenrath Gorger', 'Orzhov Basilica', 'Rune Snag', 'Garruk Wildspeaker', 'Mnemonic Wall', 'Deep Forest Hermit', 'Transcendent Envoy', 'Putrid Imp', 'Tomb of Urami', 'Alirios, Enraptured', 'Varchild''s War-Riders', 'Arlinn Kord', 'Runeflare Trap', 'Nimble Trapfinder', 'Smiting Helix', 'Quirion Dryad', 'Sunken Ruins', 'Sarcomancy', 'Hyena Umbra', 'Kambal, Consul of Allocation', 'Selfless Savior', 'Helm of the Host', 'Reki, the History of Kamigawa', 'Blackblade Reforged', 'Sky Skiff', 'Liliana''s Triumph', 'Squadron Hawk', 'Tormenting Voice', 'Goblin Banneret', 'Kederekt Parasite', 'Myr Landshaper', 'Piranha Marsh', 'Evolutionary Leap', 'Stubborn Denial', 'Mire''s Toll', 'Judge''s Familiar', 'Improbable Alliance', 'Padeem, Consul of Innovation', 'Angrath''s Rampage', 'Coiling Oracle', 'Ranger of Eos', 'Rootborn Defenses', 'Loxodon Smiter', 'Psychic Spiral', 'Precinct Captain', 'Burning Inquiry', 'Rakdos Signet', 'Llanowar Visionary', 'Temple of Triumph', 'Mire''s Grasp', 'Electrolyze', 'Kefnet the Mindful', 'Grafted Wargear', 'Man-o''-War', 'Calciform Pools', 'Zur''s Weirding', 'Nihil Spellbomb', 'Midnight Haunting', 'Glimmerpost', 'Temple of Malady', 'Easy Prey', 'Puca''s Mischief', 'Protean Hulk', 'Ransack the Lab', 'Goblin Assault', 'Armadillo Cloak', 'Heartless Act', 'Mystic Archaeologist', 'Golgari Rot Farm', 'Cultivate', 'Drown in the Loch', 'Renata, Called to the Hunt', 'Nightsky Mimic', 'Kari Zev, Skyship Raider', 'Orim''s Chant', 'Urza''s Factory', 'Fight with Fire', 'Divest', 'Blood Seeker', 'Outflank', 'Omen of the Hunt', 'Esper Charm', 'Smallpox', 'Buried Alive', 'Diregraf Ghoul', 'Asylum Visitor', 'Grasslands', 'Tranquil Thicket', 'Jace''s Archivist', 'Base Camp', 'Summer Bloom', 'Approach of the Second Sun', 'Groundskeeper', 'Blessed Alliance', 'Cursed Scroll', 'Bygone Bishop', 'Curse of Death''s Hold', 'Goblin Matron', 'Heliod''s Pilgrim', 'Murderous Redcap', 'Feed the Swarm', 'Dismal Backwater', 'Ponder', 'Desperate Ravings', 'Setessan Training', 'Splinter', 'Tangled Florahedron', 'Shriekhorn', 'Encroaching Wastes', 'Clutch of the Undercity', 'Sandsteppe Citadel', 'Myr Enforcer', 'Lightning Greaves', 'Mesmeric Fiend', 'Viscera Seer', 'Spiteful Visions', 'Skinshifter', 'Jeskai Ascendancy', 'Izzet Charm', 'Illness in the Ranks', 'Edge of the Divinity', 'Ayli, Eternal Pilgrim', 'Pillage', 'Sarkhan, the Dragonspeaker', 'Fireblade Charger', 'Zektar Shrine Expedition', 'Mystifying Maze', 'Spoils of Adventure', 'Fact or Fiction', 'Luminarch Ascension', 'Fire-Lit Thicket', 'Glory-Bound Initiate', 'Phylath, World Sculptor', 'Incinerate', 'Sunscour', 'Endless Atlas', 'Ovalchase Daredevil', 'Melira, Sylvok Outcast', 'Prophetic Prism', 'Zombie Infestation', 'Cathartic Reunion', 'Wild Mongrel', 'Helm of the Gods', 'Kabira Takedown', 'Mwonvuli Acid-Moss', 'Jace Beleren', 'Yasharn, Implacable Earth', 'Grave Scrabbler', 'Krenko''s Command', 'Death Baron', 'Bad River', 'Teferi''s Tutelage', 'Dynavolt Tower', 'Mishra''s Factory', 'Geth''s Grimoire', 'Arcbound Worker', 'Dreamstealer', 'Arboreal Grazer', 'Cursecatcher', 'Wistful Thinking', 'Alseid of Life''s Bounty', 'Blightning', 'Tradewind Rider', 'Browbeat', 'Mystic Gate', 'Spell Pierce', 'Davriel, Rogue Shadowmage', 'Ghostly Flicker', 'Glissa Sunseeker', 'Vraska''s Contempt', 'Cartouche of Solidarity', 'Giant Killer', 'Deprive', 'Vindicate', 'Frogmite', 'Frantic Search', 'Grapeshot', 'Tombstalker', 'Arcane Sanctum', 'Blossoming Sands', 'Grand Architect', 'Bronzehide Lion', 'Mistveil Plains', 'Call of the Death-Dweller', 'Throne of the God-Pharaoh', 'Twinflame', 'Bond of Flourishing', 'Spellbook', 'Concerted Defense', 'Cemetery Reaper', 'Masked Admirers', 'Dark Prophecy', 'Thornwood Falls', 'Curious Obsession', 'Cut // Ribbons', 'Veteran Adventurer', 'Deeproot Champion', 'Slagstorm', 'Safehold Elite', 'The Antiquities War', 'Burst Lightning', 'Scion of Vitu-Ghazi', 'Vesperlark', 'Sprout Swarm', 'Pyroclasm', 'Alms of the Vein', 'Mogg War Marshal', 'Elvish Visionary', 'Orzhov Signet', 'Vivid Creek', 'Dead Weight', 'Urza''s Ruinous Blast', 'Champion of the Flame', 'Arrogant Wurm', 'Haktos the Unscarred', 'Mana Flare', 'Stoke the Flames', 'Selesnya Charm', 'Memnarch', 'Piracy Charm', 'Bala Ged Recovery', 'Graven Cairns', 'Jaddi Offshoot', 'Commune with the Gods', 'Nearheath Pilgrim', 'Gideon Jura', 'Brushfire Elemental', 'Lonely Sandbar', 'Sylvan Library', 'Keep Safe', 'Dovin, Hand of Control', 'Ondu Inversion', 'Predator''s Gambit', 'Hymn to Tourach', 'Toil // Trouble', 'Ruric Thar, the Unbowed', 'Dream Trawler', 'Truefire Captain', 'Boros Garrison', 'Crumbling Vestige', 'Reanimate', 'Runed Halo', 'Disfigure', 'Repeal', 'Weapons Trainer', 'Explore', 'Selvala, Explorer Returned', 'Reap the Past', 'Angelic Gift', 'Neoform', 'Scavenged Blade', 'Basking Rootwalla', 'Goreclaw, Terror of Qal Sisma', 'Reassembling Skeleton', 'Boros Challenger', 'Omen of the Forge', 'Azorius Charm', 'Sire of Insanity', 'Sentinel''s Eyes', 'Tranquil Cove', 'Legion Angel', 'Navigator''s Compass', 'Everflowing Chalice', 'Ajani''s Pridemate', 'Lavaclaw Reaches', 'Crackling Drake', 'Unsubstantiate', 'Exhaustion', 'Forbidden Alchemy', 'Setessan Petitioner', 'Forgotten Cave', 'Temple of Malice', 'Primal Amulet', 'Somber Hoverguard', 'Vivid Meadow', 'Mimic Vat', 'Vault of Whispers', 'Silence', 'Logic Knot', 'Temple of Mystery', 'Divinity of Pride', 'Lone Rider', 'Flaxen Intruder', 'Vapor Snag', 'Turnabout', 'Staff of Domination', 'Seaside Citadel', 'Tectonic Giant', 'Shalai, Voice of Plenty', 'Agonizing Remorse', 'Weatherlight', 'Beckon Apparition', 'Nether Traitor', 'Mythos of Nethroi', 'Nimbus Maze', 'Precursor Golem', 'Trade Routes', 'Faerie Vandal', 'Wooded Bastion', 'Tectonic Edge', 'Malakir Rebirth', 'Fleecemane Lion', 'Trespasser''s Curse', 'Duskwatch Recruiter', 'River of Tears', 'Ethersworn Canonist', 'Stuffy Doll', 'Pore Over the Pages', 'Kiora, Behemoth Beckoner', 'Condemn', 'Evolving Wilds', 'Chandra, Pyromaster', 'Desecration Demon', 'Buried Ruin', 'Wipe Away', 'Tyrant''s Choice', 'Liquimetal Coating', 'Sinister Sabotage', 'Frantic Inventory', 'Immolating Souleater', 'Ultimate Price', 'Gideon''s Intervention', 'Phoenix of Ash', 'Dosan the Falling Leaf', 'Bloodhall Priest', 'Neutralize', 'Charnel Troll', 'Darksteel Citadel', 'Abzan Charm', 'Treefolk Umbra', 'Hordeling Outburst', 'Seasoned Hallowblade', 'Dictate of Kruphix', 'Day of Judgment', 'Grizzly Fate', 'Lochmere Serpent', 'Ajani Goldmane', 'Invoke the Firemind', 'Blasphemous Act', 'Think Twice', 'Jungle Shrine', 'Bonesplitter', 'Banefire', 'Shizo, Death''s Storehouse', 'Springleaf Drum', 'Spirit Mantle', 'Boomerang', 'Staff of Nin', 'Frontier Bivouac', 'Firebolt', 'Light of Promise', 'Scoured Barrens', 'Crimson Wisps', 'Linvala, Shield of Sea Gate', 'Crib Swap', 'Temple of Silence', 'Thornling', 'Daxos, Blessed by the Sun', 'Mothdust Changeling', 'Doomed Traveler', 'Magmatic Sinkhole', 'Fling', 'Plow Under', 'Gatekeeper of Malakir', 'Kiora''s Follower', 'Gingerbrute', 'Signal Pest', 'Cloudpost', 'Titan''s Strength', 'Akoum Hellhound', 'Secluded Steppe', 'Endless Horizons', 'Dusk // Dawn', 'Dovin''s Veto', 'Archaeomancer', 'Boros Reckoner', 'Vampire Lacerator', 'Stormfist Crusader', 'Golgari Findbroker', 'Jungle Hollow', 'Flood Plain', 'Hateful Eidolon', 'Migration Path', 'Rush of Knowledge', 'Artificer''s Assistant', 'Wind-Scarred Crag', 'Dimir Aqueduct', 'Kazuul''s Fury', 'Pieces of the Puzzle', 'Brainstorm', 'Skyclave Cleric', 'Orzhov Charm', 'Wandering Fumarole', 'Howling Mine', 'Noose Constrictor', 'Survival Cache', 'Stone Haven Outfitter', 'Revel in Riches', 'Read the Bones', 'Nim Deathmantle', 'Mogis''s Marauder', 'Deranged Hermit', 'Dowsing Dagger', 'Goblin Gaveleer', 'Flayer Husk', 'Yahenni''s Expertise', 'Progenitor Mimic', 'Wayfaring Temple', 'Cranial Plating', 'Tajuru Paragon', 'Rosheen Meanderer', 'Knight of New Alara', 'Pathrazer of Ulamog', 'Master of Etherium', 'Liliana''s Reaver', 'Liliana''s Caress', 'Beanstalk Giant', 'Séance', 'Cliffhaven Kitesail', 'Vivid Grove', 'Goblin Dark-Dwellers', 'Trygon Predator', 'Cloudstone Curio', 'Faith''s Fetters', 'Opt', 'Birds of Paradise', 'Triplicate Spirits', 'Mortarpod', 'Animate Dead', 'Nomad Outpost', 'Ruin Crab', 'Undead Augur', 'Indomitable Ancients', 'Ebony Owl Netsuke', 'Dark Withering', 'Universal Automaton', 'One with the Machine', 'Skirk Prospector', 'Chief of the Foundry', 'Ulamog''s Crusher', 'Gigadrowse', 'Fiery Temper', 'Brave the Sands', 'Kor Outfitter', 'Lotleth Troll', 'Lazotep Reaver', 'Vendetta', 'Treefolk Harbinger', 'Psychic Strike', 'Dragon Fodder', 'Laboratory Maniac', 'Eternal Dragon', 'Fevered Visions', 'Syr Faren, the Hengehammer', 'Acidic Slime', 'Titanoth Rex', 'Planar Outburst', 'Izzet Boilerworks', 'Forbidden Friendship', 'Silundi Vision', 'Griffin Aerie', 'Treasure Cruise', 'Sprite Dragon', 'Dimir Charm', 'Pharika''s Spawn', 'Volcano Hellion', 'Sign in Blood', 'Healing Hands', 'Clackbridge Troll', 'Akiri, Fearless Voyager', 'Rugged Highlands', 'Mina and Denn, Wildborn', 'Banishing Light', 'Kemba, Kha Regent', 'Fiend Hunter', 'Carnophage', 'Forbid', 'Phyrexian Dreadnought', 'Champion of Wits', 'Desecrated Tomb', 'Huatli, the Sun''s Heart', 'Crumbling Necropolis', 'Renewed Faith', 'Glass of the Guildpact', 'Mire Triton', 'Suture Priest', 'Witch''s Oven', 'Dark Ritual', 'Etherium Sculptor', 'Justice Strike', 'Mystic Monastery'))) AND (TRUE)
GROUP BY
d.id,
d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
HAVING
TRUE
ORDER BY
active_date DESC, d.finish IS NULL, d.finish
```
[]
(slow_query, 44.1, mysql)
Reported on decksite by mysql-perf
Location Hash: b29c1931f05797b8c1fceb71e506a56b639183e5
Labels: decksite
[]
(slow_query, 81.7, mysql)Reported on decksite by mysql-perf
Location Hash: b29c1931f05797b8c1fceb71e506a56b639183e5