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 `STATUS` ADD INDEX `status_idx_group_id_user_id` (`group_id`,`user_id`);
ALTER TABLE `STATUS` ADD INDEX `status_idx_user_id_project_id` (`user_id`,`project_id`);
SELECT
STATUS.user_id
FROM
STATUS
WHERE
STATUS.group_id = 1
AND NOT EXISTS (
SELECT
1
FROM
STATUS AS STATUS1
WHERE
(
STATUS1.project_id = 2
)
AND (
STATUS.user_id = STATUS1.user_id
)
GROUP BY
STATUS1.user_id
ORDER BY
NULL
)
GROUP BY
STATUS.user_id
ORDER BY
NULL