What is faster in MySQL? WHERE sub request = 0 or IN list
- by Nicolas Manzini
Hello I was wondering what is better in MySQL.
I have a SELECT querry that exclude every entry associated to a banned userID
currently I have a subquerry clause in the WHERE statement that goes like
AND (SELECT COUNT(*) FROM TheBlackListTable WHERE userID = userList.ID AND blackListedID = :userID2 ) = 0
Which will accept every userID not present in the TheBlackListTable
Would it be faster to retrieve first all Banned ID in a previous request and replace the previous clause by
AND creatorID NOT IN listOfBannedID
Thank you!