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 `visits` ADD INDEX `visits_idx_status_user_id` (`status`,`user_id`);
SELECT
users.user_id,
COUNT(visits.id)
FROM
users u
JOIN
visits v
ON v.user_id = u.user_id
WHERE
visits.status = 'active'