I have a database that contains two tables one is users and users_activity.
Users Activity table have some columns including userid that match's with user table's id.
I want to get some result from both tables using JOINS.
Here's my MySQL query. Please let me know what's my mistake / Why this query is taking too much time?
SELECT ua.userid, COUNT(ua.id) user_active, u.name
FROM `user_activity` ua, users u
WHERE ua.target = 'Save Post' OR
ua.target = 'Send comment' OR
ua.target = 'Send Reply'
AND ua.created_on >= 1630454401
AND ua.userid = u.id
GROUP BY ua.userid
ORDER BY COUNT(ua.userid) DESC LIMIT 5
Thank you for your help.