Statement execution is
SELECT
A.s exs AS sex,
IFNULL (p. ercentage, 0) AS percentage with
The FROM (
SELECT the 'male' AS sexs
UNION ALL
SELECT the 'female'
) a
LEFT the JOIN
(
SELECT
P. EX,
COUNT (1)
(15315) AS percentage with
The FROM player_login_logout_log A
LEFT the JOIN player_create_log P ON a. ` role_id `=P.R OLE_ID
WHERE player_state='login'
- AND IF - (_system_type IS NULL, 0=0, a.s ystem_type=_system_type) AND the IF (_platform IS NULL, 0=0, Amy polumbo latform=_platform) AND the IF (_zone_id IS NULL, 0=0, a.z one_id=_zone_id)
AND the LEFT (A.t ime, 10) BETWEEN '2018-04-01' AND '2018-04-30 s'
GROUP BY p. EX
B) ON a.s exs=b.s ex;
The execution plan is really don't know red circle is how to
CodePudding user response:
Player, the two form the index of the situation, saidCodePudding user response: