Open vorpal-buildbot opened 5 months ago
Exceeded slow_query limit (5.0 > 1.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 5.0, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (7.2 > 1.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 7.2, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (5.8 > 1.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 5.8, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (12.6 > 1.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 12.6, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (10.5 > 1.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 10.5, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (10.1 > 1.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 10.1, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (11.4 > 1.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 11.4, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (9.1 > 1.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 9.1, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (8.6 > 1.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 8.6, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (9.0 > 1.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 9.0, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (8.2 > 1.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 8.2, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (7.7 > 1.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 7.7, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (5.0 > 1.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 5.0, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (11.1 > 1.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 11.1, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (5.2 > 1.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 5.2, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (5.2 > 1.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 5.2, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (9.1 > 1.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 9.1, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (6.0 > 1.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 6.0, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (5.6 > 1.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 5.6, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (5.5 > 1.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 5.5, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (5.8 > 1.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 5.8, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (9.0 > 1.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 9.0, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (6.2 > 1.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 6.2, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (5.2 > 2.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 5.2, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (5.2 > 2.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 5.2, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (9.3 > 2.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 9.3, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (5.6 > 2.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 5.6, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (6.1 > 2.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 6.1, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (4.9 > 2.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 4.9, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (4.9 > 2.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 4.9, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (5.2 > 2.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 5.2, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (9.1 > 2.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 9.1, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (5.0 > 2.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 5.0, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (5.1 > 2.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 5.1, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (4.7 > 2.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 4.7, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (5.0 > 2.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 5.0, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (8.8 > 2.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 8.8, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (5.1 > 2.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 5.1, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (4.8 > 2.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 4.8, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (7.2 > 2.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 7.2, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (4.7 > 2.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 4.7, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (5.0 > 2.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 5.0, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (5.4 > 2.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 5.4, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (4.7 > 2.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 4.7, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (7.9 > 2.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 7.9, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (5.2 > 2.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 5.2, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (5.3 > 2.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 5.3, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (5.3 > 2.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 5.3, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (5.2 > 2.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 5.2, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
Exceeded slow_query limit (5.6 > 2.0) in mysql: ``CREATE TABLE IF NOT EXISTS
_new_cache_card(
idINTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT ,
nameVARCHAR(190) NOT NULL ,
mana_costVARCHAR(190) ,
cmcREAL ,
powerVARCHAR(190) ,
toughnessVARCHAR(190) ,
loyaltyVARCHAR(190) ,
type_lineVARCHAR(190) NOT NULL ,
oracle_textLONGTEXT NOT NULL ,
handINTEGER ,
lifeINTEGER ,
positionVARCHAR(190) NOT NULL ,
card_idINTEGER NOT NULL ,
oracle_idCHAR(36) UNIQUE ,
layoutVARCHAR(190) NOT NULL ,
legalitiesLONGTEXT ,
namesLONGTEXT ,
pd_legalBOOLEAN ,
bugsLONGTEXT ,
flavor_namesLONGTEXT , FOREIGN KEY (
card_id) REFERENCES
card(
id`)) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS
SELECT
`u`.`id` AS `id`,
CASE
WHEN layout IN ('split') THEN
GROUP_CONCAT(face_name ORDER BY position SEPARATOR ' // ' )
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN face_name ELSE '' END SEPARATOR '')
END
AS name,
CASE
WHEN layout IN ('adventure', 'modal_dfc', 'split') THEN
GROUP_CONCAT(`u`.`mana_cost` SEPARATOR '|')
ELSE
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN mana_cost ELSE '' END SEPARATOR '')
END
AS mana_cost,
CASE
WHEN layout IN ('split') THEN
SUM(CASE WHEN `u`.cmc IS NOT NULL THEN `u`.cmc ELSE 0 END)
ELSE
SUM(CASE WHEN `u`.position = 1 THEN `u`.cmc ELSE 0 END)
END
AS cmc, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`power` ELSE '' END SEPARATOR '') AS `power`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`toughness` ELSE '' END SEPARATOR '') AS `toughness`, GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN `u`.`loyalty` ELSE '' END SEPARATOR '') AS `loyalty`,
GROUP_CONCAT(CASE WHEN `u`.position = 1 THEN type_line ELSE '' END SEPARATOR '')
AS type_line, GROUP_CONCAT(`u`.`oracle_text` SEPARATOR '
') AS oracle_text
, SUM(CASE WHEN u
.position = 1 THEN u
.hand
ELSE 0 END) AS hand
, SUM(CASE WHEN u
.position = 1 THEN u
.life
ELSE 0 END) AS life
, GROUP_CONCAT(CASE WHEN u
.position = 1 THEN u
.position
ELSE '' END SEPARATOR '') AS position
, SUM(CASE WHEN u
.position = 1 THEN u
.card_id
ELSE 0 END) AS card_id
, u
.oracle_id
AS oracle_id
, u
.layout
AS layout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names, u
.pd_legal
AS pd_legal
, bugs, flavor_names
FROM (
SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name,
pd_legal,
legalities
FROM
card AS c
INNER JOIN
face AS f ON c.id = f.card_id
LEFT JOIN (
SELECT
cl.card_id,
SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal,
GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities
FROM
card_legality AS cl
LEFT JOIN
format AS fo ON cl.format_id = fo.id
GROUP BY
cl.card_id
) AS cl ON cl.card_id = c.id
GROUP BY
f.id
ORDER BY
f.card_id, f.position
) AS u
LEFT JOIN (
SELECT
cb.card_id,
GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs
FROM
card_bug AS cb
GROUP BY
cb.card_id
) AS bugs ON u.id = bugs.card_id
LEFT JOIN (
SELECT
fn.card_id,
GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names
FROM
card_flavor_name AS fn
GROUP BY
fn.card_id
) AS fn ON fn.card_id = u.id
WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1))
GROUP BY u.id
```[]``` (slow_query, 5.6, mysql)
Reported on decksite by mysql-perf
Location Hash: 8525a5e539ef5b665c5f49ec47ed6f240eecb18e
Labels: decksite
') AS
oracle_text
, SUM(CASE WHENu
.position = 1 THENu
.hand
ELSE 0 END) AShand
, SUM(CASE WHENu
.position = 1 THENu
.life
ELSE 0 END) ASlife
, GROUP_CONCAT(CASE WHENu
.position = 1 THENu
.position
ELSE '' END SEPARATOR '') ASposition
, SUM(CASE WHENu
.position = 1 THENu
.card_id
ELSE 0 END) AScard_id
,u
.oracle_id
ASoracle_id
,u
.layout
ASlayout
, legalities, GROUP_CONCAT(face_name ORDER BY position SEPARATOR '|') AS names,u
.pd_legal
ASpd_legal
, bugs, flavor_names FROM ( SELECT c.id, c.oracle_id, c.layout, f.mana_cost, f.cmc, f.power, f.toughness, f.loyalty, f.type_line, f.oracle_text, f.hand, f.life, f.position, f.card_id, f.name AS face_name, pd_legal, legalities FROM card AS c INNER JOIN face AS f ON c.id = f.card_id LEFT JOIN ( SELECT cl.card_id, SUM(CASE WHEN cl.format_id = 22 THEN 1 ELSE 0 END) > 0 AS pd_legal, GROUP_CONCAT(CONCAT(fo.name, ':', cl.legality)) AS legalities FROM card_legality AS cl LEFT JOIN format AS fo ON cl.format_id = fo.id GROUP BY cl.card_id ) AS cl ON cl.card_id = c.id GROUP BY f.id ORDER BY f.card_id, f.position ) AS u LEFT JOIN ( SELECT cb.card_id, GROUP_CONCAT(CONCAT(cb.description, '|', cb.classification, '|', cb.last_confirmed, '|', cb.url, '|', cb.from_bug_blog, '|', cb.bannable) SEPARATOR 'SEPARATOR') AS bugs FROM card_bug AS cb GROUP BY cb.card_id ) AS bugs ON u.id = bugs.card_id LEFT JOIN ( SELECT fn.card_id, GROUP_CONCAT(fn.flavor_name SEPARATOR '|') AS flavor_names FROM card_flavor_name AS fn GROUP BY fn.card_id ) AS fn ON fn.card_id = u.id WHERE u.id IN (SELECT c.id FROM card AS c INNER JOIN face AS f ON c.id = f.card_id WHERE (1 = 1)) GROUP BY u.id