In case you have your own slow SQL query, you can optimize it automatically here.
For the query above, the following recommendations will be helpful as part of the SQL tuning process.
You'll find 3 sections below:
ALTER TABLE `country` ADD INDEX `country_idx_country_en_version_countrycod` (`country_en`,`version`,`countrycode`);
ALTER TABLE `exostsdk` ADD INDEX `exostsdk_idx_event_id_day` (`event_id`,`day`);
SELECT
c.country_en AS country,
a.day,
count(1) AS expo_cnt,
count(DISTINCT a.imei) AS expo_users
FROM
exostsdk a
JOIN
(
SELECT
country.country_en,
country.version,
country.countrycode
FROM
country
GROUP BY
country.country_en,
country.version,
country.countrycode
ORDER BY
NULL
) c
ON a.cm = c.countrycode
AND a.app_version_code = c.version
WHERE
(
a.day >= '2019-12-01'
AND a.day <= '2020-02-23'
AND a.event_id = '00***|0*0'
AND a.cm IN (
'ID', 'IN'
)
)
GROUP BY
c.country_en,
a.day
ORDER BY
NULL