Здравствуйте. Как можно оптимизировать такой MySQL-запрос?
SELECT U.id,U.name,U.birthday,U.sex,U.city,U.status,U.regdate
FROM users U
LEFT JOIN shipping SA ON SA.user_id=U.id
LEFT JOIN activity A ON A.user_id=U.id
LEFT JOIN blocked B ON B.user_id=U.id
LEFT JOIN deleted D ON D.user_id=U.id
WHERE SA.id and A.last_activity_at > 1553260577 and B.id is NULL and D.id is NULL and
U.id NOT IN (
( SELECT who_id FROM blacklist WHERE user_id=17 )
UNION
( SELECT user_id FROM blacklist WHERE who_id=17 )
UNION
( SELECT 17 )
)
GROUP BY U.id ORDER BY U.id DESC LIMIT 1 OFFSET 3