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 `account` ADD INDEX `account_idx_service_id_status_id` (`service_id`,`status`,`id`);
ALTER TABLE `account_data` ADD INDEX `account_data_idx_status_property_value` (`status`,`property_id`,`value`);
ALTER TABLE `property` ADD INDEX `property_idx_create_ana_status_id` (`create_analytics`,`status`,`id`);
SELECT
ad.value,
p.uri,
count(ad.id)
FROM
account_data ad
INNER JOIN
property p
ON ad.property_id = p.id
AND (
p.status = 1
)
INNER JOIN
account ac
ON ad.account_id = ac.id
AND (
ac.status = 1
)
WHERE
(
p.create_analytics = '1'
AND ac.service_id = ?
)
AND (
ad.status = 1
)
GROUP BY
ad.property_id,
ad.value
ORDER BY
NULL