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 `es_temp1` ADD INDEX `es_temp1_idx_user_id` (`USER_ID`);
ALTER TABLE `es_temp2` ADD INDEX `es_temp2_idx_user_id` (`USER_ID`);
ALTER TABLE `es_temp3` ADD INDEX `es_temp3_idx_user_id` (`USER_ID`);
ALTER TABLE `es_temp4` ADD INDEX `es_temp4_idx_user_id` (`USER_ID`);
SELECT
u.ID,
es_temp1.interesting_posts,
es_temp2.boring_posts,
es_temp3.interesting_comments,
es_temp4.boring_comments
FROM
USERS u
LEFT JOIN
es_temp1
ON es_temp1.USER_ID = u.ID
LEFT JOIN
es_temp2
ON es_temp2.USER_ID = u.ID
LEFT JOIN
es_temp3
ON es_temp3.USER_ID = u.ID
LEFT JOIN
es_temp4
ON es_temp4.USER_ID = u.ID