I've developed a user rating system that takes analyzes a users and saves their information with a score in a db.
I'm getting close to 1 Million users rated and stored.
I'm having issues with taking a certain set of users from the table (score < 50) and then comparing their ids against another set of ids without the whole thing crashing down.
The result of the (score < 50) query is around 65k rows and the comparison is against probably 1,000 user ids so the whole thing is running 65k * 1,000.
Is my bottleneck at the db? Or is it at the comparison of ids? Is there a better way to split this up?
Query -> "select username, userscore from users where userscore < 50"
then
Foreach compares values