Open vorpal-buildbot opened 1 year ago
Exceeded slow_query limit (1.7 > 0.5) in mysql: ```
SELECT
deck_id,
archetype_id,
archetype_name
FROM
(
WITH rule_card_count AS
(
SELECT
rule.id, COUNT(card) AS card_count
FROM
rule
JOIN
rule_card
ON
rule.id = rule_card.rule_id
WHERE
rule_card.include AND TRUE
GROUP BY
rule.id
),
candidates AS
(
SELECT
deck.id AS deck_id,
COUNT(DISTINCT REPLACE(deck_card.card, 'Snow-Covered ', '')) AS included_count,
MAX(rule_card_count.card_count) AS required_count,-- fake MAX due to aggregate function
rule.id AS rule_id
FROM
deck
JOIN
deck_card
ON
deck.id = deck_card.deck_id
JOIN
(
SELECT
*
FROM
rule_card
WHERE
include
) AS inclusions
ON
REPLACE(deck_card.card, 'Snow-Covered ', '') = inclusions.card
JOIN
rule
ON
rule.id = inclusions.rule_id
JOIN
rule_card_count
ON
rule.id = rule_card_count.id
WHERE
NOT deck_card.sideboard AND deck_card.n >= inclusions.n AND deck_id IN (216991, 216990, 216989, 216985, 216984, 216988, 216987, 216986, 216982, 216983, 216981, 216980, 216901, 216979, 216978, 216977, 216953, 216976, 216882, 216975, 216974, 216973, 216972, 216971, 216970, 216969, 216956, 216965, 216960, 216964, 216959, 216968, 216963, 216958, 216967, 216962, 216957, 216966, 216961, 216955, 216954, 216892, 216897, 216952, 216951, 216950, 216863, 216865, 216949, 216947, 216948, 216943, 216946, 216945, 216944, 216939, 216942, 216941, 216940, 216938, 216937, 216932, 216936, 216935, 216934, 216933, 216931, 216930, 216929, 216928, 216924, 216919, 216923, 216918, 216927, 216922, 216926, 216921, 216925, 216920, 216915, 216910, 216914, 216909, 216913, 216908, 216917, 216912, 216907, 216916, 216911, 216904, 216903, 216893, 216896, 216887, 216889, 216891, 216890, 216884, 216864, 216879, 216878, 216877, 216876, 216875, 216874, 216870, 216871, 216873, 216867, 216866, 216860, 216858, 216857, 216856, 216855) AND TRUE
GROUP BY
deck.id, rule.id
HAVING
included_count = required_count
)
SELECT
candidates.deck_id,
rule.id AS rule_id,
suggested_archetype.id AS archetype_id,
suggested_archetype.name AS archetype_name
FROM
candidates
INNER JOIN
rule
ON
candidates.rule_id = rule.id
JOIN
archetype AS suggested_archetype
ON
rule.archetype_id = suggested_archetype.id
LEFT JOIN
(
SELECT
*
FROM
rule_card
WHERE
NOT include
) AS exclusions
ON
candidates.rule_id = exclusions.rule_id
LEFT JOIN
deck_card
ON
candidates.deck_id = deck_card.deck_id AND exclusions.card = REPLACE(deck_card.card, 'Snow-Covered ', '') AND deck_card.n >= exclusions.n
GROUP BY
candidates.deck_id, rule_id
HAVING
COUNT(REPLACE(deck_card.card, 'Snow-Covered ', '')) = 0
) AS applied_rules
GROUP BY
deck_id
HAVING
COUNT(DISTINCT archetype_id) = 1
```
[]
(slow_query, 1.7, mysql)
Reported on decksite by mysql-perf
Location Hash: e6a2dcf07412409bd46dd1beec603d168789cc32
Labels: decksite
Exceeded slow_query limit (2.0 > 0.5) in mysql: ```
SELECT
deck_id,
archetype_id,
archetype_name
FROM
(
WITH rule_card_count AS
(
SELECT
rule.id, COUNT(card) AS card_count
FROM
rule
JOIN
rule_card
ON
rule.id = rule_card.rule_id
WHERE
rule_card.include AND TRUE
GROUP BY
rule.id
),
candidates AS
(
SELECT
deck.id AS deck_id,
COUNT(DISTINCT REPLACE(deck_card.card, 'Snow-Covered ', '')) AS included_count,
MAX(rule_card_count.card_count) AS required_count,-- fake MAX due to aggregate function
rule.id AS rule_id
FROM
deck
JOIN
deck_card
ON
deck.id = deck_card.deck_id
JOIN
(
SELECT
*
FROM
rule_card
WHERE
include
) AS inclusions
ON
REPLACE(deck_card.card, 'Snow-Covered ', '') = inclusions.card
JOIN
rule
ON
rule.id = inclusions.rule_id
JOIN
rule_card_count
ON
rule.id = rule_card_count.id
WHERE
NOT deck_card.sideboard AND deck_card.n >= inclusions.n AND deck_id IN (217065, 217064, 217063, 217059, 217062, 217060, 217061, 217056, 217058, 217057, 217055, 217054, 217051, 217053, 217052, 217050, 217030, 217039, 217048, 217034, 217043, 217038, 217047, 217042, 217037, 217046, 217041, 217036, 217045, 217040, 217049, 217035, 217044, 217033, 217032, 217031, 217029, 217028, 217027, 217026, 217025, 217024, 217023, 217022, 217021, 217020, 217019, 217018, 217017, 217016, 217015, 217014, 217013, 217012, 217009, 217010, 217011, 217008, 216874, 217007, 216944, 217006, 216998, 217002, 217001, 217005, 217000, 217004, 216999, 217003, 216991, 216992, 216997, 216996, 216989, 216995, 216994, 216993, 216984, 216980, 216901, 216953, 216976, 216882, 216973, 216971, 216967, 216959, 216964, 216962, 216961, 216960, 216892, 216897, 216952, 216951, 216950, 216863, 216865, 216943, 216940, 216937, 216932, 216935, 216934, 216930, 216927, 216926, 216922, 216920, 216918, 216912, 216911, 216908, 216907, 216904, 216893, 216896, 216887, 216889, 216891, 216890, 216884, 216864, 216879, 216878, 216877, 216876, 216875, 216870, 216871, 216873, 216867, 216866, 216860, 216858, 216857, 216856, 216855) AND TRUE
GROUP BY
deck.id, rule.id
HAVING
included_count = required_count
)
SELECT
candidates.deck_id,
rule.id AS rule_id,
suggested_archetype.id AS archetype_id,
suggested_archetype.name AS archetype_name
FROM
candidates
INNER JOIN
rule
ON
candidates.rule_id = rule.id
JOIN
archetype AS suggested_archetype
ON
rule.archetype_id = suggested_archetype.id
LEFT JOIN
(
SELECT
*
FROM
rule_card
WHERE
NOT include
) AS exclusions
ON
candidates.rule_id = exclusions.rule_id
LEFT JOIN
deck_card
ON
candidates.deck_id = deck_card.deck_id AND exclusions.card = REPLACE(deck_card.card, 'Snow-Covered ', '') AND deck_card.n >= exclusions.n
GROUP BY
candidates.deck_id, rule_id
HAVING
COUNT(REPLACE(deck_card.card, 'Snow-Covered ', '')) = 0
) AS applied_rules
GROUP BY
deck_id
HAVING
COUNT(DISTINCT archetype_id) = 1
```
[]
(slow_query, 2.0, mysql)
Reported on decksite by mysql-perf
Location Hash: e6a2dcf07412409bd46dd1beec603d168789cc32
Labels: decksite
Exceeded slow_query limit (1.5 > 0.5) in mysql: ```
SELECT
deck_id,
archetype_id,
archetype_name
FROM
(
WITH rule_card_count AS
(
SELECT
rule.id, COUNT(card) AS card_count
FROM
rule
JOIN
rule_card
ON
rule.id = rule_card.rule_id
WHERE
rule_card.include AND TRUE
GROUP BY
rule.id
),
candidates AS
(
SELECT
deck.id AS deck_id,
COUNT(DISTINCT REPLACE(deck_card.card, 'Snow-Covered ', '')) AS included_count,
MAX(rule_card_count.card_count) AS required_count,-- fake MAX due to aggregate function
rule.id AS rule_id
FROM
deck
JOIN
deck_card
ON
deck.id = deck_card.deck_id
JOIN
(
SELECT
*
FROM
rule_card
WHERE
include
) AS inclusions
ON
REPLACE(deck_card.card, 'Snow-Covered ', '') = inclusions.card
JOIN
rule
ON
rule.id = inclusions.rule_id
JOIN
rule_card_count
ON
rule.id = rule_card_count.id
WHERE
NOT deck_card.sideboard AND deck_card.n >= inclusions.n AND deck_id IN (217068, 217067, 217066, 217063, 217059, 217056, 217058, 217057, 217055, 217043, 217042, 217049, 217036, 217048, 217045, 217032, 217029, 217027, 217026, 217025, 217021, 217019, 217017, 217015, 217014, 217010, 216874, 217007, 216944, 217006, 217002, 217000, 216999, 217004, 217003, 216991, 216996, 216989, 216995, 216984, 216980, 216901, 216953, 216976, 216882, 216973, 216971, 216962, 216961, 216960, 216967, 216959, 216964, 216892, 216897, 216952, 216951, 216950, 216863, 216865, 216943, 216940, 216937, 216932, 216935, 216934, 216930, 216922, 216920, 216918, 216927, 216926, 216908, 216907, 216912, 216911, 216904, 216893, 216896, 216887, 216889, 216891, 216890, 216884, 216864, 216879, 216878, 216877, 216876, 216875, 216870, 216871, 216873, 216867, 216866, 216860, 216858, 216857, 216856, 216855) AND TRUE
GROUP BY
deck.id, rule.id
HAVING
included_count = required_count
)
SELECT
candidates.deck_id,
rule.id AS rule_id,
suggested_archetype.id AS archetype_id,
suggested_archetype.name AS archetype_name
FROM
candidates
INNER JOIN
rule
ON
candidates.rule_id = rule.id
JOIN
archetype AS suggested_archetype
ON
rule.archetype_id = suggested_archetype.id
LEFT JOIN
(
SELECT
*
FROM
rule_card
WHERE
NOT include
) AS exclusions
ON
candidates.rule_id = exclusions.rule_id
LEFT JOIN
deck_card
ON
candidates.deck_id = deck_card.deck_id AND exclusions.card = REPLACE(deck_card.card, 'Snow-Covered ', '') AND deck_card.n >= exclusions.n
GROUP BY
candidates.deck_id, rule_id
HAVING
COUNT(REPLACE(deck_card.card, 'Snow-Covered ', '')) = 0
) AS applied_rules
GROUP BY
deck_id
HAVING
COUNT(DISTINCT archetype_id) = 1
```
[]
(slow_query, 1.5, mysql)
Reported on decksite by mysql-perf
Location Hash: e6a2dcf07412409bd46dd1beec603d168789cc32
Labels: decksite
Exceeded slow_query limit (1.6 > 0.5) in mysql: ```
SELECT
deck_id,
archetype_id,
archetype_name
FROM
(
WITH rule_card_count AS
(
SELECT
rule.id, COUNT(card) AS card_count
FROM
rule
JOIN
rule_card
ON
rule.id = rule_card.rule_id
WHERE
rule_card.include AND TRUE
GROUP BY
rule.id
),
candidates AS
(
SELECT
deck.id AS deck_id,
COUNT(DISTINCT REPLACE(deck_card.card, 'Snow-Covered ', '')) AS included_count,
MAX(rule_card_count.card_count) AS required_count,-- fake MAX due to aggregate function
rule.id AS rule_id
FROM
deck
JOIN
deck_card
ON
deck.id = deck_card.deck_id
JOIN
(
SELECT
*
FROM
rule_card
WHERE
include
) AS inclusions
ON
REPLACE(deck_card.card, 'Snow-Covered ', '') = inclusions.card
JOIN
rule
ON
rule.id = inclusions.rule_id
JOIN
rule_card_count
ON
rule.id = rule_card_count.id
WHERE
NOT deck_card.sideboard AND deck_card.n >= inclusions.n AND deck_id IN (217082, 217081, 217080, 216873, 217079, 217078, 217015, 217077, 217076, 217075, 217074, 217073, 217072, 217071, 217070, 217069, 217067, 217066, 217063, 217059, 217056, 217058, 217057, 217055, 217049, 217036, 217048, 217045, 217043, 217042, 217032, 217029, 217027, 217026, 217025, 217021, 217019, 217017, 217014, 217010, 216874, 217007, 216944, 217006, 216999, 217004, 217003, 217002, 217000, 216991, 216996, 216989, 216995, 216984, 216980, 216901, 216953, 216976, 216882, 216973, 216971, 216960, 216967, 216959, 216964, 216962, 216961, 216892, 216897, 216952, 216951, 216950, 216863, 216865, 216943, 216940, 216937, 216932, 216935, 216934, 216930, 216918, 216927, 216926, 216922, 216920, 216907, 216912, 216911, 216908, 216904, 216893, 216896, 216887, 216889, 216891, 216890, 216884, 216864, 216879, 216878, 216877, 216876, 216875, 216870, 216871, 216867, 216866, 216860, 216858, 216857, 216856, 216855) AND TRUE
GROUP BY
deck.id, rule.id
HAVING
included_count = required_count
)
SELECT
candidates.deck_id,
rule.id AS rule_id,
suggested_archetype.id AS archetype_id,
suggested_archetype.name AS archetype_name
FROM
candidates
INNER JOIN
rule
ON
candidates.rule_id = rule.id
JOIN
archetype AS suggested_archetype
ON
rule.archetype_id = suggested_archetype.id
LEFT JOIN
(
SELECT
*
FROM
rule_card
WHERE
NOT include
) AS exclusions
ON
candidates.rule_id = exclusions.rule_id
LEFT JOIN
deck_card
ON
candidates.deck_id = deck_card.deck_id AND exclusions.card = REPLACE(deck_card.card, 'Snow-Covered ', '') AND deck_card.n >= exclusions.n
GROUP BY
candidates.deck_id, rule_id
HAVING
COUNT(REPLACE(deck_card.card, 'Snow-Covered ', '')) = 0
) AS applied_rules
GROUP BY
deck_id
HAVING
COUNT(DISTINCT archetype_id) = 1
```
[]
(slow_query, 1.6, mysql)
Reported on decksite by mysql-perf
Location Hash: e6a2dcf07412409bd46dd1beec603d168789cc32
Labels: decksite
Exceeded slow_query limit (2.5 > 0.5) in mysql: ```
SELECT
deck_id,
archetype_id,
archetype_name
FROM
(
WITH rule_card_count AS
(
SELECT
rule.id, COUNT(card) AS card_count
FROM
rule
JOIN
rule_card
ON
rule.id = rule_card.rule_id
WHERE
rule_card.include AND TRUE
GROUP BY
rule.id
),
candidates AS
(
SELECT
deck.id AS deck_id,
COUNT(DISTINCT REPLACE(deck_card.card, 'Snow-Covered ', '')) AS included_count,
MAX(rule_card_count.card_count) AS required_count,-- fake MAX due to aggregate function
rule.id AS rule_id
FROM
deck
JOIN
deck_card
ON
deck.id = deck_card.deck_id
JOIN
(
SELECT
*
FROM
rule_card
WHERE
include
) AS inclusions
ON
REPLACE(deck_card.card, 'Snow-Covered ', '') = inclusions.card
JOIN
rule
ON
rule.id = inclusions.rule_id
JOIN
rule_card_count
ON
rule.id = rule_card_count.id
WHERE
NOT deck_card.sideboard AND deck_card.n >= inclusions.n AND deck_id IN (217152, 217146, 217066, 217151, 217117, 217150, 217137, 217149, 217148, 217147, 217142, 217145, 217144, 217143, 217141, 217138, 217140, 217139, 217136, 217135, 217134, 217084, 217130, 217133, 217132, 217021, 217131, 217099, 217129, 217128, 217127, 217126, 217125, 216875, 217124, 217123, 217120, 217119, 217122, 217121, 217118, 217116, 216904, 217115, 217114, 217113, 217105, 217109, 217104, 217108, 217103, 217107, 217112, 217111, 217106, 217110, 217102, 217101, 217100, 217096, 217098, 217097, 217094, 217095, 217093, 217092, 217091, 217090, 217089, 217088, 217087, 217086, 217081, 217085, 217083, 217078, 217080, 216873, 217015, 217077, 217072, 217071, 217067, 217063, 217059, 217056, 217058, 217057, 217055, 217049, 217036, 217048, 217045, 217043, 217042, 217032, 217029, 217027, 217025, 217019, 217017, 217014, 217010, 216874, 217007, 216944, 217006, 217004, 217003, 217002, 217000, 216999, 216991, 216996, 216989, 216995, 216984, 216980, 216901, 216976, 216882, 216973, 216971, 216967, 216959, 216964, 216962, 216961, 216960, 216892, 216897, 216952, 216951, 216950, 216863, 216865, 216943, 216940, 216937, 216932, 216935, 216934, 216930, 216926, 216922, 216920, 216918, 216927, 216911, 216908, 216907, 216912, 216893, 216896, 216887, 216889, 216891, 216890, 216884, 216864, 216879, 216878, 216877, 216876, 216870, 216871, 216867, 216866, 216860, 216858, 216857, 216856, 216855) AND TRUE
GROUP BY
deck.id, rule.id
HAVING
included_count = required_count
)
SELECT
candidates.deck_id,
rule.id AS rule_id,
suggested_archetype.id AS archetype_id,
suggested_archetype.name AS archetype_name
FROM
candidates
INNER JOIN
rule
ON
candidates.rule_id = rule.id
JOIN
archetype AS suggested_archetype
ON
rule.archetype_id = suggested_archetype.id
LEFT JOIN
(
SELECT
*
FROM
rule_card
WHERE
NOT include
) AS exclusions
ON
candidates.rule_id = exclusions.rule_id
LEFT JOIN
deck_card
ON
candidates.deck_id = deck_card.deck_id AND exclusions.card = REPLACE(deck_card.card, 'Snow-Covered ', '') AND deck_card.n >= exclusions.n
GROUP BY
candidates.deck_id, rule_id
HAVING
COUNT(REPLACE(deck_card.card, 'Snow-Covered ', '')) = 0
) AS applied_rules
GROUP BY
deck_id
HAVING
COUNT(DISTINCT archetype_id) = 1
```
[]
(slow_query, 2.5, mysql)
Reported on decksite by mysql-perf
Location Hash: e6a2dcf07412409bd46dd1beec603d168789cc32
Labels: decksite
Exceeded slow_query limit (2.6 > 0.5) in mysql: ```
SELECT
deck_id,
archetype_id,
archetype_name
FROM
(
WITH rule_card_count AS
(
SELECT
rule.id, COUNT(card) AS card_count
FROM
rule
JOIN
rule_card
ON
rule.id = rule_card.rule_id
WHERE
rule_card.include AND TRUE
GROUP BY
rule.id
),
candidates AS
(
SELECT
deck.id AS deck_id,
COUNT(DISTINCT REPLACE(deck_card.card, 'Snow-Covered ', '')) AS included_count,
MAX(rule_card_count.card_count) AS required_count,-- fake MAX due to aggregate function
rule.id AS rule_id
FROM
deck
JOIN
deck_card
ON
deck.id = deck_card.deck_id
JOIN
(
SELECT
*
FROM
rule_card
WHERE
include
) AS inclusions
ON
REPLACE(deck_card.card, 'Snow-Covered ', '') = inclusions.card
JOIN
rule
ON
rule.id = inclusions.rule_id
JOIN
rule_card_count
ON
rule.id = rule_card_count.id
WHERE
NOT deck_card.sideboard AND deck_card.n >= inclusions.n AND deck_id IN (217155, 217154, 217153, 217152, 217146, 217066, 217151, 217117, 217150, 217137, 217149, 217148, 217147, 217142, 217145, 217144, 217143, 217141, 217138, 217140, 217139, 217136, 217135, 217134, 217084, 217130, 217133, 217132, 217021, 217131, 217099, 217129, 217128, 217127, 217126, 217125, 216875, 217124, 217123, 217120, 217119, 217122, 217121, 217118, 217116, 216904, 217115, 217114, 217113, 217109, 217104, 217108, 217103, 217107, 217111, 217112, 217106, 217110, 217105, 217102, 217101, 217100, 217096, 217098, 217097, 217094, 217095, 217093, 217092, 217091, 217090, 217089, 217088, 217087, 217086, 217081, 217085, 217083, 217078, 217080, 216873, 217015, 217077, 217072, 217071, 217067, 217063, 217059, 217056, 217058, 217057, 217055, 217036, 217048, 217045, 217043, 217042, 217049, 217032, 217029, 217027, 217025, 217019, 217017, 217014, 217010, 216874, 217007, 216944, 217006, 217003, 217002, 217000, 216999, 217004, 216991, 216996, 216989, 216995, 216984, 216980, 216901, 216976, 216882, 216973, 216971, 216959, 216964, 216962, 216961, 216960, 216967, 216892, 216897, 216952, 216951, 216950, 216863, 216865, 216943, 216940, 216937, 216932, 216935, 216934, 216930, 216922, 216920, 216918, 216927, 216926, 216911, 216908, 216907, 216912, 216893, 216896, 216887, 216889, 216891, 216890, 216884, 216864, 216879, 216878, 216877, 216876, 216870, 216871, 216867, 216866, 216860, 216858, 216857, 216856, 216855) AND TRUE
GROUP BY
deck.id, rule.id
HAVING
included_count = required_count
)
SELECT
candidates.deck_id,
rule.id AS rule_id,
suggested_archetype.id AS archetype_id,
suggested_archetype.name AS archetype_name
FROM
candidates
INNER JOIN
rule
ON
candidates.rule_id = rule.id
JOIN
archetype AS suggested_archetype
ON
rule.archetype_id = suggested_archetype.id
LEFT JOIN
(
SELECT
*
FROM
rule_card
WHERE
NOT include
) AS exclusions
ON
candidates.rule_id = exclusions.rule_id
LEFT JOIN
deck_card
ON
candidates.deck_id = deck_card.deck_id AND exclusions.card = REPLACE(deck_card.card, 'Snow-Covered ', '') AND deck_card.n >= exclusions.n
GROUP BY
candidates.deck_id, rule_id
HAVING
COUNT(REPLACE(deck_card.card, 'Snow-Covered ', '')) = 0
) AS applied_rules
GROUP BY
deck_id
HAVING
COUNT(DISTINCT archetype_id) = 1
```
[]
(slow_query, 2.6, mysql)
Reported on decksite by mysql-perf
Location Hash: e6a2dcf07412409bd46dd1beec603d168789cc32
Labels: decksite
Exceeded slow_query limit (3.1 > 0.5) in mysql: ```
SELECT
deck_id,
archetype_id,
archetype_name
FROM
(
WITH rule_card_count AS
(
SELECT
rule.id, COUNT(card) AS card_count
FROM
rule
JOIN
rule_card
ON
rule.id = rule_card.rule_id
WHERE
rule_card.include AND TRUE
GROUP BY
rule.id
),
candidates AS
(
SELECT
deck.id AS deck_id,
COUNT(DISTINCT REPLACE(deck_card.card, 'Snow-Covered ', '')) AS included_count,
MAX(rule_card_count.card_count) AS required_count,-- fake MAX due to aggregate function
rule.id AS rule_id
FROM
deck
JOIN
deck_card
ON
deck.id = deck_card.deck_id
JOIN
(
SELECT
*
FROM
rule_card
WHERE
include
) AS inclusions
ON
REPLACE(deck_card.card, 'Snow-Covered ', '') = inclusions.card
JOIN
rule
ON
rule.id = inclusions.rule_id
JOIN
rule_card_count
ON
rule.id = rule_card_count.id
WHERE
NOT deck_card.sideboard AND deck_card.n >= inclusions.n AND deck_id IN (217188, 217187, 217185, 217186, 217147, 217184, 217181, 217183, 217182, 217179, 217180, 217135, 217178, 217176, 217171, 217177, 217175, 217174, 217173, 217172, 217170, 217169, 217167, 217168, 217164, 217166, 217126, 217165, 217163, 217159, 217162, 217160, 217161, 217158, 217157, 216930, 217155, 217156, 217154, 217153, 217152, 217146, 217066, 217151, 217117, 217150, 217137, 217149, 217148, 217142, 217145, 217144, 217143, 217141, 217138, 217140, 217139, 217136, 217134, 217084, 217130, 217133, 217132, 217021, 217131, 217099, 217129, 217128, 217127, 217125, 216875, 217124, 217123, 217120, 217119, 217122, 217121, 217118, 217116, 216904, 217115, 217114, 217113, 217111, 217106, 217110, 217105, 217109, 217112, 217104, 217108, 217103, 217107, 217102, 217101, 217100, 217096, 217098, 217097, 217094, 217095, 217093, 217092, 217091, 217090, 217089, 217088, 217087, 217086, 217081, 217085, 217083, 217078, 217080, 216873, 217015, 217077, 217072, 217071, 217067, 217063, 217059, 217056, 217058, 217057, 217055, 217043, 217042, 217049, 217036, 217048, 217045, 217032, 217029, 217027, 217025, 217019, 217017, 217014, 217010, 216874, 217007, 216944, 217006, 217000, 216999, 217004, 217003, 217002, 216991, 216996, 216989, 216995, 216984, 216980, 216901, 216976, 216882, 216973, 216971, 216961, 216960, 216967, 216959, 216964, 216962, 216892, 216897, 216952, 216951, 216950, 216863, 216865, 216943, 216940, 216937, 216932, 216935, 216934, 216918, 216927, 216926, 216922, 216920, 216912, 216911, 216908, 216907, 216893, 216896, 216887, 216889, 216891, 216890, 216884, 216864, 216879, 216878, 216877, 216876, 216870, 216871, 216867, 216866, 216860, 216858, 216857, 216856, 216855) AND TRUE
GROUP BY
deck.id, rule.id
HAVING
included_count = required_count
)
SELECT
candidates.deck_id,
rule.id AS rule_id,
suggested_archetype.id AS archetype_id,
suggested_archetype.name AS archetype_name
FROM
candidates
INNER JOIN
rule
ON
candidates.rule_id = rule.id
JOIN
archetype AS suggested_archetype
ON
rule.archetype_id = suggested_archetype.id
LEFT JOIN
(
SELECT
*
FROM
rule_card
WHERE
NOT include
) AS exclusions
ON
candidates.rule_id = exclusions.rule_id
LEFT JOIN
deck_card
ON
candidates.deck_id = deck_card.deck_id AND exclusions.card = REPLACE(deck_card.card, 'Snow-Covered ', '') AND deck_card.n >= exclusions.n
GROUP BY
candidates.deck_id, rule_id
HAVING
COUNT(REPLACE(deck_card.card, 'Snow-Covered ', '')) = 0
) AS applied_rules
GROUP BY
deck_id
HAVING
COUNT(DISTINCT archetype_id) = 1
```
[]
(slow_query, 3.1, mysql)
Reported on decksite by mysql-perf
Location Hash: e6a2dcf07412409bd46dd1beec603d168789cc32
Labels: decksite
Exceeded slow_query limit (2.8 > 0.5) in mysql: ```
SELECT
deck_id,
archetype_id,
archetype_name
FROM
(
WITH rule_card_count AS
(
SELECT
rule.id, COUNT(card) AS card_count
FROM
rule
JOIN
rule_card
ON
rule.id = rule_card.rule_id
WHERE
rule_card.include AND TRUE
GROUP BY
rule.id
),
candidates AS
(
SELECT
deck.id AS deck_id,
COUNT(DISTINCT REPLACE(deck_card.card, 'Snow-Covered ', '')) AS included_count,
MAX(rule_card_count.card_count) AS required_count,-- fake MAX due to aggregate function
rule.id AS rule_id
FROM
deck
JOIN
deck_card
ON
deck.id = deck_card.deck_id
JOIN
(
SELECT
*
FROM
rule_card
WHERE
include
) AS inclusions
ON
REPLACE(deck_card.card, 'Snow-Covered ', '') = inclusions.card
JOIN
rule
ON
rule.id = inclusions.rule_id
JOIN
rule_card_count
ON
rule.id = rule_card_count.id
WHERE
NOT deck_card.sideboard AND deck_card.n >= inclusions.n AND deck_id IN (217225, 217224, 217223, 217208, 217222, 217221, 217220, 217219, 217218, 217217, 217212, 217216, 217215, 217214, 217213, 217209, 217211, 217210, 217207, 217169, 217206, 217205, 217204, 217162, 217203, 217202, 217201, 217200, 217199, 217198, 217193, 217197, 217196, 217166, 217195, 217194, 217027, 217190, 217182, 217192, 217189, 217191, 217188, 217187, 217185, 217181, 217183, 217180, 217177, 217174, 217172, 217167, 217168, 217126, 217160, 217157, 216930, 217156, 217066, 217150, 217137, 217149, 217148, 217145, 217140, 217136, 217134, 217084, 217021, 217131, 217099, 217125, 216875, 217120, 217121, 216904, 217115, 217111, 217109, 217107, 217112, 217102, 217100, 217094, 217093, 217092, 217081, 217085, 217083, 217078, 217080, 216873, 217015, 217077, 217072, 217071, 217067, 217063, 217059, 217056, 217058, 217057, 217055, 217045, 217043, 217042, 217049, 217036, 217048, 217032, 217029, 217025, 217019, 217017, 217014, 217010, 216874, 217007, 216944, 217006, 217002, 217000, 216999, 217004, 217003, 216991, 216996, 216989, 216995, 216984, 216980, 216901, 216976, 216882, 216973, 216971, 216962, 216961, 216960, 216967, 216959, 216964, 216892, 216897, 216952, 216951, 216950, 216863, 216865, 216943, 216940, 216937, 216932, 216935, 216934, 216920, 216918, 216927, 216926, 216922, 216907, 216912, 216911, 216908, 216893, 216896, 216887, 216889, 216891, 216890, 216884, 216864, 216879, 216878, 216877, 216876, 216870, 216871, 216867, 216866, 216860, 216858, 216857, 216856, 216855) AND TRUE
GROUP BY
deck.id, rule.id
HAVING
included_count = required_count
)
SELECT
candidates.deck_id,
rule.id AS rule_id,
suggested_archetype.id AS archetype_id,
suggested_archetype.name AS archetype_name
FROM
candidates
INNER JOIN
rule
ON
candidates.rule_id = rule.id
JOIN
archetype AS suggested_archetype
ON
rule.archetype_id = suggested_archetype.id
LEFT JOIN
(
SELECT
*
FROM
rule_card
WHERE
NOT include
) AS exclusions
ON
candidates.rule_id = exclusions.rule_id
LEFT JOIN
deck_card
ON
candidates.deck_id = deck_card.deck_id AND exclusions.card = REPLACE(deck_card.card, 'Snow-Covered ', '') AND deck_card.n >= exclusions.n
GROUP BY
candidates.deck_id, rule_id
HAVING
COUNT(REPLACE(deck_card.card, 'Snow-Covered ', '')) = 0
) AS applied_rules
GROUP BY
deck_id
HAVING
COUNT(DISTINCT archetype_id) = 1
```
[]
(slow_query, 2.8, mysql)
Reported on decksite by mysql-perf
Location Hash: e6a2dcf07412409bd46dd1beec603d168789cc32
Labels: decksite
Exceeded slow_query limit (5.1 > 0.5) in mysql: ```
SELECT
deck_id,
archetype_id,
archetype_name
FROM
(
WITH rule_card_count AS
(
SELECT
rule.id, COUNT(card) AS card_count
FROM
rule
JOIN
rule_card
ON
rule.id = rule_card.rule_id
WHERE
rule_card.include AND TRUE
GROUP BY
rule.id
),
candidates AS
(
SELECT
deck.id AS deck_id,
COUNT(DISTINCT REPLACE(deck_card.card, 'Snow-Covered ', '')) AS included_count,
MAX(rule_card_count.card_count) AS required_count,-- fake MAX due to aggregate function
rule.id AS rule_id
FROM
deck
JOIN
deck_card
ON
deck.id = deck_card.deck_id
JOIN
(
SELECT
*
FROM
rule_card
WHERE
include
) AS inclusions
ON
REPLACE(deck_card.card, 'Snow-Covered ', '') = inclusions.card
JOIN
rule
ON
rule.id = inclusions.rule_id
JOIN
rule_card_count
ON
rule.id = rule_card_count.id
WHERE
NOT deck_card.sideboard AND deck_card.n >= inclusions.n AND deck_id IN (217407, 217406, 217385, 217383, 217405, 217404, 217399, 217403, 217402, 217401, 217400, 217395, 217394, 217398, 217393, 217397, 217392, 217396, 217390, 217391, 217389, 217388, 217387, 217248, 217386, 217384, 217382, 217381, 217379, 217380, 217378, 217377, 217376, 217375, 217372, 217374, 217373, 217371, 217370, 217369, 217368, 217367, 217361, 217337, 217366, 217365, 217364, 217341, 217363, 217362, 217351, 217347, 217360, 217359, 217358, 217357, 217356, 217355, 217353, 217354, 217298, 217352, 217350, 217269, 217343, 217349, 217348, 217263, 217346, 217342, 217345, 217344, 217340, 217339, 217335, 217338, 217251, 217336, 217334, 217260, 217333, 217332, 217331, 217330, 217329, 217327, 217328, 217322, 217326, 217325, 217324, 217323, 217216, 217321, 217320, 217318, 217319, 217313, 217317, 217315, 217316, 217310, 217314, 217312, 217311, 217309, 217308, 217259, 217301, 217307, 217304, 217306, 217305, 217303, 217302, 217299, 217279, 217300, 217297, 217294, 217289, 217293, 217288, 217292, 217287, 217296, 217291, 217286, 217295, 217290, 217285, 217284, 217283, 217282, 217281, 217280, 217278, 217277, 217276, 217273, 217275, 217274, 217272, 217271, 217266, 217270, 217213, 217268, 217265, 217264, 217258, 217257, 217256, 217255, 217254, 217253, 217252, 217249, 217245, 217247, 217242, 217246, 217244, 217243, 217241, 217240, 217239, 217238, 217237, 217236, 217235, 217229, 217234, 217233, 217230, 217210, 217232, 217231, 217228, 217227, 217226, 217225, 217223, 217208, 217221, 217218, 217215, 217207, 217206, 217205, 217204, 217162, 217203, 217199, 217198, 217197, 217196, 217194, 217027, 217191, 217188, 217187, 217185, 217181, 217183, 217180, 217177, 217174, 217172, 217167, 217168, 217126, 217160, 217157, 216930, 217156, 217066, 217150, 217137, 217149, 217148, 217145, 217140, 217136, 217134, 217084, 217021, 217131, 217099, 217125, 216875, 217120, 217121, 216904, 217115, 217111, 217109, 217107, 217112, 217102, 217100, 217094, 217093, 217092, 217081, 217085, 217083, 217078, 217080, 216873, 217015, 217077, 217072, 217071, 217067, 217063, 217059, 217056, 217058, 217057, 217055, 217045, 217043, 217042, 217049, 217036, 217048, 217032, 217029, 217025, 217019, 217017, 217014, 217010, 216874, 217007, 216944, 217006, 217002, 217000, 216999, 217004, 217003, 216991, 216996, 216989, 216995, 216984, 216980, 216901, 216976, 216882, 216973, 216971, 216962, 216961, 216960, 216967, 216959, 216964, 216892, 216897, 216952, 216951, 216950, 216863, 216865, 216943, 216940, 216937, 216932, 216935, 216934, 216920, 216918, 216927, 216926, 216922, 216907, 216912, 216911, 216908, 216893, 216896, 216887, 216889, 216891, 216890, 216884, 216864, 216879, 216878, 216877, 216876, 216870, 216871, 216867, 216866, 216860, 216858, 216857, 216856, 216855) AND TRUE
GROUP BY
deck.id, rule.id
HAVING
included_count = required_count
)
SELECT
candidates.deck_id,
rule.id AS rule_id,
suggested_archetype.id AS archetype_id,
suggested_archetype.name AS archetype_name
FROM
candidates
INNER JOIN
rule
ON
candidates.rule_id = rule.id
JOIN
archetype AS suggested_archetype
ON
rule.archetype_id = suggested_archetype.id
LEFT JOIN
(
SELECT
*
FROM
rule_card
WHERE
NOT include
) AS exclusions
ON
candidates.rule_id = exclusions.rule_id
LEFT JOIN
deck_card
ON
candidates.deck_id = deck_card.deck_id AND exclusions.card = REPLACE(deck_card.card, 'Snow-Covered ', '') AND deck_card.n >= exclusions.n
GROUP BY
candidates.deck_id, rule_id
HAVING
COUNT(REPLACE(deck_card.card, 'Snow-Covered ', '')) = 0
) AS applied_rules
GROUP BY
deck_id
HAVING
COUNT(DISTINCT archetype_id) = 1
```
[]
(slow_query, 5.1, mysql)
Reported on decksite by mysql-perf
Location Hash: e6a2dcf07412409bd46dd1beec603d168789cc32
Labels: decksite
Exceeded slow_query limit (3.7 > 0.5) in mysql: ```
SELECT
deck_id,
archetype_id,
archetype_name
FROM
(
WITH rule_card_count AS
(
SELECT
rule.id, COUNT(card) AS card_count
FROM
rule
JOIN
rule_card
ON
rule.id = rule_card.rule_id
WHERE
rule_card.include AND TRUE
GROUP BY
rule.id
),
candidates AS
(
SELECT
deck.id AS deck_id,
COUNT(DISTINCT REPLACE(deck_card.card, 'Snow-Covered ', '')) AS included_count,
MAX(rule_card_count.card_count) AS required_count,-- fake MAX due to aggregate function
rule.id AS rule_id
FROM
deck
JOIN
deck_card
ON
deck.id = deck_card.deck_id
JOIN
(
SELECT
*
FROM
rule_card
WHERE
include
) AS inclusions
ON
REPLACE(deck_card.card, 'Snow-Covered ', '') = inclusions.card
JOIN
rule
ON
rule.id = inclusions.rule_id
JOIN
rule_card_count
ON
rule.id = rule_card_count.id
WHERE
NOT deck_card.sideboard AND deck_card.n >= inclusions.n AND deck_id IN (217410, 217409, 217408, 217406, 217385, 217405, 217400, 217399, 217394, 217392, 217391, 217389, 217388, 217248, 217380, 217377, 217373, 217371, 217366, 217365, 217364, 217341, 217362, 217358, 217356, 217355, 217353, 217354, 217298, 217343, 217345, 217344, 217339, 217338, 217251, 217331, 217329, 217327, 217322, 217326, 217325, 217216, 217320, 217319, 217313, 217316, 217314, 217312, 217307, 217306, 217305, 217303, 217302, 217279, 217297, 217290, 217287, 217286, 217296, 217285, 217292, 217278, 217276, 217273, 217275, 217271, 217270, 217213, 217258, 217257, 217255, 217253, 217242, 217246, 217241, 217240, 217238, 217237, 217236, 217229, 217210, 217232, 217226, 217225, 217223, 217208, 217221, 217218, 217215, 217207, 217206, 217205, 217204, 217162, 217203, 217199, 217198, 217197, 217196, 217194, 217027, 217191, 217188, 217187, 217185, 217181, 217183, 217180, 217177, 217174, 217172, 217167, 217168, 217126, 217160, 217157, 216930, 217156, 217066, 217150, 217137, 217149, 217148, 217145, 217140, 217136, 217134, 217084, 217021, 217131, 217099, 217125, 216875, 217120, 217121, 216904, 217115, 217109, 217107, 217112, 217111, 217102, 217100, 217094, 217093, 217092, 217081, 217085, 217083, 217078, 217080, 216873, 217015, 217077, 217072, 217071, 217067, 217063, 217059, 217056, 217058, 217057, 217055, 217045, 217043, 217042, 217049, 217036, 217048, 217032, 217029, 217025, 217019, 217017, 217014, 217010, 216874, 217007, 216944, 217006, 217000, 216999, 217004, 217003, 217002, 216991, 216996, 216989, 216995, 216984, 216980, 216901, 216976, 216882, 216973, 216971, 216962, 216961, 216960, 216967, 216959, 216964, 216892, 216897, 216952, 216951, 216950, 216863, 216865, 216943, 216940, 216937, 216932, 216935, 216934, 216918, 216927, 216926, 216922, 216920, 216907, 216912, 216911, 216908, 216893, 216896, 216887, 216889, 216891, 216890, 216884, 216864, 216879, 216878, 216877, 216876, 216870, 216871, 216867, 216866, 216860, 216858, 216857, 216856, 216855) AND TRUE
GROUP BY
deck.id, rule.id
HAVING
included_count = required_count
)
SELECT
candidates.deck_id,
rule.id AS rule_id,
suggested_archetype.id AS archetype_id,
suggested_archetype.name AS archetype_name
FROM
candidates
INNER JOIN
rule
ON
candidates.rule_id = rule.id
JOIN
archetype AS suggested_archetype
ON
rule.archetype_id = suggested_archetype.id
LEFT JOIN
(
SELECT
*
FROM
rule_card
WHERE
NOT include
) AS exclusions
ON
candidates.rule_id = exclusions.rule_id
LEFT JOIN
deck_card
ON
candidates.deck_id = deck_card.deck_id AND exclusions.card = REPLACE(deck_card.card, 'Snow-Covered ', '') AND deck_card.n >= exclusions.n
GROUP BY
candidates.deck_id, rule_id
HAVING
COUNT(REPLACE(deck_card.card, 'Snow-Covered ', '')) = 0
) AS applied_rules
GROUP BY
deck_id
HAVING
COUNT(DISTINCT archetype_id) = 1
```
[]
(slow_query, 3.7, mysql)
Reported on decksite by mysql-perf
Location Hash: e6a2dcf07412409bd46dd1beec603d168789cc32
Labels: decksite
Exceeded slow_query limit (3.0 > 0.5) in mysql: ```
SELECT
deck_id,
archetype_id,
archetype_name
FROM
(
WITH rule_card_count AS
(
SELECT
rule.id, COUNT(card) AS card_count
FROM
rule
JOIN
rule_card
ON
rule.id = rule_card.rule_id
WHERE
rule_card.include AND TRUE
GROUP BY
rule.id
),
candidates AS
(
SELECT
deck.id AS deck_id,
COUNT(DISTINCT REPLACE(deck_card.card, 'Snow-Covered ', '')) AS included_count,
MAX(rule_card_count.card_count) AS required_count,-- fake MAX due to aggregate function
rule.id AS rule_id
FROM
deck
JOIN
deck_card
ON
deck.id = deck_card.deck_id
JOIN
(
SELECT
*
FROM
rule_card
WHERE
include
) AS inclusions
ON
REPLACE(deck_card.card, 'Snow-Covered ', '') = inclusions.card
JOIN
rule
ON
rule.id = inclusions.rule_id
JOIN
rule_card_count
ON
rule.id = rule_card_count.id
WHERE
NOT deck_card.sideboard AND deck_card.n >= inclusions.n AND deck_id IN (217307, 217306, 217305, 217303, 217302, 217279, 217297, 217287, 217286, 217296, 217285, 217292, 217290, 217278, 217276, 217273, 217275, 217271, 217270, 217213, 217258, 217257, 217255, 217253, 217242, 217246, 217241, 217240, 217238, 217237, 217236, 217229, 217210, 217232, 217226, 217225, 217223, 217208, 217221, 217218, 217215, 217207, 217206, 217205, 217204, 217162, 217203, 217199, 217198, 217197, 217196, 217194, 217027, 217191, 217188, 217187, 217185, 217181, 217183, 217180, 217177, 217174, 217172, 217167, 217168, 217126, 217160, 217157, 216930, 217156, 217066, 217150, 217137, 217149, 217148, 217145, 217140, 217136, 217134, 217084, 217021, 217131, 217099, 217125, 216875, 217120, 217121, 216904, 217115, 217111, 217109, 217107, 217112, 217102, 217100, 217094, 217093, 217092, 217081, 217085, 217083, 217078, 217080, 216873, 217015, 217077, 217072, 217071, 217067, 217063, 217059, 217056, 217058, 217057, 217055, 217045, 217043, 217042, 217049, 217036, 217048, 217032, 217029, 217025, 217019, 217017, 217014, 217010, 216874, 217007, 216944, 217006, 217002, 217000, 216999, 217004, 217003, 216991, 216996, 216989, 216995, 216984, 216980, 216901, 216976, 216882, 216973, 216971, 216962, 216961, 216960, 216967, 216959, 216964, 216892, 216897, 216952, 216951, 216950, 216863, 216865, 216943, 216940, 216937, 216932, 216935, 216934, 216920, 216918, 216927, 216926, 216922, 216907, 216912, 216911, 216908, 216893, 216896, 216887, 216889, 216891, 216890, 216884, 216864, 216879, 216878, 216877, 216876, 216870, 216871, 216867, 216866, 216860, 216858, 216857, 216856, 216855) AND TRUE
GROUP BY
deck.id, rule.id
HAVING
included_count = required_count
)
SELECT
candidates.deck_id,
rule.id AS rule_id,
suggested_archetype.id AS archetype_id,
suggested_archetype.name AS archetype_name
FROM
candidates
INNER JOIN
rule
ON
candidates.rule_id = rule.id
JOIN
archetype AS suggested_archetype
ON
rule.archetype_id = suggested_archetype.id
LEFT JOIN
(
SELECT
*
FROM
rule_card
WHERE
NOT include
) AS exclusions
ON
candidates.rule_id = exclusions.rule_id
LEFT JOIN
deck_card
ON
candidates.deck_id = deck_card.deck_id AND exclusions.card = REPLACE(deck_card.card, 'Snow-Covered ', '') AND deck_card.n >= exclusions.n
GROUP BY
candidates.deck_id, rule_id
HAVING
COUNT(REPLACE(deck_card.card, 'Snow-Covered ', '')) = 0
) AS applied_rules
GROUP BY
deck_id
HAVING
COUNT(DISTINCT archetype_id) = 1
```
[]
(slow_query, 3.0, mysql)
Reported on decksite by mysql-perf
Location Hash: e6a2dcf07412409bd46dd1beec603d168789cc32
Labels: decksite
Exceeded slow_query limit (1.3 > 0.5) in mysql: ```
SELECT
deck_id,
archetype_id,
archetype_name
FROM
(
WITH rule_card_count AS
(
SELECT
rule.id, COUNT(card) AS card_count
FROM
rule
JOIN
rule_card
ON
rule.id = rule_card.rule_id
WHERE
rule_card.include AND TRUE
GROUP BY
rule.id
),
candidates AS
(
SELECT
deck.id AS deck_id,
COUNT(DISTINCT REPLACE(deck_card.card, 'Snow-Covered ', '')) AS included_count,
MAX(rule_card_count.card_count) AS required_count,-- fake MAX due to aggregate function
rule.id AS rule_id
FROM
deck
JOIN
deck_card
ON
deck.id = deck_card.deck_id
JOIN
(
SELECT
*
FROM
rule_card
WHERE
include
) AS inclusions
ON
REPLACE(deck_card.card, 'Snow-Covered ', '') = inclusions.card
JOIN
rule
ON
rule.id = inclusions.rule_id
JOIN
rule_card_count
ON
rule.id = rule_card_count.id
WHERE
NOT deck_card.sideboard AND deck_card.n >= inclusions.n AND deck_id IN (217501, 217500, 217497, 217499, 217498, 217494, 217496, 217495, 217492, 217493, 217482, 217491, 217490, 217489, 217488, 217487, 217486, 217485, 217461, 217484, 217483, 217428, 217477, 217481, 217476, 217480, 217479, 217478, 217473, 217468, 217472, 217467, 217471, 217466, 217475, 217470, 217465, 217474, 217469, 217464, 217429, 217463, 217462, 217458, 217460, 217459, 217455, 217457, 217456, 217454, 217453, 217452, 217451, 217450, 217442, 217449, 217444, 217448, 217447, 217446, 217445, 217443, 217441, 217440, 217439, 217438, 217437, 217436, 217435, 217434, 217433, 217430, 217432, 217431, 217427, 217424, 217425, 217426, 217416, 217423, 217422, 217421, 217420, 217415, 217419, 217418, 217417, 217414) AND TRUE
GROUP BY
deck.id, rule.id
HAVING
included_count = required_count
)
SELECT
candidates.deck_id,
rule.id AS rule_id,
suggested_archetype.id AS archetype_id,
suggested_archetype.name AS archetype_name
FROM
candidates
INNER JOIN
rule
ON
candidates.rule_id = rule.id
JOIN
archetype AS suggested_archetype
ON
rule.archetype_id = suggested_archetype.id
LEFT JOIN
(
SELECT
*
FROM
rule_card
WHERE
NOT include
) AS exclusions
ON
candidates.rule_id = exclusions.rule_id
LEFT JOIN
deck_card
ON
candidates.deck_id = deck_card.deck_id AND exclusions.card = REPLACE(deck_card.card, 'Snow-Covered ', '') AND deck_card.n >= exclusions.n
GROUP BY
candidates.deck_id, rule_id
HAVING
COUNT(REPLACE(deck_card.card, 'Snow-Covered ', '')) = 0
) AS applied_rules
GROUP BY
deck_id
HAVING
COUNT(DISTINCT archetype_id) = 1
```
[]
(slow_query, 1.3, mysql)
Reported on decksite by mysql-perf
Location Hash: e6a2dcf07412409bd46dd1beec603d168789cc32
Labels: decksite
Exceeded slow_query limit (1.6 > 0.5) in mysql: ```
SELECT
deck_id,
archetype_id,
archetype_name
FROM
(
WITH rule_card_count AS
(
SELECT
rule.id, COUNT(card) AS card_count
FROM
rule
JOIN
rule_card
ON
rule.id = rule_card.rule_id
WHERE
rule_card.include AND TRUE
GROUP BY
rule.id
),
candidates AS
(
SELECT
deck.id AS deck_id,
COUNT(DISTINCT REPLACE(deck_card.card, 'Snow-Covered ', '')) AS included_count,
MAX(rule_card_count.card_count) AS required_count,-- fake MAX due to aggregate function
rule.id AS rule_id
FROM
deck
JOIN
deck_card
ON
deck.id = deck_card.deck_id
JOIN
(
SELECT
*
FROM
rule_card
WHERE
include
) AS inclusions
ON
REPLACE(deck_card.card, 'Snow-Covered ', '') = inclusions.card
JOIN
rule
ON
rule.id = inclusions.rule_id
JOIN
rule_card_count
ON
rule.id = rule_card_count.id
WHERE
NOT deck_card.sideboard AND deck_card.n >= inclusions.n AND deck_id IN (217581, 217580, 217579, 217578, 217575, 217577, 217576, 217574, 217567, 217573, 217570, 217572, 217569, 217571, 217555, 217557, 217568, 217565, 217560, 217564, 217563, 217562, 217566, 217561, 217559, 217558, 217556, 217554, 217553, 217552, 217551, 217550, 217464, 217549, 217544, 217548, 217547, 217546, 217543, 217545, 217542, 217541, 217539, 217540, 217538, 217537, 217536, 217535, 217533, 217534, 217531, 217532, 217441, 217530, 217516, 217529, 217528, 217527, 217526, 217525, 217519, 217523, 217518, 217522, 217517, 217521, 217520, 217524, 217515, 217514, 217513, 217512, 217511, 217510, 217509, 217506, 217508, 217507, 217505, 217504, 217501, 217503, 217502, 217499, 217494, 217492, 217493, 217482, 217489, 217486, 217485, 217461, 217483, 217481, 217479, 217468, 217467, 217466, 217470, 217469, 217429, 217463, 217459, 217447, 217440, 217438, 217431, 217424, 217425, 217426, 217416, 217421, 217420, 217415, 217419, 217418) AND TRUE
GROUP BY
deck.id, rule.id
HAVING
included_count = required_count
)
SELECT
candidates.deck_id,
rule.id AS rule_id,
suggested_archetype.id AS archetype_id,
suggested_archetype.name AS archetype_name
FROM
candidates
INNER JOIN
rule
ON
candidates.rule_id = rule.id
JOIN
archetype AS suggested_archetype
ON
rule.archetype_id = suggested_archetype.id
LEFT JOIN
(
SELECT
*
FROM
rule_card
WHERE
NOT include
) AS exclusions
ON
candidates.rule_id = exclusions.rule_id
LEFT JOIN
deck_card
ON
candidates.deck_id = deck_card.deck_id AND exclusions.card = REPLACE(deck_card.card, 'Snow-Covered ', '') AND deck_card.n >= exclusions.n
GROUP BY
candidates.deck_id, rule_id
HAVING
COUNT(REPLACE(deck_card.card, 'Snow-Covered ', '')) = 0
) AS applied_rules
GROUP BY
deck_id
HAVING
COUNT(DISTINCT archetype_id) = 1
```
[]
(slow_query, 1.6, mysql)
Reported on decksite by mysql-perf
Location Hash: e6a2dcf07412409bd46dd1beec603d168789cc32
Labels: decksite
Exceeded slow_query limit (2.3 > 0.5) in mysql: ```
SELECT
deck_id,
archetype_id,
archetype_name
FROM
(
WITH rule_card_count AS
(
SELECT
rule.id, COUNT(card) AS card_count
FROM
rule
JOIN
rule_card
ON
rule.id = rule_card.rule_id
WHERE
rule_card.include AND TRUE
GROUP BY
rule.id
),
candidates AS
(
SELECT
deck.id AS deck_id,
COUNT(DISTINCT REPLACE(deck_card.card, 'Snow-Covered ', '')) AS included_count,
MAX(rule_card_count.card_count) AS required_count,-- fake MAX due to aggregate function
rule.id AS rule_id
FROM
deck
JOIN
deck_card
ON
deck.id = deck_card.deck_id
JOIN
(
SELECT
*
FROM
rule_card
WHERE
include
) AS inclusions
ON
REPLACE(deck_card.card, 'Snow-Covered ', '') = inclusions.card
JOIN
rule
ON
rule.id = inclusions.rule_id
JOIN
rule_card_count
ON
rule.id = rule_card_count.id
WHERE
NOT deck_card.sideboard AND deck_card.n >= inclusions.n AND deck_id IN (217633, 217632, 217631, 217507, 217626, 217630, 217629, 217628, 217627, 217621, 217625, 217624, 217623, 217622, 217619, 217612, 217620, 217614, 217617, 217618, 217616, 217615, 217610, 217613, 217600, 217611, 217609, 217607, 217608, 217606, 217603, 217605, 217604, 217602, 217601, 217599, 217598, 217594, 217597, 217530, 217596, 217595, 217588, 217593, 217489, 217592, 217546, 217591, 217590, 217589, 217586, 217580, 217587, 217585, 217584, 217577, 217581, 217583, 217582, 217579, 217578, 217575, 217576, 217574, 217567, 217573, 217570, 217572, 217569, 217571, 217555, 217557, 217568, 217563, 217562, 217566, 217561, 217565, 217560, 217564, 217559, 217558, 217556, 217554, 217553, 217552, 217551, 217550, 217464, 217549, 217544, 217548, 217547, 217543, 217545, 217542, 217541, 217539, 217540, 217538, 217537, 217536, 217535, 217533, 217534, 217531, 217532, 217441, 217516, 217529, 217526, 217525, 217528, 217527, 217522, 217517, 217521, 217520, 217524, 217519, 217523, 217518, 217515, 217514, 217513, 217512, 217511, 217510, 217509, 217506, 217508, 217505, 217504, 217501, 217503, 217502, 217499, 217494, 217492, 217493, 217482, 217486, 217485, 217461, 217483, 217479, 217481, 217466, 217470, 217469, 217468, 217467, 217429, 217463, 217459, 217447, 217440, 217438, 217431, 217424, 217425, 217426, 217416, 217421, 217420, 217415, 217419, 217418) AND TRUE
GROUP BY
deck.id, rule.id
HAVING
included_count = required_count
)
SELECT
candidates.deck_id,
rule.id AS rule_id,
suggested_archetype.id AS archetype_id,
suggested_archetype.name AS archetype_name
FROM
candidates
INNER JOIN
rule
ON
candidates.rule_id = rule.id
JOIN
archetype AS suggested_archetype
ON
rule.archetype_id = suggested_archetype.id
LEFT JOIN
(
SELECT
*
FROM
rule_card
WHERE
NOT include
) AS exclusions
ON
candidates.rule_id = exclusions.rule_id
LEFT JOIN
deck_card
ON
candidates.deck_id = deck_card.deck_id AND exclusions.card = REPLACE(deck_card.card, 'Snow-Covered ', '') AND deck_card.n >= exclusions.n
GROUP BY
candidates.deck_id, rule_id
HAVING
COUNT(REPLACE(deck_card.card, 'Snow-Covered ', '')) = 0
) AS applied_rules
GROUP BY
deck_id
HAVING
COUNT(DISTINCT archetype_id) = 1
```
[]
(slow_query, 2.3, mysql)
Reported on decksite by mysql-perf
Location Hash: e6a2dcf07412409bd46dd1beec603d168789cc32
Labels: decksite
Exceeded slow_query limit (2.7 > 0.5) in mysql: ```
SELECT
deck_id,
archetype_id,
archetype_name
FROM
(
WITH rule_card_count AS
(
SELECT
rule.id, COUNT(card) AS card_count
FROM
rule
JOIN
rule_card
ON
rule.id = rule_card.rule_id
WHERE
rule_card.include AND TRUE
GROUP BY
rule.id
),
candidates AS
(
SELECT
deck.id AS deck_id,
COUNT(DISTINCT REPLACE(deck_card.card, 'Snow-Covered ', '')) AS included_count,
MAX(rule_card_count.card_count) AS required_count,-- fake MAX due to aggregate function
rule.id AS rule_id
FROM
deck
JOIN
deck_card
ON
deck.id = deck_card.deck_id
JOIN
(
SELECT
*
FROM
rule_card
WHERE
include
) AS inclusions
ON
REPLACE(deck_card.card, 'Snow-Covered ', '') = inclusions.card
JOIN
rule
ON
rule.id = inclusions.rule_id
JOIN
rule_card_count
ON
rule.id = rule_card_count.id
WHERE
NOT deck_card.sideboard AND deck_card.n >= inclusions.n AND deck_id IN (217705, 217704, 217703, 217702, 217701, 217682, 217700, 217699, 217694, 217698, 217697, 217696, 217695, 217690, 217685, 217689, 217684, 217693, 217688, 217692, 217687, 217691, 217686, 217683, 217681, 217680, 217670, 217679, 217675, 217678, 217677, 217673, 217676, 217674, 217485, 217672, 217611, 217671, 217669, 217668, 217661, 217667, 217656, 217666, 217665, 217664, 217663, 217662, 217660, 217659, 217658, 217647, 217657, 217620, 217652, 217655, 217654, 217653, 217641, 217651, 217649, 217650, 217593, 217645, 217648, 217646, 217643, 217644, 217642, 217639, 217638, 217640, 217629, 217637, 217635, 217636, 217634, 217632, 217631, 217507, 217623, 217622, 217619, 217612, 217614, 217617, 217618, 217616, 217610, 217613, 217600, 217606, 217605, 217604, 217601, 217599, 217598, 217594, 217597, 217530, 217596, 217595, 217489, 217592, 217546, 217591, 217590, 217589, 217586, 217580, 217587, 217585, 217579, 217576, 217567, 217570, 217569, 217571, 217555, 217568, 217563, 217566, 217558, 217556, 217554, 217464, 217549, 217544, 217543, 217545, 217540, 217538, 217537, 217536, 217535, 217533, 217531, 217532, 217516, 217529, 217525, 217528, 217527, 217526, 217522, 217519, 217515, 217514, 217511, 217510, 217509, 217506, 217508, 217501, 217502, 217499, 217494, 217492, 217493, 217482, 217486, 217461, 217483, 217481, 217479, 217467, 217466, 217470, 217469, 217468, 217429, 217463, 217459, 217447, 217440, 217438, 217431, 217424, 217425, 217426, 217416, 217421, 217420, 217415, 217419, 217418) AND TRUE
GROUP BY
deck.id, rule.id
HAVING
included_count = required_count
)
SELECT
candidates.deck_id,
rule.id AS rule_id,
suggested_archetype.id AS archetype_id,
suggested_archetype.name AS archetype_name
FROM
candidates
INNER JOIN
rule
ON
candidates.rule_id = rule.id
JOIN
archetype AS suggested_archetype
ON
rule.archetype_id = suggested_archetype.id
LEFT JOIN
(
SELECT
*
FROM
rule_card
WHERE
NOT include
) AS exclusions
ON
candidates.rule_id = exclusions.rule_id
LEFT JOIN
deck_card
ON
candidates.deck_id = deck_card.deck_id AND exclusions.card = REPLACE(deck_card.card, 'Snow-Covered ', '') AND deck_card.n >= exclusions.n
GROUP BY
candidates.deck_id, rule_id
HAVING
COUNT(REPLACE(deck_card.card, 'Snow-Covered ', '')) = 0
) AS applied_rules
GROUP BY
deck_id
HAVING
COUNT(DISTINCT archetype_id) = 1
```
[]
(slow_query, 2.7, mysql)
Reported on decksite by mysql-perf
Location Hash: e6a2dcf07412409bd46dd1beec603d168789cc32
Labels: decksite
Exceeded slow_query limit (2.9 > 0.5) in mysql: ```
SELECT
deck_id,
archetype_id,
archetype_name
FROM
(
WITH rule_card_count AS
(
SELECT
rule.id, COUNT(card) AS card_count
FROM
rule
JOIN
rule_card
ON
rule.id = rule_card.rule_id
WHERE
rule_card.include AND TRUE
GROUP BY
rule.id
),
candidates AS
(
SELECT
deck.id AS deck_id,
COUNT(DISTINCT REPLACE(deck_card.card, 'Snow-Covered ', '')) AS included_count,
MAX(rule_card_count.card_count) AS required_count,-- fake MAX due to aggregate function
rule.id AS rule_id
FROM
deck
JOIN
deck_card
ON
deck.id = deck_card.deck_id
JOIN
(
SELECT
*
FROM
rule_card
WHERE
include
) AS inclusions
ON
REPLACE(deck_card.card, 'Snow-Covered ', '') = inclusions.card
JOIN
rule
ON
rule.id = inclusions.rule_id
JOIN
rule_card_count
ON
rule.id = rule_card_count.id
WHERE
NOT deck_card.sideboard AND deck_card.n >= inclusions.n AND deck_id IN (217747, 217746, 217745, 217738, 217744, 217743, 217742, 217741, 217740, 217739, 217737, 217736, 217735, 217734, 217733, 217722, 217732, 217723, 217731, 217730, 217729, 217725, 217728, 217655, 217727, 217726, 217724, 217721, 217720, 217719, 217718, 217672, 217717, 217712, 217716, 217715, 217714, 217710, 217713, 217637, 217711, 217709, 217597, 217708, 217707, 217706, 217705, 217703, 217702, 217701, 217682, 217700, 217698, 217696, 217695, 217694, 217699, 217689, 217688, 217684, 217691, 217683, 217681, 217680, 217670, 217676, 217674, 217485, 217611, 217669, 217668, 217656, 217665, 217664, 217660, 217659, 217657, 217620, 217652, 217654, 217641, 217649, 217593, 217645, 217644, 217639, 217640, 217629, 217636, 217632, 217631, 217507, 217623, 217622, 217619, 217612, 217614, 217617, 217618, 217616, 217610, 217613, 217600, 217606, 217605, 217604, 217601, 217599, 217598, 217594, 217530, 217596, 217595, 217489, 217592, 217546, 217591, 217590, 217589, 217586, 217580, 217587, 217585, 217579, 217576, 217567, 217570, 217569, 217571, 217555, 217568, 217566, 217563, 217558, 217556, 217554, 217464, 217549, 217544, 217543, 217545, 217540, 217538, 217537, 217536, 217535, 217533, 217531, 217532, 217516, 217529, 217525, 217528, 217527, 217526, 217522, 217519, 217515, 217514, 217511, 217510, 217509, 217506, 217508, 217501, 217502, 217499, 217494, 217492, 217493, 217482, 217486, 217461, 217483, 217481, 217479, 217467, 217466, 217470, 217469, 217468, 217429, 217463, 217459, 217447, 217440, 217438, 217431, 217424, 217425, 217426, 217416, 217421, 217420, 217415, 217419, 217418) AND TRUE
GROUP BY
deck.id, rule.id
HAVING
included_count = required_count
)
SELECT
candidates.deck_id,
rule.id AS rule_id,
suggested_archetype.id AS archetype_id,
suggested_archetype.name AS archetype_name
FROM
candidates
INNER JOIN
rule
ON
candidates.rule_id = rule.id
JOIN
archetype AS suggested_archetype
ON
rule.archetype_id = suggested_archetype.id
LEFT JOIN
(
SELECT
*
FROM
rule_card
WHERE
NOT include
) AS exclusions
ON
candidates.rule_id = exclusions.rule_id
LEFT JOIN
deck_card
ON
candidates.deck_id = deck_card.deck_id AND exclusions.card = REPLACE(deck_card.card, 'Snow-Covered ', '') AND deck_card.n >= exclusions.n
GROUP BY
candidates.deck_id, rule_id
HAVING
COUNT(REPLACE(deck_card.card, 'Snow-Covered ', '')) = 0
) AS applied_rules
GROUP BY
deck_id
HAVING
COUNT(DISTINCT archetype_id) = 1
```
[]
(slow_query, 2.9, mysql)
Reported on decksite by mysql-perf
Location Hash: e6a2dcf07412409bd46dd1beec603d168789cc32
Labels: decksite
[]
(slow_query, 0.7, mysql)Reported on decksite by mysql-perf
Location Hash: e6a2dcf07412409bd46dd1beec603d168789cc32
Request Data
``` Request Method: GET Path: /admin/archetypes/? Cookies: ImmutableMultiDict([('hide_intro', 'True'), ('session', '.eJx1UV1rgzAU_S95dkVN60ff7MY2RmVdnTg6hgS9avyKJJFVS__7YqF2DPaWc-45OTcnJxR3wBvSQivRWvIeNETShrZXkEJDG5bOkIqE8TSmikGm4doYrxwb6zo2XBMv0U1Rs4TUoFTQ3oWBGvxvoW2c97SeQ35Z0YTyHNJpTcHaS7ChWxpqZM7iXgBvSTNpy7iBiig9I70szFhIIieebk0zzLvAeSh3UAlPT4vAdIPmecxew8NNL1ml4tYnRJIEhLhi9PKxt3xaezaMm_vhAEH1vfd53R2jvuyelB-OHeUgYqIKNFaOha2l7VoL3cW2YeLbfOrU0peOrmuIQ6aoYg5J0zDCgzf2UeR7Ufa43W2g9AsPj28We1chqtNOveZTtah-imaD4i6difmwKJmK-NLQ5dJYDpMBbYBw4Oisob8FSsJzUDu3fV2ffwDrUKg6.ZE8QBQ.L9SV7vchBRFRIRTB5P9SwRZfjYE'), ('session', '.eJx1UV1rgzAU_S95dkVN60ff7MY2RmVdnTg6hgS9avyKJJFVS__7YqF2DPaWc-45OTcnJxR3wBvSQivRWvIeNETShrZXkEJDG5bOkIqE8TSmikGm4doYrxwb6zo2XBMv0U1Rs4TUoFTQ3oWBGvxvoW2c97SeQ35Z0YTyHNJpTcHaS7ChWxpqZM7iXgBvSTNpy7iBiig9I70szFhIIieebk0zzLvAeSh3UAlPT4vAdIPmecxew8NNL1ml4tYnRJIEhLhi9PKxt3xaezaMm_vhAEH1vfd53R2jvuyelB-OHeUgYqIKNFaOha2l7VoL3cW2YeLbfOrU0peOrmuIQ6aoYg5J0zDCgzf2UeR7Ufa43W2g9AsPj28We1chqtNOveZTtah-imaD4i6difmwKJmK-NLQ5dJYDpMBbYBw4Oisob8FSsJzUDu3fV2ffwDrUKg6.ZHGD7Q.cfIIbv-X991M45248aMr73KkVxc'), ('views', '3')]) Endpoint: edit_archetypes View Args: {} Person: 219733587300319234 Referrer: https://pennydreadfulmagic.com/ Request Data: {} Host: pennydreadfulmagic.com Connection: Keep-Alive Accept-Encoding: gzip X-Forwarded-For: 97.103.253.204 Cf-Ray: 7cdb70851c318e00-MIA X-Forwarded-Proto: https Cf-Visitor: {"scheme":"https"} Sec-Ch-Ua: "Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24" Sec-Ch-Ua-Mobile: ?0 Sec-Ch-Ua-Platform: "Windows" Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 Sec-Fetch-Site: same-origin Sec-Fetch-Mode: navigate Sec-Fetch-User: ?1 Sec-Fetch-Dest: document Referer: https://pennydreadfulmagic.com/ Accept-Language: en-US,en;q=0.9 Cookie: hide_intro=True; session=.eJx1UV1rgzAU_S95dkVN60ff7MY2RmVdnTg6hgS9avyKJJFVS__7YqF2DPaWc-45OTcnJxR3wBvSQivRWvIeNETShrZXkEJDG5bOkIqE8TSmikGm4doYrxwb6zo2XBMv0U1Rs4TUoFTQ3oWBGvxvoW2c97SeQ35Z0YTyHNJpTcHaS7ChWxpqZM7iXgBvSTNpy7iBiig9I70szFhIIieebk0zzLvAeSh3UAlPT4vAdIPmecxew8NNL1ml4tYnRJIEhLhi9PKxt3xaezaMm_vhAEH1vfd53R2jvuyelB-OHeUgYqIKNFaOha2l7VoL3cW2YeLbfOrU0peOrmuIQ6aoYg5J0zDCgzf2UeR7Ufa43W2g9AsPj28We1chqtNOveZTtah-imaD4i6difmwKJmK-NLQ5dJYDpMBbYBw4Oisob8FSsJzUDu3fV2ffwDrUKg6.ZE8QBQ.L9SV7vchBRFRIRTB5P9SwRZfjYE; session=.eJx1UV1rgzAU_S95dkVN60ff7MY2RmVdnTg6hgS9avyKJJFVS__7YqF2DPaWc-45OTcnJxR3wBvSQivRWvIeNETShrZXkEJDG5bOkIqE8TSmikGm4doYrxwb6zo2XBMv0U1Rs4TUoFTQ3oWBGvxvoW2c97SeQ35Z0YTyHNJpTcHaS7ChWxpqZM7iXgBvSTNpy7iBiig9I70szFhIIieebk0zzLvAeSh3UAlPT4vAdIPmecxew8NNL1ml4tYnRJIEhLhi9PKxt3xaezaMm_vhAEH1vfd53R2jvuyelB-OHeUgYqIKNFaOha2l7VoL3cW2YeLbfOrU0peOrmuIQ6aoYg5J0zDCgzf2UeR7Ufa43W2g9AsPj28We1chqtNOveZTtah-imaD4i6difmwKJmK-NLQ5dJYDpMBbYBw4Oisob8FSsJzUDu3fV2ffwDrUKg6.ZHGD7Q.cfIIbv-X991M45248aMr73KkVxc; views=3 Priority: u=0, i Cf-Connecting-Ip: 97.103.253.204 Cf-Ipcountry: US Cdn-Loop: cloudflare ```